-
Notifications
You must be signed in to change notification settings - Fork 65
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
Allow OpenTelemetry instrumentation #96
Conversation
d99bc2e
to
a6d33de
Compare
a6d33de
to
f372b87
Compare
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.
LGTM % I did not read the docs
The docs include an example how to use OpenTelemetry, so it's important. Ignore the other commit that formats the README. |
otelClient := &http.Client{ | ||
Transport: otelhttp.NewTransport(http.DefaultTransport), | ||
} | ||
trino.RegisterCustomClient("otel", otelClient) |
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 does not return err?
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.
It does, but the example above didn't check for it. I don't think error handling must be in every example, it would make it harder to read and since this is users code, we don't know a good way to handle errors anyway. Also, common Go linters detect unhandled errors.
Pass parent context to HTTP requests and document how to use the OTEL transport to make sure that traces are propagated. The OTEL transport will also create spans for all HTTP requests.
An alternative to #95.
Supersedes #92