-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
bugSomething isn't workingSomething isn't workingdata:logsLogs related issuesLogs related issuesexporter/datadogDatadog componentsDatadog componentsneeds triageNew item requiring triageNew item requiring triage
Description
Component(s)
exporter/datadog
What happened?
Description
When the feature gate enabled for the Datadog logs agent exporter, an invalid Datadog API key will cause the collector to exit.
Requires this feature gate to be enabled:
#32327
This is the summary of what I believe is happening:
- The collector defaults the logging endpoint address to
https://http-intake.logs.datadoghq.com/
- The Datadog Agent code used by the collector is performing a check to see if HTTP connectivity works before deciding on HTTP or TCP
- If HTTP works, TCP is not attempted
- If HTTP fails (including if the api key is invalid), the Datadog Agent code attempts TCP
This is where the error occurs. When the API key is invalid, the HTTP connection validation fails and TCP is attempted. Parsing the default endpoint ofhttps://http-intake.logs.datadoghq.com/
is attempted, but the code expects a<host>:<port>
format and errors due to port not being a number.
Steps to Reproduce
Run collector with feature gate enabled:
RUN_ARGS=--feature-gates=exporter.datadogexporter.UseLogsAgentExporter make run
Expected Result
The collector continues to run, even if log forwarding is not possible
Actual Result
The collector crashes with the included log error
Collector version
v0.100.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
receivers:
filelog:
start_at: beginning
include:
- ../../local/app.log
exporters:
datadog:
api:
key: xyz
service:
pipelines:
logs:
receivers: [filelog]
exporters: [datadog]
Log output
Error: failed to build pipelines: failed to create "datadog" exporter for data type "logs": failed to create logs agent: Invalid endpoints: could not parse https://http-intake.logs.datadoghq.com: strconv.Atoi: parsing "//http-intake.logs.datadoghq.com": invalid syntax
2024/05/22 14:33:20 collector server run finished with error: failed to build pipelines: failed to create "datadog" exporter for data type "logs": failed to create logs agent: Invalid endpoints: could not parse https://http-intake.logs.datadoghq.com: strconv.Atoi: parsing "//http-intake.logs.datadoghq.com": invalid syntax
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdata:logsLogs related issuesLogs related issuesexporter/datadogDatadog componentsDatadog componentsneeds triageNew item requiring triageNew item requiring triage