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

fix up otel init #73

Merged
merged 2 commits into from
Dec 3, 2024
Merged

fix up otel init #73

merged 2 commits into from
Dec 3, 2024

Conversation

ryanfkeepers
Copy link
Contributor

Otel initialization is still somewhat hacky, but we're moving towards a cleaner implementation This change introduces the metrics (aka, meter) producer, and moves all producers (trace, log, metrics) into their own constructor funcs.

Next PR will use this provider to implement a metrics api.

@ryanfkeepers ryanfkeepers added the enhancement New feature or request label Nov 7, 2024
@ryanfkeepers ryanfkeepers self-assigned this Nov 7, 2024
@ryanfkeepers ryanfkeepers force-pushed the otel-metrics branch 2 times, most recently from df60632 to 59102b6 Compare November 27, 2024 17:05
internal/node/otel.go Outdated Show resolved Hide resolved
conn *grpc.ClientConn,
server *resource.Resource,
) (*sdkTrace.TracerProvider, error) {
if ctx != nil {

Choose a reason for hiding this comment

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

Few questions:

  1. What's the reasoning behind the 5 sec timeout?
  2. If the caller supplies a nil ctx, we'll fail to apply the 5 sec timeout to the request. That means request can run indefinitely. Instead, would it be better to return an error if ctx is nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1/ I think it's to avoid hanging on the connection request. I think it's unnecessary in most cases, but also a common recommend in example code.

2/ good point. I don't think an error is correct, but I can indeed return.

Choose a reason for hiding this comment

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

Sounds good!

internal/node/otel.go Outdated Show resolved Hide resolved
internal/node/otel.go Outdated Show resolved Hide resolved
Base automatically changed from tester-framework to main December 3, 2024 21:10
Otel initialization is still somewhat hacky, but we're moving towards a
cleaner implementation  This change introduces the metrics (aka, meter)
producer, and moves all producers (trace, log, metrics) into their own
constructor funcs.

Next PR will use this provider to implement a metrics api.
@ryanfkeepers ryanfkeepers merged commit 078ed21 into main Dec 3, 2024
1 check passed
@ryanfkeepers ryanfkeepers deleted the otel-metrics branch December 3, 2024 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants