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

Move Resource to SDK #86

Merged
merged 2 commits into from
Sep 19, 2019
Merged

Conversation

fbogsany
Copy link
Contributor

Fixes #83

@@ -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?
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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)

Copy link
Contributor Author

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)

🤣

Copy link
Contributor Author

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?

@fbogsany
Copy link
Contributor Author

Open #99 to discuss the Resource initialization concern. Okay if we merge this and discuss in that issue?

Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@fbogsany fbogsany merged commit be5dcd8 into open-telemetry:master Sep 19, 2019
@fbogsany fbogsany deleted the move-resource-to-sdk branch September 19, 2019 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SDK: move Resource from API to SDK
3 participants