How should we configure our "default" opentelemetry subscriber? #212
garypen
started this conversation in
Implementation
Replies: 1 comment 1 reply
-
Currently we can have both the JSON subscriber and the Jaeger/OTLP one working at the same time. The JSON subscriber gets the events like I think the subscriber should be created only once (not on every request like we do right now) and keep the fallback on the env filter (right now we setup the JSON logger with env filter, then try to add the OTLP one, and return None if the OTLP subscriber creation failed, while we should just return the JSON one) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now for each graphql request, we try to get a tracing subscriber from the supplied configuration. If no configuration is provided, i.e.: not using otlp or jaeger, then we end up with the "default" subscriber.
I think this is then created from the default subscriber we set in main.rs where we initialise a JSON subscriber. The question here is "do we want the subscriber configured for main binary logging to be the same subscriber we use for library tracing?". I think not, but it's something we need to decide.
I think a better approach would be to configure a "sane" subscriber to use if there is no configured oltp or jaeger configuration provided. Almost certainly not using a json formatter. Something based on the GLOBAL_ENV_FILTER.
Something like:
(Ideally, we wouldn't do this processing each time we call run_graphql_request(), but would hoist it and just do it when we process configuration and hold a non-optional dispatcher in configuration.)
What do people think? (and is my understanding of the way logging/tracing works correct?)
Beta Was this translation helpful? Give feedback.
All reactions