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

add exporter retry configuration #97

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## Unreleased

* Adding initial instrumentation configuration schema

* Adding initial instrumentation configuration schema. [#91](https://github.com/open-telemetry/opentelemetry-configuration/pull/91)
* Add exporter `retry` configuration. [#97](https://github.com/open-telemetry/opentelemetry-configuration/pull/97)

## [v0.2.0] - 2024-05-08

Expand Down
2 changes: 2 additions & 0 deletions examples/anchors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ exporters:
api-key: !!str 1234
compression: gzip
timeout: 10000
retry:
disabled: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enabled seems to be easier - avoids double negation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec defines that options like this have to be disabled and not enabled. But I can't find it right now... so I may be wrong.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


logger_provider:
processors:
Expand Down
16 changes: 16 additions & 0 deletions examples/kitchen-sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ logger_provider:
#
# Environment variable: OTEL_EXPORTER_OTLP_INSECURE, OTEL_EXPORTER_OTLP_LOGS_INSECURE
insecure: false
# Configure retry policy.
retry:
# Configure retry disabled.
disabled: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of @carlosalberto's suggestion to have a strategy field, defaulting to exponential_retry and supporting none.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like it, and I think it could resolve my issues. If we allow for future retry strategies, including custom/3rd party strategies, then SIGs have the freedom to provide their own configuration to suit their specific implementation.
If the official exponential retry strategy is locked down in spec, SIGs can migrate across to it at their leisure (w.r.t using it with file-based configuration).

How about treating retry policy similarly to how we treat a Sampler - it's configuration is optional and defaults to exponential_retry, at most one can be provided, and custom is allowed? Something like:

retry:
  disabled: false
  <policy-name>:
    property: value

disabled could actually be replaced by a noop/none/noretry policy, which might make the interface between an exporter and the retry policy a little cleaner.

# Configure a simple span processor.
- simple:
# Configure exporter.
Expand Down Expand Up @@ -199,6 +203,10 @@ meter_provider:
#
# Environment variable: OTEL_EXPORTER_OTLP_INSECURE, OTEL_EXPORTER_OTLP_METRICS_INSECURE
insecure: false
# Configure retry policy.
retry:
# Configure retry disabled.
disabled: false
# Configure temporality preference.
#
# Environment variable: OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
Expand Down Expand Up @@ -323,6 +331,10 @@ tracer_provider:
#
# Environment variable: OTEL_EXPORTER_OTLP_INSECURE, OTEL_EXPORTER_OTLP_TRACES_INSECURE
insecure: false
# Configure retry policy.
retry:
# Configure retry disabled.
disabled: false
# Configure a batch span processor.
- batch:
# Configure exporter.
Expand All @@ -339,6 +351,10 @@ tracer_provider:
#
# Environment variable: OTEL_EXPORTER_ZIPKIN_TIMEOUT
timeout: 10000
# Configure retry policy.
retry:
# Configure retry disabled.
disabled: false
# Configure a simple span processor.
- simple:
# Configure exporter.
Expand Down
13 changes: 13 additions & 0 deletions schema/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
},
"insecure": {
"type": "boolean"
},
"retry": {
"$ref": "#/$defs/Retry"
}
},
"required": [
Expand All @@ -74,6 +77,16 @@
"Console": {
"type": "object",
"additionalProperties": false
},
"Retry": {
"type": "object",
"additionalProperties": false,
"properties": {
"disabled": {
"type": "boolean",
"default": false
}
}
}
}
}
9 changes: 6 additions & 3 deletions schema/meter_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@
"type": "integer",
"minimum": 0
},
"insecure": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved insecure up to be consistent with common.json/Otlp

"type": "boolean"
},
"retry": {
"$ref": "common.json#/$defs/Retry"
},
"temporality_preference": {
"type": "string"
},
Expand All @@ -175,9 +181,6 @@
"explicit_bucket_histogram",
"base2_exponential_bucket_histogram"
]
},
"insecure": {
"type": "boolean"
}
},
"required": [
Expand Down
3 changes: 3 additions & 0 deletions schema/tracer_provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@
"timeout": {
"type": "integer",
"minimum": 0
},
"retry": {
"$ref": "common.json#/$defs/Retry"
}
},
"required": [
Expand Down
Loading