-
Notifications
You must be signed in to change notification settings - Fork 251
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
Move Resource to SDK #86
Conversation
@@ -9,6 +9,8 @@ module SDK | |||
module Trace | |||
# {Tracer} is the SDK implementation of {OpenTelemetry::Trace::Tracer}. | |||
class Tracer | |||
attr_accessor :resource # TODO: should this be read-only? If not, how should exporters know when it is updated? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the java SDK the resource is final
: https://github.com/open-telemetry/opentelemetry-java/blob/master/sdk/src/main/java/io/opentelemetry/sdk/trace/TracerSdk.java#L50 and assigned as an EnvVarResource, which we don't yet have. We could consider doing the same and turn this into a reader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I wasn't sure how we wanted to configure the Resource. Go has WithService
and WithResource
factory methods for the Tracer
, but they're not wired up to anything yet. I'd like to tackle configuration of the Resource in a subsequent PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WithResource/WithService should be moved on the TracerSDK. Only Component will be available in the API based on the OTEP-007 (better than 0007)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OTEP-007 (better than 0007)
🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bogdandrutu this PR moves the Resource
to the SDK, but I didn't see anything in the OTEP-007 indicating how the Resource should be configured. Is the plan to only support configuration from environment variables, as in the Java SDK, or should we also allow explicit manual configuration like the Go SDK?
Open #99 to discuss the Resource initialization concern. Okay if we merge this and discuss in that issue? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Fixes #83