open-telemetry / opentelemetry-collector-contrib

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

[exporter/datadog] Error returned from authAPI.Validate is not propagated #33935

Closed RonFed closed 2 months ago

RonFed commented 3 months ago

Component(s)

exporter/datadog

What happened?

Description

The error returned from Validate is not returned. I'm not sure if this is intentional or not. From debugging this and entering an invalid API key I see an error of 403 forbidden is returned but only logged. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/6ff2a8a5ec508d8b0833836089721a4a1a0b8651/exporter/datadogexporter/internal/clientutil/api.go#L39-L53

Collector version

v0.104.0

Environment information

No response

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

github-actions[bot] commented 3 months ago

Pinging code owners:

mx-psi commented 3 months ago

@RonFed This is intentional and mimics the behavior of the Datadog Agent. To propagate the error you can set api::fail_on_invalid_key to true. Let me know if that is what you were looking for.

RonFed commented 3 months ago

@mx-psi I have tried this config but it still causes the error to not get propagated, since the function above is not returning it, it doesn't get sent in the error channel and the check for the configuration you proposed is not catching it in https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/0385b21f231acaa0daa8c62a095510ebc4479960/exporter/datadogexporter/traces_exporter.go#L70-L90

mx-psi commented 2 months ago

I am taking a look at this. I filed #33944 but I am a bit confused as to why the endpoint would be returning 403 for something that should not need authentication, so I am checking internally as well :)

mx-psi commented 2 months ago

This will be fixed in v0.105.0, thanks for taking the time to report it!