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

Rename trace_config to common #4044

Merged
merged 2 commits into from
Oct 17, 2023
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
14 changes: 14 additions & 0 deletions .changesets/config_bryn_telemetry_config_fixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Bring telemetry tracing config and metrics config into alignment ([Issue #4043](https://github.com/apollographql/router/issues/4043))

Configuration between tracing and metrics was inconsistent and did not align with otel spec terminology. The following changes have been made to router.yaml configuration:

`trace_config` has been renamed to `common`

```diff
telemetry
tracing:
- trace_config:
+ common:
```

By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographql/router/pull/4044
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: telemetry.tracing.trace_config has been renamed to telemetry.tracing.common
actions:
- type: move
from: telemetry.tracing.trace_config
to: telemetry.tracing.common
2 changes: 1 addition & 1 deletion apollo-router/src/configuration/migrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The filename should begin with a 4 digit numerical prefix. This allows us to app

The yaml consists of a description and a number of actions:
```yaml
description: telemetry.tracing.trace_config.attributes.router has been renamed to 'supergraph' for consistency
description: telemetry.tracing.common.attributes.router has been renamed to 'supergraph' for consistency
actions:
- type: move
from: some.source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4693,6 +4693,155 @@ expression: "&schema"
"description": "Tracing configuration",
"type": "object",
"properties": {
"common": {
"description": "Common configuration",
"type": "object",
"properties": {
"attributes": {
"description": "The resources configured on the tracing pipeline",
"default": {},
"type": "object",
"additionalProperties": {
"anyOf": [
{
"description": "bool values",
"type": "boolean"
},
{
"description": "i64 values",
"type": "integer",
"format": "int64"
},
{
"description": "f64 values",
"type": "number",
"format": "double"
},
{
"description": "String values",
"type": "string"
},
{
"description": "Array of homogeneous values",
"anyOf": [
{
"description": "Array of bools",
"type": "array",
"items": {
"type": "boolean"
}
},
{
"description": "Array of integers",
"type": "array",
"items": {
"type": "integer",
"format": "int64"
}
},
{
"description": "Array of floats",
"type": "array",
"items": {
"type": "number",
"format": "double"
}
},
{
"description": "Array of strings",
"type": "array",
"items": {
"type": "string"
}
}
]
}
]
}
},
"max_attributes_per_event": {
"description": "The maximum attributes per event before discarding",
"default": 128,
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"max_attributes_per_link": {
"description": "The maximum attributes per link before discarding",
"default": 128,
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"max_attributes_per_span": {
"description": "The maximum attributes per span before discarding",
"default": 128,
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"max_events_per_span": {
"description": "The maximum events per span before discarding",
"default": 128,
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"max_links_per_span": {
"description": "The maximum links per span before discarding",
"default": 128,
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"parent_based_sampler": {
"description": "Whether to use parent based sampling",
"default": true,
"type": "boolean"
},
"sampler": {
"description": "The sampler, always_on, always_off or a decimal between 0.0 and 1.0",
"anyOf": [
{
"description": "Sample a given fraction. Fractions >= 1 will always sample.",
"type": "number",
"format": "double"
},
{
"oneOf": [
{
"description": "Always sample",
"type": "string",
"enum": [
"always_on"
]
},
{
"description": "Never sample",
"type": "string",
"enum": [
"always_off"
]
}
]
}
]
},
"service_name": {
"description": "The trace service name",
"default": null,
"type": "string",
"nullable": true
},
"service_namespace": {
"description": "The trace service namespace",
"default": null,
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"datadog": {
"description": "Datadog exporter configuration",
"type": "object",
Expand Down Expand Up @@ -5130,155 +5279,6 @@ expression: "&schema"
},
"additionalProperties": false
},
"trace_config": {
"description": "Common configuration",
"type": "object",
"properties": {
"attributes": {
"description": "The resources configured on the tracing pipeline",
"default": {},
"type": "object",
"additionalProperties": {
"anyOf": [
{
"description": "bool values",
"type": "boolean"
},
{
"description": "i64 values",
"type": "integer",
"format": "int64"
},
{
"description": "f64 values",
"type": "number",
"format": "double"
},
{
"description": "String values",
"type": "string"
},
{
"description": "Array of homogeneous values",
"anyOf": [
{
"description": "Array of bools",
"type": "array",
"items": {
"type": "boolean"
}
},
{
"description": "Array of integers",
"type": "array",
"items": {
"type": "integer",
"format": "int64"
}
},
{
"description": "Array of floats",
"type": "array",
"items": {
"type": "number",
"format": "double"
}
},
{
"description": "Array of strings",
"type": "array",
"items": {
"type": "string"
}
}
]
}
]
}
},
"max_attributes_per_event": {
"description": "The maximum attributes per event before discarding",
"default": 128,
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"max_attributes_per_link": {
"description": "The maximum attributes per link before discarding",
"default": 128,
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"max_attributes_per_span": {
"description": "The maximum attributes per span before discarding",
"default": 128,
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"max_events_per_span": {
"description": "The maximum events per span before discarding",
"default": 128,
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"max_links_per_span": {
"description": "The maximum links per span before discarding",
"default": 128,
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"parent_based_sampler": {
"description": "Whether to use parent based sampling",
"default": true,
"type": "boolean"
},
"sampler": {
"description": "The sampler, always_on, always_off or a decimal between 0.0 and 1.0",
"anyOf": [
{
"description": "Sample a given fraction. Fractions >= 1 will always sample.",
"type": "number",
"format": "double"
},
{
"oneOf": [
{
"description": "Always sample",
"type": "string",
"enum": [
"always_on"
]
},
{
"description": "Never sample",
"type": "string",
"enum": [
"always_off"
]
}
]
}
]
},
"service_name": {
"description": "The trace service name",
"default": null,
"type": "string",
"nullable": true
},
"service_namespace": {
"description": "The trace service namespace",
"default": null,
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"zipkin": {
"description": "Zipkin exporter configuration",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: apollo-router/src/configuration/tests.rs
expression: new_config
---
---
telemetry:
tracing:
common:
service_name: foo

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
telemetry:
tracing:
trace_config:
service_name: "foo"

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ supergraph:
listen: 1.2.3.4:5
telemetry:
tracing:
trace_config:
common:
attributes:
foo: bar
max_attributes_per_event: 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
telemetry:
tracing:
trace_config:
common:
service_name: router
zipkin:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
telemetry:
tracing:
trace_config:
common:
service_name: router
zipkin:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
telemetry:
tracing:
trace_config:
common:
service_name: router
zipkin:
enabled: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
telemetry:
tracing:
trace_config:
common:
service_name: router
zipkin:
enabled: true
Expand Down
Loading