Skip to content

Commit

Permalink
Add enabled field for telemetry exporters
Browse files Browse the repository at this point in the history
Part of #3226
  • Loading branch information
bryn committed Oct 2, 2023
1 parent e4244b1 commit 20bf2bb
Show file tree
Hide file tree
Showing 57 changed files with 246 additions and 164 deletions.
20 changes: 20 additions & 0 deletions .changesets/config_bryn_telemetry_enabled_field.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### Add `enabled` field for telemetry exporters ([PR #3952](https://github.com/apollographql/router/pull/3952))

Telemetry configuration now supports `enabled` on all exporters. This allows exporters to be disabled without removing them from the configuration and in addition allows for a more streamlined default configuration.

```diff
telemetry:
tracing:
datadog:
+ enabled: true
jaeger:
+ enabled: true
otlp:
+ enabled: true
zipkin:
+ enabled: true
```

Existing configurations will be migrated to the new format automatically on startup. However, you should update your configuration to use the new format as soon as possible.

By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographql/router/pull/3952
8 changes: 4 additions & 4 deletions apollo-router/src/configuration/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,13 @@ impl Metrics {
opt.metrics.prometheus,
"$.metrics.prometheus[?(@.enabled==true)]",
opt.tracing.otlp,
"$.tracing.otlp[?(@.endpoint)]",
"$.tracing.otlp[?(@.enabled==true)]",
opt.tracing.datadog,
"$.tracing.datadog[?(@.endpoint)]",
"$.tracing.datadog[?(@.enabled==true)]",
opt.tracing.jaeger,
"$.tracing.jaeger[?(@..endpoint)]",
"$.tracing.jaeger[?(@.enabled==true)]",
opt.tracing.zipkin,
"$.tracing.zipkin[?(@.endpoint)]"
"$.tracing.zipkin[?(@.enabled==true)]"
);
log_usage_metrics!(
value.apollo.router.config.batching,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
description: Telemetry exporters now have an enabled field
actions:
- type: add
path: telemetry.tracing.jaeger
name: enabled
value: true
- type: add
path: telemetry.tracing.otlp
name: enabled
value: true
- type: add
path: telemetry.tracing.zipkin
name: enabled
value: true
- type: add
path: telemetry.tracing.datadog
name: enabled
value: true
- type: add
path: telemetry.metrics.otlp
name: enabled
value: true
Original file line number Diff line number Diff line change
Expand Up @@ -2073,19 +2073,6 @@ expression: "&schema"
"properties": {
"batch_processor": {
"description": "Configuration for batch processing.",
"default": {
"scheduled_delay": {
"secs": 5,
"nanos": 0
},
"max_queue_size": 2048,
"max_export_batch_size": 512,
"max_export_timeout": {
"secs": 30,
"nanos": 0
},
"max_concurrent_exports": 1
},
"type": "object",
"properties": {
"max_concurrent_exports": {
Expand Down Expand Up @@ -4501,24 +4488,11 @@ expression: "&schema"
"description": "Open Telemetry native exporter configuration",
"type": "object",
"required": [
"endpoint"
"enabled"
],
"properties": {
"batch_processor": {
"description": "Batch processor settings",
"default": {
"scheduled_delay": {
"secs": 5,
"nanos": 0
},
"max_queue_size": 2048,
"max_export_batch_size": 512,
"max_export_timeout": {
"secs": 30,
"nanos": 0
},
"max_concurrent_exports": 1
},
"type": "object",
"properties": {
"max_concurrent_exports": {
Expand Down Expand Up @@ -4560,6 +4534,10 @@ expression: "&schema"
}
}
},
"enabled": {
"description": "Enable otlp",
"type": "boolean"
},
"endpoint": {
"description": "The endpoint to send data to",
"type": "string"
Expand Down Expand Up @@ -4705,24 +4683,11 @@ expression: "&schema"
"description": "Datadog exporter configuration",
"type": "object",
"required": [
"endpoint"
"enabled"
],
"properties": {
"batch_processor": {
"description": "batch processor configuration",
"default": {
"scheduled_delay": {
"secs": 5,
"nanos": 0
},
"max_queue_size": 2048,
"max_export_batch_size": 512,
"max_export_timeout": {
"secs": 30,
"nanos": 0
},
"max_concurrent_exports": 1
},
"type": "object",
"properties": {
"max_concurrent_exports": {
Expand Down Expand Up @@ -4769,6 +4734,10 @@ expression: "&schema"
"default": false,
"type": "boolean"
},
"enabled": {
"description": "Enable datadog",
"type": "boolean"
},
"endpoint": {
"description": "The endpoint to send to",
"type": "string"
Expand Down Expand Up @@ -4800,38 +4769,11 @@ expression: "&schema"
{
"type": "object",
"required": [
"agent"
"enabled"
],
"properties": {
"agent": {
"description": "Agent configuration",
"type": "object",
"required": [
"endpoint"
],
"properties": {
"endpoint": {
"description": "The endpoint to send to",
"type": "string"
}
},
"additionalProperties": false
},
"batch_processor": {
"description": "Batch processor configuration",
"default": {
"scheduled_delay": {
"secs": 5,
"nanos": 0
},
"max_queue_size": 2048,
"max_export_batch_size": 512,
"max_export_timeout": {
"secs": 30,
"nanos": 0
},
"max_concurrent_exports": 1
},
"type": "object",
"properties": {
"max_concurrent_exports": {
Expand Down Expand Up @@ -4872,31 +4814,56 @@ expression: "&schema"
"type": "string"
}
}
},
"collector": {
"description": "Collector configuration",
"type": "object",
"properties": {
"endpoint": {
"description": "The endpoint to send reports to",
"type": "string"
},
"password": {
"description": "The optional password",
"default": null,
"type": "string",
"nullable": true
},
"username": {
"description": "The optional username",
"default": null,
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"enabled": {
"description": "Enable Jaeger",
"type": "boolean"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"collector"
"enabled"
],
"properties": {
"agent": {
"description": "Agent configuration",
"type": "object",
"properties": {
"endpoint": {
"description": "The endpoint to send to",
"type": "string"
}
},
"additionalProperties": false
},
"batch_processor": {
"description": "Batch processor configuration",
"default": {
"scheduled_delay": {
"secs": 5,
"nanos": 0
},
"max_queue_size": 2048,
"max_export_batch_size": 512,
"max_export_timeout": {
"secs": 30,
"nanos": 0
},
"max_concurrent_exports": 1
},
"type": "object",
"properties": {
"max_concurrent_exports": {
Expand Down Expand Up @@ -4938,29 +4905,9 @@ expression: "&schema"
}
}
},
"collector": {
"description": "Collector configuration",
"type": "object",
"required": [
"endpoint"
],
"properties": {
"endpoint": {
"description": "The endpoint to send reports to",
"type": "string"
},
"password": {
"description": "The optional password",
"type": "string",
"nullable": true
},
"username": {
"description": "The optional username",
"type": "string",
"nullable": true
}
},
"additionalProperties": false
"enabled": {
"description": "Enable Jaeger",
"type": "boolean"
}
},
"additionalProperties": false
Expand All @@ -4972,24 +4919,11 @@ expression: "&schema"
"description": "OpenTelemetry native exporter configuration",
"type": "object",
"required": [
"endpoint"
"enabled"
],
"properties": {
"batch_processor": {
"description": "Batch processor settings",
"default": {
"scheduled_delay": {
"secs": 5,
"nanos": 0
},
"max_queue_size": 2048,
"max_export_batch_size": 512,
"max_export_timeout": {
"secs": 30,
"nanos": 0
},
"max_concurrent_exports": 1
},
"type": "object",
"properties": {
"max_concurrent_exports": {
Expand Down Expand Up @@ -5031,6 +4965,10 @@ expression: "&schema"
}
}
},
"enabled": {
"description": "Enable otlp",
"type": "boolean"
},
"endpoint": {
"description": "The endpoint to send data to",
"type": "string"
Expand Down Expand Up @@ -5334,24 +5272,11 @@ expression: "&schema"
"description": "Zipkin exporter configuration",
"type": "object",
"required": [
"endpoint"
"enabled"
],
"properties": {
"batch_processor": {
"description": "Batch processor configuration",
"default": {
"scheduled_delay": {
"secs": 5,
"nanos": 0
},
"max_queue_size": 2048,
"max_export_batch_size": 512,
"max_export_timeout": {
"secs": 30,
"nanos": 0
},
"max_concurrent_exports": 1
},
"type": "object",
"properties": {
"max_concurrent_exports": {
Expand Down Expand Up @@ -5393,6 +5318,10 @@ expression: "&schema"
}
}
},
"enabled": {
"description": "Enable zipkin",
"type": "boolean"
},
"endpoint": {
"description": "The endpoint to send to",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ telemetry:
endpoint: default
batch_processor:
scheduled_delay: 100ms
enabled: true

Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ telemetry:
endpoint: default
batch_processor:
max_export_timeout: 5s
enabled: true

Loading

0 comments on commit 20bf2bb

Please sign in to comment.