This repository was archived by the owner on Sep 30, 2024. It is now read-only.
database: revert to official github.com/XSAM/otelsql#47429
Merged
bobheadxi merged 2 commits intoFeb 21, 2023
Conversation
Member
Author
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
ba84992 to
ee33483
Compare
05d208a to
10e014e
Compare
ee33483 to
c9e6835
Compare
0974c15 to
d7c4bab
Compare
c9e6835 to
e1fcc0e
Compare
c0013a4 to
a402f63
Compare
Contributor
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff e1fcc0ec3a2a05921515f12b3df2872468b74491...a402f631c7db02dd2e557b4d2d398c945be482eb.
|
e1fcc0e to
e91382e
Compare
a402f63 to
2fce387
Compare
jhchabran
approved these changes
Feb 15, 2023
793efb8 to
27f3961
Compare
2fce387 to
d031494
Compare
27f3961 to
c2a839a
Compare
d031494 to
7c60078
Compare
bobheadxi
referenced
this pull request
Feb 21, 2023
…#47428) The new architecture of `internal/tracer`: 1. Creates a `TracerProvider` immediately. This provider is preconfigured with service metadata, but does not have a `SpanProcessor`. 2. Creates an OpenTracing bridge using `TracerProvider`, such that we have an OpenTracing Tracer and an OpenTelemetry TracerProvider that bridges the two APIs. We register both as global defaults. 3. On site config initialization, we register a new `SpanProcessor` onto the global `TracerProvider`. 4. From this point on, site config updates: a. Create a new `SpanProcessor` based on site config b. Register the new `SpanProcessor`, which starts processing c. Remove the previous `SpanProcessor`, which flushes it and shuts it down as well Previously, we mimicked the old opentracing setup where we swapped the global tracer, using a similar approach in OpenTelemetry to set up the global TracerProvider. In OpenTelemetry, registering and unregistering `SpanProcessors` is the correct way to do this it seems - the swapping approach causes configuration propagation issues such as XSAM/otelsql#115 (allowing us to revert back to upstream: https://github.com/sourcegraph/sourcegraph/pull/47429) and possibly https://github.com/sourcegraph/sourcegraph/issues/42515 . This correct approach was pointed out in XSAM/otelsql#115 (comment), and makes the setup easier to reason with: - the previously swappable tracers now no longer need to have a locked underlying implementation, they just add logging now - we don't need to update 2 implementations, we make the update at a lower level so that both ends of the OT/OTel bridge are updated - debug mode is managed through a mutable atomic bool, instead of through recreating entire tracers ## Test plan <!-- All pull requests REQUIRE a test plan: https://docs.sourcegraph.com/dev/background-information/testing_principles --> Unit tests assert that span processor updates are propagated. Exporter setup is functionally unchanged --------- Co-authored-by: Jean-Hadrien Chabran <jh@chabran.fr>
7c60078 to
6ad66cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This is enabled by https://github.com/sourcegraph/sourcegraph/pull/47428 - swapping
SpanProcessorinstead ofTracerProvidermeans that we can correctly propagate configuration changes toTracerinstances, so that we no longer need XSAM/otelsql#115 and can revert back to upstream. Switching to upstream, which has moved considerably since we forked it, necessitates a few other OpenTelemetry-related dependency upgrades as well (split out from https://github.com/sourcegraph/sourcegraph/pull/47126)Whether updates are work is tested in https://github.com/sourcegraph/sourcegraph/pull/47428
Test plan
Search with
?trace=1still has SQL traces with args: