add otel exporter option to override metric_reporting_period
#50
+25
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In case we have multiple OTEL metric exporters, we might want to tweak the reporting period for each one of them. (For example, if one of those is reporting to our on premises instance with a lower retention period, and another is sent to an external provider with longer retention period, and might be some rate limit).
With this PR, we add a
custom_metric_reporting_period
to the OTEL exporters config (docs about it here: https://www.krakend.io/docs/telemetry/opentelemetry/#exporters-otlp )custom_metric_reporting_period
: unsigned integer specifying the seconds to wait between sending report,0
will not override themetric_reporting_period
set for all metric exporters (https://www.krakend.io/docs/telemetry/opentelemetry/#metric_reporting_period)In order to easily check the reporting periods, I've created two otel exporters with addresses pointing to non-existing services, so we can see an error in the log, each time it tries to report the metrics:
localhost:5005
that should be reporting each 5 seconds (global configuration)localhost:5011
that should be reporting each 11 seconds (overriden configuration)