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(clientapi): add operation name and errors to otel instrumentation #1021

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ services:
retries: 30
ports:
- '9090:9090'

otlpcollector:
image: grafana/otel-lgtm
ports:
Expand All @@ -106,19 +106,22 @@ services:
- 4318:4318 # OTLP http receiver
- 3000:3000 # Grafana

# Uncomment this if you want to run the collector locally and send to GCP instead of the one used for local development
# Make sure to have a service json in GOOGLE_APPLICATION_CREDENTIALS_JSON in the .env file

# # Uncomment this if you want to run the collector locally and send to GCP instead of the one used for local development
# # Make sure to have a service json in GOOGLE_APPLICATION_CREDENTIALS_JSON in the .env file
# otlpcollector:
# build:
# context: ./servers/otel-collector
# dockerfile: Dockerfile
# env_file:
# - .env
# volumes:
# - ./servers/otel-collector/otel-collector-config.yaml:/etc/otelcol-contrib/config.yaml
# environment:
# - DEPLOYMENT_ENVIRONMENT_NAME=local
# ports:
# # there are lots more ports available, but these are the only one's
# # currently being used
# - 4317:4317 # OTLP gRPC receiver
# - 4318:4318 # OTLP http receiver
# - 3000:3000 # Grafana
# - 3000:3000 # Grafana
7 changes: 7 additions & 0 deletions servers/client-api/config/router.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,17 @@ telemetry:
request_header: 'apollographql-client-version'
http.server.request.duration:
attributes:
http.response.status_code: true
'http.request.header.apollographql-client-name':
request_header: 'apollographql-client-name'
'http.request.header.apollographql-client-version':
request_header: 'apollographql-client-version'
'graphql.operation.name': # Will set this attribute with the operation name
operation_name: string
'graphql.errors': # Will set this attribute to true if it contains graphql error (includes unauthorized)
on_graphql_error: true
'graphql.critical.error':
error: reason
subgraph:
http.client.request.body.size:
attributes:
Expand Down
Loading