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

Allow OpenTelemetry instrumentation #96

Merged
merged 5 commits into from
Apr 23, 2024

Conversation

nineinchnick
Copy link
Member

@nineinchnick nineinchnick commented Oct 23, 2023

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

@cla-bot cla-bot bot added the cla-signed label Oct 23, 2023
@nineinchnick nineinchnick marked this pull request as ready for review April 14, 2024 08:25
Copy link
Member

@losipiuk losipiuk left a 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

@nineinchnick
Copy link
Member Author

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)
Copy link
Member

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?

Copy link
Member Author

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.

@losipiuk losipiuk merged commit d61b3c2 into trinodb:master Apr 23, 2024
5 checks passed
@nineinchnick nineinchnick deleted the otel-example branch April 23, 2024 07:58
@nineinchnick nineinchnick mentioned this pull request Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants