OpenTelemetry endpoint in agent crashes the tracer-agent
Output of the info page (if this is a bug)
===============
Agent (v7.33.0)
===============
Status date: 2022-02-17 18:52:44.093 UTC (1645123964093)
Agent start: 2022-02-17 12:00:33.62 UTC (1645099233620)
Pid: 1
Go Version: go1.16.7
Python Version: 3.8.11
Build arch: amd64
Agent flavor: agent
Check Runners: 4
Log Level: INFO
Describe what happened: I am trying out the OpenTelemetry support. The agent is receiving traces and forwarding to the trace-agent. The trace-agent then crashes with the following error:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x2ccf36c]
goroutine 198 [running]:
github.com/DataDog/datadog-agent/pkg/trace/agent.normalize(0xc000517e00, 0xc00136c800, 0x3, 0x4020100)
/omnibus/src/datadog-agent/src/github.com/DataDog/datadog-agent/pkg/trace/agent/normalizer.go:60 +0xe4c
github.com/DataDog/datadog-agent/pkg/trace/agent.normalizeTrace(0xc000517e00, 0xc00036b628, 0x1, 0x1, 0x0, 0x0)
/omnibus/src/datadog-agent/src/github.com/DataDog/datadog-agent/pkg/trace/agent/normalizer.go:184 +0x186
github.com/DataDog/datadog-agent/pkg/trace/agent.(*Agent).Process(0xc0001517a0, 0xc0003b70a0)
/omnibus/src/datadog-agent/src/github.com/DataDog/datadog-agent/pkg/trace/agent/agent.go:203 +0x2c5
github.com/DataDog/datadog-agent/pkg/trace/agent.(*Agent).work(0xc0001517a0)
/omnibus/src/datadog-agent/src/github.com/DataDog/datadog-agent/pkg/trace/agent/agent.go:146 +0x32
created by github.com/DataDog/datadog-agent/pkg/trace/agent.(*Agent).Run
/omnibus/src/datadog-agent/src/github.com/DataDog/datadog-agent/pkg/trace/agent/agent.go:115 +0x1d3
Describe what you expected: The trace-agent should forward the traces to Datadog
Steps to reproduce the issue:
- Create a dotnet app with OpenTelemetry SDK.
services.AddOpenTelemetryTracing(configure =>
{
configure.Configure((sp, builder) =>
{
var resourceTags = new Dictionary<string, object>
{
["deployment.environment"] = hostEnvironment.EnvironmentName
};
builder
.AddSource("MyService")
.AddHttpClientInstrumentation()
.AddAspNetCoreInstrumentation()
.SetResourceBuilder(
ResourceBuilder.CreateDefault()
.AddService(serviceName: "MyService", serviceVersion: "1.0.0")
.AddAttributes(resourceTags))
.AddOtlpExporter(opts =>
{
if (Environment.GetEnvironmentVariable("OTEL_EXPORTER_OTLP_ENDPOINT") == null)
{
var ddAgentHost = Environment.GetEnvironmentVariable("DD_AGENT_HOST");
if (ddAgentHost != null)
{
opts.Endpoint = new Uri($"http://{ddAgentHost}:4317");
}
}
});
});
});
- Deploy to K8s with DD_AGENT_HOST set to the host ip.
- Trigger some traces.
- See trace-agent container crash.
Additional environment details (Operating System, Cloud provider, etc): Running using the Agent Helm Chart verison 2.30.7 OpenTelemetry SDK is for dotnet version 1.2.0-rc2.
@lscpike thank you for reporting this. I am a Product Manager at Datadog, one of our team members will look into it and get back to you shortly.
Hi there! Thanks for reporting this. I was not able to reproduce it based on the above information, but I do have further follow up ideas to try out. However, to do this, I'll have to ask for more information which may be inappropriate to post here. Would you mind opening a support ticket with our team and mentioning me? I'll be happy to jump on it ASAP.
This issue has been automatically marked as stale because it has not had activity in the past 15 days.
It will be closed in 30 days if no further activity occurs. If this issue is still relevant, adding a comment will keep it open. Also, you can always reopen the issue if you missed the window.
Thank you for your contributions!
Automatically closed due to inactivity.