open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.1k stars 2.39k forks source link

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

Open NassimBtk opened 2 days ago

NassimBtk commented 2 days ago

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

github-actions[bot] commented 2 days ago

Pinging code owners: