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

Custom instruments defined by yaml #4319

Closed
Tracked by #3226
BrynCooke opened this issue Dec 4, 2023 · 0 comments · Fixed by #4771
Closed
Tracked by #3226

Custom instruments defined by yaml #4319

BrynCooke opened this issue Dec 4, 2023 · 0 comments · Fixed by #4771
Assignees

Comments

@BrynCooke
Copy link
Contributor

BrynCooke commented Dec 4, 2023

Implement custom instruments defined by yaml as documented in:
https://www.apollographql.com/docs/router/configuration/telemetry/instrumentation/instruments

This will allow users to avoid reaching for a custom plugin when they need to collect metrics for when things happen/

@bnjjj bnjjj self-assigned this Feb 5, 2024
bnjjj added a commit that referenced this issue Apr 2, 2024
Add support for custom and standard instruments through the
configuration file. You'll be able to add your own custom metrics just
using the configuration file. It can be conditional, get values from
selectors like headers, context, body. And the metrics can have
different types like `histogram` or `counter`.

Example:

```yaml title="router.yaml"
telemetry:
  instrumentation:
    instruments:
      router:
        http.server.active_requests: true
        acme.request.duration:
          value: duration
          type: counter
          unit: kb
          description: "my description"
          attributes:
            http.response.status_code: true
            "my_attribute":
              response_header: "x-my-header"
  
      supergraph:
        acme.graphql.requests:
          value: unit
          type: counter
          unit: count
          description: "supergraph requests"
          
      subgraph:
        acme.graphql.subgraph.errors:
          value: unit
          type: counter
          unit: count
          description: "my description"
```



[Documentation](https://www.apollographql.com/docs/router/configuration/telemetry/instrumentation/instruments)

Fixes #4319 

---------

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
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 a pull request may close this issue.

2 participants