router icon indicating copy to clipboard operation
router copied to clipboard

router config: Adding attributes to telemetry instrumentation failing to apply

Open chriscerk opened this issue 1 year ago • 0 comments

Describe the bug

A clear and concise description of what the bug is.

Adding attributes to instrumentation settings are failing to be applied to metrics.

To Reproduce

  1. Configure the following instrumentation
instrumentation:
    instruments:
      subgraph:
        http.client.request.duration:
          attributes:
            subgraph.graphql.errors: # attribute containing a boolean set to true if response.errors is not empty
              subgraph_on_graphql_error: true
            subgraph.graphql.operation.kind: # capture if the operation is a query, mutation, or subscription
              subgraph_operation_kind: string
        requests.timeout: # apollo_router_timeout_total doesn't have enough metadata to be useful, so we're creating a new metric
            value: unit
            type: counter
            unit: request
            description: "subgraph requests containing subgraph timeout"
            attributes:
              subgraph.name: true
              subgraph.graphql.operation.name: true
              subgraph.graphql.operation.type: true
            condition:
              eq:
                - "request timed out"
                - error: reason
  1. Deploy
  2. Lacking of instrumentation applying

Expected behavior

A clear and concise description of what you expected to happen.

  • Attributes added to metrics
    • apollo_router_timeout_total to have labels based on the following attributes since we have configuration for requests.timeout
      • subgraph.name
      • subgraph.graphql.operation.name: true
      • subgraph.graphql.operation.type: true
    • apollo_router_http_request_duration (with corresponding suffixes) to have labels based on the following attributes since we have configuration for http.client.request.duration
      • subgraph_on_graphql_error
      • subgraph_operation_kind
  • Clear documentation on how to apply instrumentation - the above instrumentation is syntactically correct via jsonschema checks against the yaml but seemingly fails to apply - there is a large lack of documentation on how instrumentation affects OTEL metrics

Output

If applicable, add output to help explain your problem.

n/a - and not seeing any issues deploying or errs/warning in router logs

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

n/a

Additional context

Add any other context about the problem here.

chriscerk avatar Oct 18 '24 19:10 chriscerk