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 spanlogger package #42

Merged
merged 13 commits into from
Oct 7, 2021
Merged

Feature: Add spanlogger package #42

merged 13 commits into from
Oct 7, 2021

Commits on Oct 7, 2021

  1. Instrument test exporter for OpenTracing.

    Also:
    - Move SpanLogger out of chunk package and reuse it.
    - Update the logging in the test-exporter to use gokit.
    
    Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
    tomwilkie authored and aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    8ca3874 View commit details
    Browse the repository at this point in the history
  2. Add comment to appease linter.

    Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
    tomwilkie authored and aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    8fbd239 View commit details
    Browse the repository at this point in the history
  3. Log opening of span at debug level (#1075)

    Signed-off-by: Bryan Boreham <bryan@weave.works>
    bboreham authored and aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    dbd116f View commit details
    Browse the repository at this point in the history
  4. Add SpanLogger.Error method

    Signed-off-by: Bryan Boreham <bryan@weave.works>
    bboreham authored and aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    fd20ed9 View commit details
    Browse the repository at this point in the history
  5. Adds FromContext to spanlogger package. (#2089)

    * Adds FromContext to spanlogger package.
    
    Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
    
    * Removes noop spanlogger for clarity/
    
    Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
    
    * Add missing comment on exported function.
    
    Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
    cyriltovena authored and aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    a10c21b View commit details
    Browse the repository at this point in the history
  6. Fix logger context when creating a spanLogger from context. (#2519)

    * Fix logger context when creating a spanLogger from context.
    
    Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
    
    * Syntax error.
    
    Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
    cyriltovena authored and aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    a4c7548 View commit details
    Browse the repository at this point in the history
  7. Be consistent with span logging, set error=true and use otlog.Error (…

    …#2970)
    
    * Make use of spanlogger when functions that generate spans result in an
    error, this is so we consistently have the error=true tag set.
    
    Signed-off-by: Callum Styan <callumstyan@gmail.com>
    
    * Add spanlogger Error to errcheck exclude
    
    Signed-off-by: Callum Styan <callumstyan@gmail.com>
    
    * Review cleanup.
    
    Signed-off-by: Callum Styan <callumstyan@gmail.com>
    
    * Address more review feedback.
    
    Signed-off-by: Callum Styan <callumstyan@gmail.com>
    
    * We need nolint comments on these lines if we want to assign the ctx in
    attempt to avoid use of the incorrect ctx in the future.
    
    Signed-off-by: Callum Styan <callumstyan@gmail.com>
    
    * Globally exclude SpanLogger.Error() errcheck
    
    Signed-off-by: Marco Pracucci <marco@pracucci.com>
    
    Co-authored-by: Marco Pracucci <marco@pracucci.com>
    2 people authored and aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    02b6bf0 View commit details
    Browse the repository at this point in the history
  8. Added -querier.max-query-lookback and fixed -querier.max-query-into-f…

    …uture (#3452)
    
    * Added querier max-query-lookback and fixed max-query-into-future
    
    Signed-off-by: Marco Pracucci <marco@pracucci.com>
    
    * Updated PR number
    
    Signed-off-by: Marco Pracucci <marco@pracucci.com>
    
    * Fixed tests
    
    Signed-off-by: Marco Pracucci <marco@pracucci.com>
    
    * Removed dead code
    
    Signed-off-by: Marco Pracucci <marco@pracucci.com>
    
    * Added warning for the deprecated flag
    
    Signed-off-by: Marco Pracucci <marco@pracucci.com>
    
    * Addressed review comments
    
    Signed-off-by: Marco Pracucci <marco@pracucci.com>
    pracucci authored and aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    6bd75e8 View commit details
    Browse the repository at this point in the history
  9. Support custom log.Logger instances in spanlogger (#3480)

    * support custom log.Logger instances in spanlogger
    
    Signed-off-by: Robert Fratto <robertfratto@gmail.com>
    
    * Update pkg/util/spanlogger/spanlogger.go
    
    Co-authored-by: Peter Štibraný <peter.stibrany@grafana.com>
    Signed-off-by: Robert Fratto <robertfratto@gmail.com>
    
    * add test, fix bug
    
    Signed-off-by: Robert Fratto <robertfratto@gmail.com>
    
    * ignore errors from logging to test spanlogger
    
    Signed-off-by: Robert Fratto <robertfratto@gmail.com>
    
    Co-authored-by: Peter Štibraný <peter.stibrany@grafana.com>
    2 people authored and aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    7925a99 View commit details
    Browse the repository at this point in the history
  10. 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 Oct 7, 2021
    Configuration menu
    Copy the full SHA
    aad8860 View commit details
    Browse the repository at this point in the history
  11. #4147 added tenant_id tag to tracing spans (#4186)

    * #4147
    1. added logic to add tag `tenant_id` to tracing spans if tenant is defined in context.
    2. added additional tracing spans to merge_querier's methods
    
    Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
    
    * #4147 fixed errors reported by linters
    
    Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
    
    * #4147
    1.changed value of tenant_id tag in tracing span from string value to array
    2. removed import alias for spanlogger
    
    Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
    
    * #4147
    1. fixed tests
    2. fixed name of the spans in mergeQuerier
    
    Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
    
    * #4147 updated CHANGELOG.md
    
    Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
    
    * #4147 passed method's span context to mergeDistinctStringSlice function to create inner spans under this context
    
    Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
    
    * #4147 added mocktracer package for testing purpose
    
    Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
    
    * #4147 fixed code style and removed redundant context param that is not used in callback function
    
    Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
    
    * #4147 fixed code style
    
    Signed-off-by: Vladyslav Diachenko <vlad.diachenko@grafana.com>
    vlad-diachenko authored and aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    93f5cfa View commit details
    Browse the repository at this point in the history
  12. Move pkg/util/spanlogger to root

    Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
    aknuds1 committed Oct 7, 2021
    Configuration menu
    Copy the full SHA
    4062d1d View commit details
    Browse the repository at this point in the history
  13. Add spanlogger package

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