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

[exporter/datadog] Add Configurable Reporter Period for Host Metadata #36450

Closed
NassimBtk opened this issue Nov 19, 2024 · 1 comment · Fixed by #36451
Closed

[exporter/datadog] Add Configurable Reporter Period for Host Metadata #36450

NassimBtk opened this issue Nov 19, 2024 · 1 comment · Fixed by #36451
Labels
enhancement New feature or request exporter/datadog Datadog components

Comments

@NassimBtk
Copy link
Contributor

Component(s)

exporter/datadog

Is your feature request related to a problem? Please describe.

The current Datadog exporter implementation uses a hardcoded reporting period of 30 minutes for the host metadata reporter. While this interval might work for some environments, it is too long for scenarios where infrastructure changes need to be reflected promptly. Users have no control over this period, which can lead to delayed updates in Datadog’s infrastructure list and host map.

Describe the solution you'd like

I propose adding a configurable reporter_period parameter to the Datadog exporter’s host metadata configuration. This parameter would allow users to specify the frequency at which host metadata is sent to Datadog. By default, this value could remain at 30 minutes to ensure backward compatibility, but users would have the option to set it to shorter or longer intervals based on their needs.

For example, the configuration could look like this:

exporters:

  datadog/api:
    api:
      key: <api-key>
    host_metadata:
      enabled: true
      reporter_period: 10m

This change would involve updating the host metadata configuration structure, validating the parameter to ensure positive duration values, and passing it through to the metadata pusher and reporter logic (inframetadata).

Describe alternatives you've considered

No response

Additional context

No response

@NassimBtk NassimBtk added enhancement New feature or request needs triage New item requiring triage labels Nov 19, 2024
@github-actions github-actions bot added the exporter/datadog Datadog components label Nov 19, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

NassimBtk added a commit to sentrysoftware/opentelemetry-collector-contrib that referenced this issue Nov 19, 2024
- Introduced a `reporter_period` field in `HostMetadataConfig` to allow
customization of the metadata reporting interval.
- Default value set to 30 minutes for backward compatibility.
- Updated `pkg/datadog/config/host.go` to support the new
`reporter_period` field.
- Validated `reporter_period` in `pkg/datadog/config/config.go` to
ensure positive durations.
- Passed `reporter_period` to the metadata pusher in
`exporter/datadogexporter/internal/hostmetadata/config.go`.
- Modified `exporter/datadogexporter/hostmetadata.go` and `factory.go`
to integrate `reporter_period` into the reporter logic.
- Removed hardcoded constant for metadata reporting interval in favor of
the configurable value.

