[SDK] Implement env var configuration for PeriodicExportingMetricReader#3549
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
b0aea62 to
4c3e120
Compare
|
I changed the title to [SDK], because I use the [CONFIGURATION] tag is for everything related to declarative configuration (aka, config.yaml) |
sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h
Outdated
Show resolved
Hide resolved
sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h
Outdated
Show resolved
Hide resolved
marcalff
left a comment
There was a problem hiding this comment.
Thanks for the fix, see minor comments.
Looks like you found an existing bug. Please use The issue with 0 / infinite can be fixed separately. |
71bfae5 to
a1311d1
Compare
sdk/include/opentelemetry/sdk/metrics/export/periodic_exporting_metric_reader_options.h
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3549 +/- ##
==========================================
+ Coverage 89.99% 90.00% +0.02%
==========================================
Files 219 220 +1
Lines 7048 7056 +8
==========================================
+ Hits 6342 6350 +8
Misses 706 706
🚀 New features to boost your workflow:
|
|
The include-what-you-use failures can be seen in CI, go to "Summary" for the CI job, and download artifacts that contains the full logs. Search for Logs provided below Also, there is a build break for tests on Windows. See existing tests for how to use setenv. |
c919c83 to
755345a
Compare
|
Thanks for your feedback, forgot to include env_variables.h for Windows build. |
755345a to
34b1f06
Compare
|
Build failure in windows CI: To fix it:
Since a new patch is needed to fix this, I am adding minor nitpicks as well. Code looks good overall, will approve once CI is clean. |
marcalff
left a comment
There was a problem hiding this comment.
LGTM overall.
Thanks for the fix, will approve once CI is clean.
34b1f06 to
0076eef
Compare
0076eef to
2b44323
Compare
marcalff
left a comment
There was a problem hiding this comment.
LGTM.
Thanks for the fix, and the misc cleanup.
|
@mathieurobin1 Congratulations on your first patch. Merged. |
Fixes #3515
Changes
Implements the configuration of
PeriodicExportingMetricReadervia environment variables with default values.It introduces support for:
OTEL_METRIC_EXPORT_INTERVAL(Duration)OTEL_METRIC_EXPORT_TIMEOUT(Timeout)Known Limitation / Discussion Point:
During implementation, I identified that the existing utility function
common::GetDurationEnvironmentVariableis not fully compliant with the specification forTimeouttypes.Timeoutvalue of0SHOULD be interpreted as "infinite".GetTimeoutFromString) explicitly rejects a value of0as invalid.To keep the scope of this PR focused on the
PeriodicExportingMetricReaderOptions, I have used the existing utility for both environment variables. This means thatOTEL_METRIC_EXPORT_TIMEOUT=0is currently not handled as an infinite timeout but will instead fall back to the default value.I believe fixing the common utility function should be addressed in a separate issue/PR to ensure it doesn't introduce unintended side effects elsewhere.
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes