Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .changesets/config_njm_split_apollo_telemetry_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
### Split Apollo trace/metrics batch processor configs ([PR #8258](https://github.com/apollographql/router/pull/8258))
The config related to the exporting of Apollo metrics and traces has been separated so that the various configuration can be fine-tuned for each of the Apollo batch processors. The config has changed from:

```yaml
telemetry:
apollo:
batch_processor:
scheduled_delay: 5s
max_export_timeout: 30s
max_export_batch_size: 512
max_concurrent_exports: 1
max_queue_size: 2048
```

To:

```yaml
telemetry:
apollo:
tracing:
# Config for Apollo OTLP and Apollo usage report traces
batch_processor:
max_export_timeout: 130s
scheduled_delay: 5s
max_export_batch_size: 512
max_concurrent_exports: 1
max_queue_size: 2048

metrics:
# Config for Apollo OTLP metrics.
otlp:
batch_processor:
scheduled_delay: 13s # This does not apply config gauge metrics, which have a non-configurable scheduled_delay.
max_export_timeout: 30s
# Config for Apollo usage report metrics.
usage_reports:
batch_processor:
max_export_timeout: 30s
scheduled_delay: 5s
max_queue_size: 2048
```

The old telemetry.apollo.batch_processor config will be used if these new config values are not specified. The configuration used will be shown in an info-level log on router startup.