Fixes open-telemetry#36450
@songy23 songy23 removed the needs triage New item requiring triage label Nov 20, 2024
@mx-psi mx-psi closed this as completed in 5002476 Dec 3, 2024
shivanthzen pushed a commit to shivanthzen/opentelemetry-collector-contrib that referenced this issue Dec 5, 2024
…open-telemetry#36451)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### 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`](diffhunk://#diff-e3e3c57c49d2a921abc8470bccafabf4d632b0dc142eb3e95b3b6fac57107a11R1-R27):
Added a changelog entry for the new `reporter_period` parameter.
*
[`exporter/datadogexporter/examples/collector.yaml`](diffhunk://#diff-766be9823b8ec8b8de17e2c6c785d9f93e13b5a7e84ff441040077ab5e726a79R452-R456):
Added documentation for the new `reporter_period` parameter in the
example configuration file.
*
[`exporter/datadogexporter/factory.go`](diffhunk://#diff-c9e9f39ffda08a2af74c0d54d37f21e14cdb95c4136cdbe238de6be2bfe31389L127-R125):
Updated the factory to use the `reporter_period` from the configuration
instead of a hardcoded value.

Configuration updates:

*
[`exporter/datadogexporter/internal/hostmetadata/config.go`](diffhunk://#diff-0c9f0862d61390add366aca3e30834a1e01f16a3865ef9aca61831cad3459f53R31-R32):
Added `ReporterPeriod` to the `PusherConfig` struct.
*
[`pkg/datadog/config/config.go`](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139):
Added validation for the `reporter_period` to ensure it is a positive
duration and set a default value.
[[1]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139)
[[2]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R347)

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]](diffhunk://#diff-c50b6d1f06d62a58b6422f3218526437c16554faa2b7fc8eee1d32c021f00ca4R311)
[[2]](diffhunk://#diff-94f5b0119d06dbcfee20cd9b99a104ef208e027c166c463321670a5197e83714R233-R235)
[[3]](diffhunk://#diff-005adb1774d2a402bdd7adf3b6aa150117bf6b3c0bb634bf2c68c6b33f0ce1b5L61-R63)
[[4]](diffhunk://#diff-c19daad040b7310787c0012e5c660dc18a07ba16036d0eaa31a0e18c551d0ef3R148-R150)
*
[`pkg/datadog/config/config_test.go`](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105):
Added test cases to validate the `reporter_period` configuration.
[[1]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105)
[[2]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R186-R197)
<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#36450

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->
ZenoCC-Peng pushed a commit to ZenoCC-Peng/opentelemetry-collector-contrib that referenced this issue Dec 6, 2024
…open-telemetry#36451)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### 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`](diffhunk://#diff-e3e3c57c49d2a921abc8470bccafabf4d632b0dc142eb3e95b3b6fac57107a11R1-R27):
Added a changelog entry for the new `reporter_period` parameter.
*
[`exporter/datadogexporter/examples/collector.yaml`](diffhunk://#diff-766be9823b8ec8b8de17e2c6c785d9f93e13b5a7e84ff441040077ab5e726a79R452-R456):
Added documentation for the new `reporter_period` parameter in the
example configuration file.
*
[`exporter/datadogexporter/factory.go`](diffhunk://#diff-c9e9f39ffda08a2af74c0d54d37f21e14cdb95c4136cdbe238de6be2bfe31389L127-R125):
Updated the factory to use the `reporter_period` from the configuration
instead of a hardcoded value.

Configuration updates:

*
[`exporter/datadogexporter/internal/hostmetadata/config.go`](diffhunk://#diff-0c9f0862d61390add366aca3e30834a1e01f16a3865ef9aca61831cad3459f53R31-R32):
Added `ReporterPeriod` to the `PusherConfig` struct.
*
[`pkg/datadog/config/config.go`](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139):
Added validation for the `reporter_period` to ensure it is a positive
duration and set a default value.
[[1]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139)
[[2]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R347)

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]](diffhunk://#diff-c50b6d1f06d62a58b6422f3218526437c16554faa2b7fc8eee1d32c021f00ca4R311)
[[2]](diffhunk://#diff-94f5b0119d06dbcfee20cd9b99a104ef208e027c166c463321670a5197e83714R233-R235)
[[3]](diffhunk://#diff-005adb1774d2a402bdd7adf3b6aa150117bf6b3c0bb634bf2c68c6b33f0ce1b5L61-R63)
[[4]](diffhunk://#diff-c19daad040b7310787c0012e5c660dc18a07ba16036d0eaa31a0e18c551d0ef3R148-R150)
*
[`pkg/datadog/config/config_test.go`](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105):
Added test cases to validate the `reporter_period` configuration.
[[1]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105)
[[2]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R186-R197)
<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#36450

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->
sbylica-splunk pushed a commit to sbylica-splunk/opentelemetry-collector-contrib that referenced this issue Dec 17, 2024
…open-telemetry#36451)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### 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`](diffhunk://#diff-e3e3c57c49d2a921abc8470bccafabf4d632b0dc142eb3e95b3b6fac57107a11R1-R27):
Added a changelog entry for the new `reporter_period` parameter.
*
[`exporter/datadogexporter/examples/collector.yaml`](diffhunk://#diff-766be9823b8ec8b8de17e2c6c785d9f93e13b5a7e84ff441040077ab5e726a79R452-R456):
Added documentation for the new `reporter_period` parameter in the
example configuration file.
*
[`exporter/datadogexporter/factory.go`](diffhunk://#diff-c9e9f39ffda08a2af74c0d54d37f21e14cdb95c4136cdbe238de6be2bfe31389L127-R125):
Updated the factory to use the `reporter_period` from the configuration
instead of a hardcoded value.

Configuration updates:

*
[`exporter/datadogexporter/internal/hostmetadata/config.go`](diffhunk://#diff-0c9f0862d61390add366aca3e30834a1e01f16a3865ef9aca61831cad3459f53R31-R32):
Added `ReporterPeriod` to the `PusherConfig` struct.
*
[`pkg/datadog/config/config.go`](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139):
Added validation for the `reporter_period` to ensure it is a positive
duration and set a default value.
[[1]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139)
[[2]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R347)

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]](diffhunk://#diff-c50b6d1f06d62a58b6422f3218526437c16554faa2b7fc8eee1d32c021f00ca4R311)
[[2]](diffhunk://#diff-94f5b0119d06dbcfee20cd9b99a104ef208e027c166c463321670a5197e83714R233-R235)
[[3]](diffhunk://#diff-005adb1774d2a402bdd7adf3b6aa150117bf6b3c0bb634bf2c68c6b33f0ce1b5L61-R63)
[[4]](diffhunk://#diff-c19daad040b7310787c0012e5c660dc18a07ba16036d0eaa31a0e18c551d0ef3R148-R150)
*
[`pkg/datadog/config/config_test.go`](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105):
Added test cases to validate the `reporter_period` configuration.
[[1]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105)
[[2]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R186-R197)
<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#36450

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->
AkhigbeEromo pushed a commit to sematext/opentelemetry-collector-contrib that referenced this issue Jan 13, 2025
…open-telemetry#36451)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### 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`](diffhunk://#diff-e3e3c57c49d2a921abc8470bccafabf4d632b0dc142eb3e95b3b6fac57107a11R1-R27):
Added a changelog entry for the new `reporter_period` parameter.
*
[`exporter/datadogexporter/examples/collector.yaml`](diffhunk://#diff-766be9823b8ec8b8de17e2c6c785d9f93e13b5a7e84ff441040077ab5e726a79R452-R456):
Added documentation for the new `reporter_period` parameter in the
example configuration file.
*
[`exporter/datadogexporter/factory.go`](diffhunk://#diff-c9e9f39ffda08a2af74c0d54d37f21e14cdb95c4136cdbe238de6be2bfe31389L127-R125):
Updated the factory to use the `reporter_period` from the configuration
instead of a hardcoded value.

Configuration updates:

*
[`exporter/datadogexporter/internal/hostmetadata/config.go`](diffhunk://#diff-0c9f0862d61390add366aca3e30834a1e01f16a3865ef9aca61831cad3459f53R31-R32):
Added `ReporterPeriod` to the `PusherConfig` struct.
*
[`pkg/datadog/config/config.go`](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139):
Added validation for the `reporter_period` to ensure it is a positive
duration and set a default value.
[[1]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139)
[[2]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R347)

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]](diffhunk://#diff-c50b6d1f06d62a58b6422f3218526437c16554faa2b7fc8eee1d32c021f00ca4R311)
[[2]](diffhunk://#diff-94f5b0119d06dbcfee20cd9b99a104ef208e027c166c463321670a5197e83714R233-R235)
[[3]](diffhunk://#diff-005adb1774d2a402bdd7adf3b6aa150117bf6b3c0bb634bf2c68c6b33f0ce1b5L61-R63)
[[4]](diffhunk://#diff-c19daad040b7310787c0012e5c660dc18a07ba16036d0eaa31a0e18c551d0ef3R148-R150)
*
[`pkg/datadog/config/config_test.go`](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105):
Added test cases to validate the `reporter_period` configuration.
[[1]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105)
[[2]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R186-R197)
<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#36450

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->
chengchuanpeng pushed a commit to chengchuanpeng/opentelemetry-collector-contrib that referenced this issue Jan 26, 2025
…open-telemetry#36451)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### 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`](diffhunk://#diff-e3e3c57c49d2a921abc8470bccafabf4d632b0dc142eb3e95b3b6fac57107a11R1-R27):
Added a changelog entry for the new `reporter_period` parameter.
*
[`exporter/datadogexporter/examples/collector.yaml`](diffhunk://#diff-766be9823b8ec8b8de17e2c6c785d9f93e13b5a7e84ff441040077ab5e726a79R452-R456):
Added documentation for the new `reporter_period` parameter in the
example configuration file.
*
[`exporter/datadogexporter/factory.go`](diffhunk://#diff-c9e9f39ffda08a2af74c0d54d37f21e14cdb95c4136cdbe238de6be2bfe31389L127-R125):
Updated the factory to use the `reporter_period` from the configuration
instead of a hardcoded value.

Configuration updates:

*
[`exporter/datadogexporter/internal/hostmetadata/config.go`](diffhunk://#diff-0c9f0862d61390add366aca3e30834a1e01f16a3865ef9aca61831cad3459f53R31-R32):
Added `ReporterPeriod` to the `PusherConfig` struct.
*
[`pkg/datadog/config/config.go`](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139):
Added validation for the `reporter_period` to ensure it is a positive
duration and set a default value.
[[1]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139)
[[2]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R347)

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]](diffhunk://#diff-c50b6d1f06d62a58b6422f3218526437c16554faa2b7fc8eee1d32c021f00ca4R311)
[[2]](diffhunk://#diff-94f5b0119d06dbcfee20cd9b99a104ef208e027c166c463321670a5197e83714R233-R235)
[[3]](diffhunk://#diff-005adb1774d2a402bdd7adf3b6aa150117bf6b3c0bb634bf2c68c6b33f0ce1b5L61-R63)
[[4]](diffhunk://#diff-c19daad040b7310787c0012e5c660dc18a07ba16036d0eaa31a0e18c551d0ef3R148-R150)
*
[`pkg/datadog/config/config_test.go`](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105):
Added test cases to validate the `reporter_period` configuration.
[[1]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105)
[[2]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R186-R197)
<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#36450

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->
chengchuanpeng pushed a commit to chengchuanpeng/opentelemetry-collector-contrib that referenced this issue Jan 28, 2025
…open-telemetry#36451)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### 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`](diffhunk://#diff-e3e3c57c49d2a921abc8470bccafabf4d632b0dc142eb3e95b3b6fac57107a11R1-R27):
Added a changelog entry for the new `reporter_period` parameter.
*
[`exporter/datadogexporter/examples/collector.yaml`](diffhunk://#diff-766be9823b8ec8b8de17e2c6c785d9f93e13b5a7e84ff441040077ab5e726a79R452-R456):
Added documentation for the new `reporter_period` parameter in the
example configuration file.
*
[`exporter/datadogexporter/factory.go`](diffhunk://#diff-c9e9f39ffda08a2af74c0d54d37f21e14cdb95c4136cdbe238de6be2bfe31389L127-R125):
Updated the factory to use the `reporter_period` from the configuration
instead of a hardcoded value.

Configuration updates:

*
[`exporter/datadogexporter/internal/hostmetadata/config.go`](diffhunk://#diff-0c9f0862d61390add366aca3e30834a1e01f16a3865ef9aca61831cad3459f53R31-R32):
Added `ReporterPeriod` to the `PusherConfig` struct.
*
[`pkg/datadog/config/config.go`](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139):
Added validation for the `reporter_period` to ensure it is a positive
duration and set a default value.
[[1]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R136-R139)
[[2]](diffhunk://#diff-747858d4c8fea28a92227df09f17ebee01df63dad04812ac5d30a392c9970b73R347)

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]](diffhunk://#diff-c50b6d1f06d62a58b6422f3218526437c16554faa2b7fc8eee1d32c021f00ca4R311)
[[2]](diffhunk://#diff-94f5b0119d06dbcfee20cd9b99a104ef208e027c166c463321670a5197e83714R233-R235)
[[3]](diffhunk://#diff-005adb1774d2a402bdd7adf3b6aa150117bf6b3c0bb634bf2c68c6b33f0ce1b5L61-R63)
[[4]](diffhunk://#diff-c19daad040b7310787c0012e5c660dc18a07ba16036d0eaa31a0e18c551d0ef3R148-R150)
*
[`pkg/datadog/config/config_test.go`](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105):
Added test cases to validate the `reporter_period` configuration.
[[1]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R97-R105)
[[2]](diffhunk://#diff-d3a3c19e78bbac07597c6210b4d051f4678df2752e06c82d0f040c52207c5970R186-R197)
<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#36450

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporter/datadog Datadog components
Projects
None yet
2 participants