open-telemetry / opentelemetry-collector-contrib

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

New component: processor/datadog #15689

Closed gbbr closed 1 year ago

gbbr commented 2 years ago

The purpose and use-cases of the new component

Collects pre-sampling trace metrics. Users who wish to use the probabilistic sampler or the tailsamplingprocessor can prepend the "datadog" processor in their pipelines to see the full picture. Please see the example configuration below.

Example configuration for the component

Please note the new datadog processor addition.

receivers:
  otlp:
    protocols:
      http:

processors:
  batch:
  probabilistic_sampler:
    sampling_percentage: 10
  datadog:

exporters:
  datadog:
    api:
      key: ${DD_API_KEY}

service:
  pipelines:
    metrics:
      receivers: [otlp]
      processors: [batch, k8sattributes]
      exporters: [datadog]
    traces:
      receivers: [otlp]
      processors: [batch, k8sattributes, datadog, probabilistic_sampler]
      exporters: [datadog]

An exporter_name setting would also be available if one wishes to use a non-Datadog exporter. Otherwise, the datadog processor would automatically detect the presence of the Datadog exporter and use that.

Telemetry data types supported

Traces.

Is this a vendor-specific component?

Sponsor (optional)

@mx-psi

Additional context

Why don't you use the spanmetricsprocessor?

While this seems to be the most natural solution, there are some disadvantages and limitations that are blocking it:

Why don't you use two separate pipelines?

One could use two separate pipelines with two separate exporters:

This change involves adding a second exporter, which is fine (considering it is accepted by the community), but raises several difficulties:

evan-bradley commented 2 years ago

@mx-psi Can you confirm that you will be sponsoring this component?

mx-psi commented 2 years ago

Yes, I will be sponsoring this, but we want to make sure that this is the right choice since we would be the first vendor to have a vendor-specific processor.

gbbr commented 1 year ago

Since there are no objections here, I'm going to start working on this.

jpkrohling commented 1 year ago

Since there are no objections here, I'm going to start working on this.

Was this discussed during a SIG meeting?

mx-psi commented 1 year ago

Since there are no objections here, I'm going to start working on this.

Was this discussed during a SIG meeting?

No, it was not. This component is vendor specific and I sponsored it, but if you have thoughts on the design or approach please comment then now better than later!

Note that it's possible that once connectors are a thing we may want to change this and the spanmetricsprocessor into connectors instead, but this seemed like the best approach at the time when we were discussing this.