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

feat: OpenTelemetry tracing and metrics #246

Merged
merged 1 commit into from
Jan 21, 2024
Merged

feat: OpenTelemetry tracing and metrics #246

merged 1 commit into from
Jan 21, 2024

Conversation

asger-noer
Copy link
Contributor

@asger-noer asger-noer commented Dec 20, 2023

Telemetry

This PR adds build-in support for OpenTelemetry. All GraphQL queries to the federated services served from bramble are instrumented, this includes service schema updates, service list updates, as well as federated queries from users. The telemetry is exported using the gRPC exporter.

Configuration

Since telemetry is build into bramble the configuration also lives in the bramble root config.json.

enabled will enable telemetry.
url are the url for the collector other system capable of receiving OTLP metrics and spans.
insecure allows skipping the TLS check when communicating with the collector.
service_name allows for the span service name to be set. Useful in multi-deployment settings.

GraphQLClient changes

The GraphQL client has been changed so it now returns the raw timeout error if such error is received. This allows for easier error type checking the processing the error.

Testing

Modified the TestQueryExecutionServiceTimeout to check on the type instead of an error string. This required some modifications to the run function, that now take a function that will test the response, moving the actual testing back into the overall test function itself. Nice.

@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2023

Codecov Report

Attention: 205 lines in your changes are missing coverage. Please review.

Comparison is base (a19dd63) 72.34% compared to head (2fecc7d) 69.51%.

Files Patch % Lines
telemetry.go 0.00% 149 Missing ⚠️
config.go 4.00% 24 Missing ⚠️
executable_schema.go 54.76% 18 Missing and 1 partial ⚠️
client.go 83.01% 7 Missing and 2 partials ⚠️
execution.go 92.50% 3 Missing ⚠️
gateway.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #246      +/-   ##
==========================================
- Coverage   72.34%   69.51%   -2.84%     
==========================================
  Files          27       28       +1     
  Lines        3920     4212     +292     
==========================================
+ Hits         2836     2928      +92     
- Misses        934     1132     +198     
- Partials      150      152       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@asger-noer asger-noer marked this pull request as ready for review December 21, 2023 23:40
@asger-noer asger-noer requested a review from a team as a code owner December 21, 2023 23:40
telemetry.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
introspection.go Outdated Show resolved Hide resolved
executable_schema.go Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
schema.go Outdated Show resolved Hide resolved
Copy link
Member

@pkqk pkqk left a comment

Choose a reason for hiding this comment

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

Just a couple if small things, then we can squash the commits.

.gitignore Outdated Show resolved Hide resolved
client.go Outdated Show resolved Hide resolved
execution.go Outdated Show resolved Hide resolved
format_test.go Show resolved Hide resolved
@asger-noer asger-noer force-pushed the opentelemetry branch 2 times, most recently from e36c1a8 to 7ec99fe Compare January 21, 2024 21:58
This PR adds build-in support for OpenTelemetry. All GraphQL queries to the federated services served from bramble are instrumented, this includes service schema updates, service list updates, as well as federated queries from users. The telemetry is exported using the gRPC exporter.
@asger-noer asger-noer merged commit deb663b into main Jan 21, 2024
4 checks passed
@asger-noer asger-noer deleted the opentelemetry branch January 21, 2024 22:03
@asger-noer asger-noer restored the opentelemetry branch January 21, 2024 22:38
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.

3 participants