By [@bonnici](https://github.com/bonnici) in https://github.com/apollographql/router/pull/8258
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
description: Split apollo telemetry batch_processor config into separate traces and metrics configs
actions:
# Apollo usage reports metrics config
- type: copy
from: telemetry.apollo.batch_processor.scheduled_delay
to: telemetry.apollo.metrics.usage_reports.batch_processor.scheduled_delay

- type: copy
from: telemetry.apollo.batch_processor.max_export_timeout
to: telemetry.apollo.metrics.usage_reports.batch_processor.max_export_timeout

- type: copy
from: telemetry.apollo.batch_processor.max_queue_size
to: telemetry.apollo.metrics.usage_reports.batch_processor.max_queue_size

# OTLP metrics config
- type: copy
from: telemetry.apollo.batch_processor.scheduled_delay
to: telemetry.apollo.metrics.otlp.batch_processor.scheduled_delay

- type: copy
from: telemetry.apollo.batch_processor.max_export_timeout
to: telemetry.apollo.metrics.otlp.batch_processor.max_export_timeout

# Tracing config
- type: move
from: telemetry.apollo.batch_processor
to: telemetry.apollo.tracing.batch_processor
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: apollo-router/src/configuration/tests.rs
expression: "&schema"
snapshot_kind: text
---
{
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down Expand Up @@ -141,14 +140,6 @@ snapshot_kind: text
"ApolloTelemetryConfig": {
"additionalProperties": false,
"properties": {
"batch_processor": {
"allOf": [
{
"$ref": "#/definitions/BatchProcessorConfig"
}
],
"description": "Configuration for batch processing."
},
"buffer_size": {
"default": 10000,
"description": "The buffer size for sending traces to Apollo. Increase this if you are experiencing lost traces.",
Expand Down Expand Up @@ -221,6 +212,14 @@ snapshot_kind: text
],
"description": "Field level instrumentation for subgraphs via ftv1. ftv1 tracing can cause performance issues as it is transmitted in band with subgraph responses."
},
"metrics": {
"allOf": [
{
"$ref": "#/definitions/MetricsConfiguration"
}
],
"description": "Configuration for metrics."
},
"metrics_reference_mode": {
"allOf": [
{
Expand Down Expand Up @@ -266,6 +265,42 @@ snapshot_kind: text
],
"default": "enhanced",
"description": "Set the signature normalization algorithm to use when sending Apollo usage reports."
},
"tracing": {
"allOf": [
{
"$ref": "#/definitions/TracingConfiguration"
}
],
"description": "Configuration for tracing."
}
},
"type": "object"
},
"ApolloUsageReportsBatchProcessorConfiguration": {
"properties": {
"max_export_timeout": {
"default": {
"nanos": 0,
"secs": 30
},
"description": "The maximum duration to export a batch of data.\nThe default value is 30 seconds.",
"type": "string"
},
"max_queue_size": {
"default": 2048,
"description": "The maximum queue size to buffer spans for delayed processing. If the\nqueue gets full it drops the reports. The default value is 2048.",
"format": "uint",
"minimum": 0,
"type": "integer"
},
"scheduled_delay": {
"default": {
"nanos": 0,
"secs": 5
},
"description": "The delay interval in milliseconds between two consecutive processing\nof batches. The default value is 5 seconds.",
"type": "string"
}
},
"type": "object"
Expand Down Expand Up @@ -612,7 +647,7 @@ snapshot_kind: text
},
"max_queue_size": {
"default": 2048,
"description": "The maximum queue size to buffer spans for delayed processing. If the\nqueue gets full it drops the spans. The default value of is 2048.",
"description": "The maximum queue size to buffer spans for delayed processing. If the\nqueue gets full it drops the spans. The default value is 2048.",
"format": "uint",
"minimum": 0,
"type": "integer"
Expand Down Expand Up @@ -6246,6 +6281,28 @@ snapshot_kind: text
},
"type": "object"
},
"MetricsConfiguration": {
"additionalProperties": false,
"properties": {
"otlp": {
"allOf": [
{
"$ref": "#/definitions/OtlpMetricsConfiguration"
}
],
"description": "Configuration for exporting metrics via OTLP."
},
"usage_reports": {
"allOf": [
{
"$ref": "#/definitions/UsageReportsMetricsConfiguration"
}
],
"description": "Configuration for exporting metrics via Apollo usage reports."
}
},
"type": "object"
},
"Mode": {
"enum": [
"measure",
Expand Down Expand Up @@ -6498,6 +6555,41 @@ snapshot_kind: text
}
]
},
"OtlpMetricsBatchProcessorConfiguration": {
"properties": {
"max_export_timeout": {
"default": {
"nanos": 0,
"secs": 30
},
"description": "The maximum duration to export a batch of data.\nThe default value is 30 seconds.",
"type": "string"
},
"scheduled_delay": {
"default": {
"nanos": 0,
"secs": 5
},
"description": "The delay interval in milliseconds between two consecutive processing\nof batches. The default value is 5 seconds.",
"type": "string"
}
},
"type": "object"
},
"OtlpMetricsConfiguration": {
"additionalProperties": false,
"properties": {
"batch_processor": {
"allOf": [
{
"$ref": "#/definitions/OtlpMetricsBatchProcessorConfiguration"
}
],
"description": "Batch processor config for OTLP metrics."
}
},
"type": "object"
},
"PersistedQueries": {
"additionalProperties": false,
"description": "Persisted Queries (PQ) configuration",
Expand Down Expand Up @@ -10943,6 +11035,20 @@ snapshot_kind: text
},
"type": "object"
},
"TracingConfiguration": {
"additionalProperties": false,
"properties": {
"batch_processor": {
"allOf": [
{
"$ref": "#/definitions/BatchProcessorConfig"
}
],
"description": "Configuration for tracing batch processor."
}
},
"type": "object"
},
"TrafficShapingConfig": {
"additionalProperties": false,
"description": "Configuration for the traffic shaping plugin",
Expand Down Expand Up @@ -11015,6 +11121,20 @@ snapshot_kind: text
"UriEndpoint": {
"type": "string"
},
"UsageReportsMetricsConfiguration": {
"additionalProperties": false,
"properties": {
"batch_processor": {
"allOf": [
{
"$ref": "#/definitions/ApolloUsageReportsBatchProcessorConfiguration"
}
],
"description": "Batch processor config for Apollo usage report metrics."
}
},
"type": "object"
},
"WebSocketConfiguration": {
"additionalProperties": false,
"description": "WebSocket configuration for a specific subgraph",
Expand Down
Loading