-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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] Update metrics export to use datadog-api-client-go instead of Zorkian #16545
Conversation
c5acbf0
to
ac9807f
Compare
Foresight Summary View More Details build-and-test workflow has finished in 20 minutes 48 seconds (39 minutes 27 seconds less than
|
Job | Failed Steps | Tests | |
---|---|---|---|
integration-tests | N/A | N/A | See Details |
*You can configure Foresight comments in your organization settings page.
1efdeb6
to
ea5539a
Compare
0d4c058
to
054548f
Compare
96a2268
to
74d8bb9
Compare
d28f3dd
to
e2773b0
Compare
configuration.UserAgent = UserAgent(buildInfo) | ||
configuration.HTTPClient = NewHTTPClient(settings, insecureSkipVerify) | ||
configuration.Compress = true | ||
if endpoint != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would we get endpoint == ""
? What should happen in that situation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This endpoint
is from config Metrics.TCPAddr.Endpoint, it's an optional parameter so it can be left unspecified (even the official doc doesn't specify it: https://docs.datadoghq.com/opentelemetry/otel_collector_datadog_exporter/?tab=onahost#setting-up-the-otel-collector-with-the-datadog-exporter).
If it's empty, the datadog exporter should use the default metric endpoint from datadog.NewConfiguration()
: https://github.com/DataDog/datadog-api-client-go/blob/206cab2100541c0ed9562e8cca96394b707cbf5c/api/datadog/configuration.go#L102. We don't want to override that value with empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If left unspecified, the endpoint will be set based on the site
opentelemetry-collector-contrib/exporter/datadogexporter/config.go
Lines 491 to 500 in e46477e
// If an endpoint is not explicitly set, override it based on the site. | |
if !configMap.IsSet("metrics::endpoint") { | |
c.Metrics.TCPAddr.Endpoint = fmt.Sprintf("https://api.%s", c.API.Site) | |
} | |
if !configMap.IsSet("traces::endpoint") { | |
c.Traces.TCPAddr.Endpoint = fmt.Sprintf("https://trace.agent.%s", c.API.Site) | |
} | |
if !configMap.IsSet("logs::endpoint") { | |
c.Logs.TCPAddr.Endpoint = fmt.Sprintf("https://http-intake.logs.%s", c.API.Site) | |
} |
endpoint: ""
.
I have a slight preference to make the whole thing fail if the endpoint is empty, but since I don't feel strongly I will approve this and merge after you see this if you think it's better this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I'd prefer to do the validation in a follow-up PR since that's a fairly independent change.
005cfa2
to
3fc108c
Compare
configuration.UserAgent = UserAgent(buildInfo) | ||
configuration.HTTPClient = NewHTTPClient(settings, insecureSkipVerify) | ||
configuration.Compress = true | ||
if endpoint != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If left unspecified, the endpoint will be set based on the site
opentelemetry-collector-contrib/exporter/datadogexporter/config.go
Lines 491 to 500 in e46477e
// If an endpoint is not explicitly set, override it based on the site. | |
if !configMap.IsSet("metrics::endpoint") { | |
c.Metrics.TCPAddr.Endpoint = fmt.Sprintf("https://api.%s", c.API.Site) | |
} | |
if !configMap.IsSet("traces::endpoint") { | |
c.Traces.TCPAddr.Endpoint = fmt.Sprintf("https://trace.agent.%s", c.API.Site) | |
} | |
if !configMap.IsSet("logs::endpoint") { | |
c.Logs.TCPAddr.Endpoint = fmt.Sprintf("https://http-intake.logs.%s", c.API.Site) | |
} |
endpoint: ""
.
I have a slight preference to make the whole thing fail if the endpoint is empty, but since I don't feel strongly I will approve this and merge after you see this if you think it's better this way.
Thanks for the review! |
Description:
Migrate metrics export in
datadogexporter
fromgopkg.in/zorkian/go-datadog-api.v2
github.com/DataDog/datadog-api-client-go/v2/api/datadog
because the Zorkian library is deprecated. This is guarded by feature gate and can be disabled by adding CLI flag --feature-gates=-exporter.datadogexporter.metricexportnativeclientLink to tracking Issue:
Fixes #16776.
Fixes #6944.
Testing:
Tested in the staging environment, verified OTLP metrics are properly displayed on Datadog UI.
Documentation: