This pull request introduces a new configurable parameter reporter_period for the Datadog exporter’s host metadata configuration. This enhancement allows users to specify the frequency at which host metadata is sent to Datadog. The changes span multiple files and include updates to configuration, factory methods, and test cases.
pkg/datadog/config/config.go: Added validation for the reporter_period to ensure it is a positive duration and set a default value. [1][2]
Test case updates:
exporter/datadogexporter/factory_test.go, exporter/datadogexporter/logs_exporter_test.go, exporter/datadogexporter/metrics_exporter_test.go, exporter/datadogexporter/traces_exporter_test.go: Updated test cases to include the new reporter_period parameter. [1][2][3][4]
Description
This pull request introduces a new configurable parameter
reporter_period
for the Datadog exporter’s host metadata configuration. This enhancement allows users to specify the frequency at which host metadata is sent to Datadog. The changes span multiple files and include updates to configuration, factory methods, and test cases.Enhancements to Datadog exporter:
.chloggen/add-configurable-reporter-period-for-host-metadata.yaml
: Added a changelog entry for the newreporter_period
parameter.exporter/datadogexporter/examples/collector.yaml
: Added documentation for the newreporter_period
parameter in the example configuration file.exporter/datadogexporter/factory.go
: Updated the factory to use thereporter_period
from the configuration instead of a hardcoded value.Configuration updates:
exporter/datadogexporter/internal/hostmetadata/config.go
: AddedReporterPeriod
to thePusherConfig
struct.pkg/datadog/config/config.go
: Added validation for thereporter_period
to ensure it is a positive duration and set a default value. [1] [2]Test case updates:
exporter/datadogexporter/factory_test.go
,exporter/datadogexporter/logs_exporter_test.go
,exporter/datadogexporter/metrics_exporter_test.go
,exporter/datadogexporter/traces_exporter_test.go
: Updated test cases to include the newreporter_period
parameter. [1] [2] [3] [4]pkg/datadog/config/config_test.go
: Added test cases to validate thereporter_period
configuration. [1] [2]Link to tracking issue
Fixes #36450
Testing
Documentation