Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add dslog and tenant packages #33

Closed
wants to merge 12 commits into from
Closed

Feature: Add dslog and tenant packages #33

wants to merge 12 commits into from

Commits on Sep 9, 2021

  1. Move some utility functions out of util and into their own packages…

    … (#3734)
    
    * separate out some util packages
    
    Signed-off-by: Kevin Minehart <kmineh0151@gmail.com>
    
    * use goimports with -local
    
    Signed-off-by: Kevin Minehart <kmineh0151@gmail.com>
    
    * refactor: reduce the number of transitive imports when using math and logging functions
    
    Signed-off-by: Kevin Minehart <kmineh0151@gmail.com>
    
    * add deprecation warning to pkg/log/log.go
    
    Signed-off-by: Kevin Minehart <kmineh0151@gmail.com>
    kminehart authored and aknuds1 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    cc94164 View commit details
    Browse the repository at this point in the history
  2. Remove util.Logger and move util.InitLogger to util/log package. (#3781)

    * Remove util.Logger and move util.InitLogger to util/log package.
    
    Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
    
    * Review feedback.
    
    Signed-off-by: Peter Štibraný <peter.stibrany@grafana.com>
    pstibrany authored and aknuds1 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    4795265 View commit details
    Browse the repository at this point in the history
  3. Chore: Upgrade weaveworks/common (#4462)

    * Chore: Upgrade weaveworks/common
    
    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    
    * Add changelog entries
    
    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    
    * Use instrument.NewHistogramCollector
    
    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    
    * Use tracing.ExtractSampledTraceID
    
    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    aknuds1 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    7a30a89 View commit details
    Browse the repository at this point in the history
  4. Add tenant resolver (#3486)

    * Add tenant resolver package
    
    This implements the multi tenant resolver as described by the [proposal]
    for multi tenant query-federation.
    
    By default it behaves like before, but it's implementation can be
    swapped out.
    
    [proposal]: cortexproject/cortex#3364
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Replace usages of `ExtractOrgID`
    
    Use TenantID or UserID depending on which of the methods are meant to be
    used.
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Replace usages of `ExtractOrgIDFromHTTPRequest`
    
    This is replaced by ExtractTenantIDFromHTTPRequest, which makes sure
    that exactly one tenant ID is set.
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Add methods to `tenant` package to use resolver directly
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Remove UserID method from Resolver interface
    
    We need a better definition for what we are trying to achieve with
    UserID before we can add it to the interface
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Update comment on the TenantID/TenantIDs
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Improve performance of NormalizeTenantIDs
    
    - reduce allocations by reusing the input slice during de-duplication
    
    Signed-off-by: Christian Simon <simon@swine.de>
    simonswine authored and aknuds1 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    3120328 View commit details
    Browse the repository at this point in the history
  5. Add multi tenant query federation (#3250)

    * Add tenant query federation
    
    This experimental feature allows queries to cover data from more than a
    single Cortex tenant and can be activated by supplying
    `-tenant-federation.enabled` to all cortex instances.
    
    To query multiple tenants a `|` separated tenant list can be specified
    in the `X-Scope-OrgID` header. The source tenant of a metric will be
    exposed in the label `__tenant_id__`.
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Aggregate the limit of maxQueriers correctly
    
    This ensures the limit is aggregated correctly of the setting of each
    individual tenant. It also implements the logic for the v2 query
    frontend.
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Fix tenant labels and make LabelNames more efficient
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Use tsdb_errors for error handling
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Fix uninitialized label matcher
    
    Regexp matcher need to be initialized, this adds a test for regexp
    matcher and fixes the underlying issue.
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Use map for filterValuesByMatchers to reduce allocations
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Address review suggestions
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Add validation.SmallestPositiveNonZeroIntPerTenant to avoid code duplication
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Add limitations and experimental status to docs
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Remove unnecessary cast of defaultTenantLabel
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Handle query-range limits for multi tenant queries
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Skip results cache, if multi tenants query
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Add failint to ensure query path supports multiple tenants
    
    To avoid any future regressions in the multi tenant support within the
    query path, a faillint command tests if TenantID is used and if it
    finds one, it suggestest using TenantIDs instead>
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Align CHANGELOG line with the flag description
    
    Signed-off-by: Christian Simon <simon@swine.de>
    
    * Add a limitation about missing results cache
    
    Signed-off-by: Christian Simon <simon@swine.de>
    simonswine authored and aknuds1 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    615a344 View commit details
    Browse the repository at this point in the history
  6. Restrict path segments in TenantIDs (#4375) (#4376)

    This prevents paths generated from TenantIDs to become vulnerable to
    path traversal attacks. CVE-2021-36157
    
    Signed-off-by: Christian Simon <simon@swine.de>
    bboreham authored and aknuds1 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    d1ef33a View commit details
    Browse the repository at this point in the history
  7. Move log and tenant packages to root

    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    aknuds1 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    dfe7611 View commit details
    Browse the repository at this point in the history
  8. Remove globals

    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    aknuds1 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    b71e41c View commit details
    Browse the repository at this point in the history
  9. Update changelog

    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    aknuds1 committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    c351ce3 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2021

  1. Fix changelog

    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    aknuds1 committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    a4de400 View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'origin/main' into feat/log

    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    aknuds1 committed Sep 10, 2021
    Configuration menu
    Copy the full SHA
    30d0c6a View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2021

  1. Reduce tenant API

    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    aknuds1 committed Sep 15, 2021
    Configuration menu
    Copy the full SHA
    893e0f0 View commit details
    Browse the repository at this point in the history