Skip to content

Commit

Permalink
feat(clientapi): add operation name and errors to otel instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kschelonka committed Jan 9, 2025
1 parent b1e828c commit 2c95c18
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
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

0 comments on commit 2c95c18

Please sign in to comment.