-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[service] Move TracerProvider initialization to service/telemetry package #8171
[service] Move TracerProvider initialization to service/telemetry package #8171
Conversation
7ea601a
to
28300f1
Compare
// needed for supporting the zpages extension | ||
sdktrace.WithSampler(alwaysRecord()), |
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.
This was not present on service/telemetry.go
, but was present on service/telemetry/telemetry.go
initialization logic, so I added it here.
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.
This should probably be available as an option in the function, since zpages will always want this on, but users will want the ability to configure their own samplers
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.
This should probably be available as an option in the function, since zpages will always want this on, but users will want the ability to configure their own samplers
By "an option in the function" you mean an option in newTracerProvider
? Would this option be exposed to end users?
Codecov ReportAttention:
... and 1 file with indirect coverage changes 📢 Thoughts on this report? Let us know! |
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.
Overall i think this is an improvement, there are some conflicts that will need resolving
// needed for supporting the zpages extension | ||
sdktrace.WithSampler(alwaysRecord()), |
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.
This should probably be available as an option in the function, since zpages will always want this on, but users will want the ability to configure their own samplers
// supported protocols for exporters | ||
const ( | ||
// ProtocolProtobufHTTP is the OTLP/HTTP with Protobuf encoding protocol | ||
ProtocolProtobufHTTP = "http/protobuf" | ||
// ProtocolProtobufGRPC is the OTLP/gRPC protocol | ||
ProtocolProtobufGRPC = "grpc/protobuf" | ||
) | ||
|
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.
This is now exposed by this package. I think it makes sense to expose it given it is part of the public API
// NormalizeEndpoint takes an HTTP(s) endpoint and adds the protocol prefix if missing. | ||
func NormalizeEndpoint(endpoint string) string { | ||
if !strings.HasPrefix(endpoint, "https://") && !strings.HasPrefix(endpoint, "http://") { | ||
return fmt.Sprintf("http://%s", endpoint) | ||
} | ||
return endpoint | ||
} |
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.
This is now exposed by this package and imported by service/internal/proctelemetry
. I am not sure if this makes sense and want some feedback on this. Should we move this to a package in service/internal
? Should this be a public method on the Otlp
configuration struct instead?
cc @codeboten
For those following at home, this is blocked by open-telemetry/opentelemetry-go-contrib/pull/4228 after offline conversation with Alex. This will solve the comments above |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Waiting on #8620 |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Description:
Moves TracerProvider initialization to
service/telemetry
package. To do this while avoiding duplicated code and import cycles I also had to:service/internal/resource
package to handle resource creation.service/telemetry
fromservice/internal/proctelemetry
andservice
.A second PR will move the meter provider initialization to
service/telemetry
for consistency.Link to tracking Issue: Updates #8170