router icon indicating copy to clipboard operation
router copied to clipboard

Allow setting metric attributes from a context sub key

Open Geal opened this issue 11 months ago • 2 comments

metric attributes can be set from a context key: https://www.apollographql.com/docs/router/configuration/telemetry/exporters/metrics/overview/#attributes

But it only supports the key to a top level object. It would be useful to get data from sub keys from an object like:

telemetry:
  exporters:
    metrics:
      common:
        attributes:
          supergraph:
            context:
              - named: toplevelobject.sub_key

Geal avatar Mar 05 '24 13:03 Geal

I think this will be solved by the work that @bnjjj is working on.

BrynCooke avatar Mar 11 '24 10:03 BrynCooke

Yes it will be possible to do this using selectors and custom instruments cc #4319 #4771

bnjjj avatar Mar 11 '24 12:03 bnjjj