Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support of instruments in configuration for telemetry (#4771)
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>
- Loading branch information
Showing
27 changed files
with
20,921 additions
and
2,500 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
### Add support of instruments in configuration for telemetry ([Issue #4319](https://github.com/apollographql/router/issues/4319)) | ||
|
||
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. They may: | ||
- be conditional | ||
- get values from selectors, for instance headers, context or body | ||
- 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) | ||
|
||
By [@bnjjj](https://github.com/bnjjj) in https://github.com/apollographql/router/pull/4771 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20,118 changes: 18,002 additions & 2,116 deletions
20,118
...r/src/configuration/snapshots/apollo_router__configuration__tests__schema_generation.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.