Automatic instrumentation fails after setup
See original GitHub issueDescribe the bug
After setting up .NET tracing using DataDog documentation web application starts logging errors non-stop. Error example:
[2018-09-18 14:25:41] [Error] An error occured while sending traces to the agent at http://localhost:8126/v0.3/traces System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at Datadog.Trace.Agent.Api.<SendAsync>d__8
1.MoveNext()`
And at the same time there is an error on trace-agent side:
2018-09-19 08:11:26 ERROR (receiver.go:386) - cannot decode v0.3 traces payload: msgp: attempted to decode type "nil" with method for "str"
Attempts to turn off automatic instrumentation do not work (there is no clear documentation on how to turn it off):
- Set
apm_config:enabled: false
- Turn off trace agent
- Do
iis_reset
- Redeploy the application
To Reproduce Steps to reproduce the behavior:
- Follow the documentation available at official website.
- Find yourself in a quite of a pickle.
Expected behavior Application does not throw exceptions after being set up.
Runtime environment (please complete the following information):
- Instrumentation mode: automatic
- Tracer version: 0.3.0
- OS: Windows Server 2012 R2
- CLR: .NET Framework 4.5.1
Additional context Our application includes MsgPack library. Maybe it conflicts with the one used in the injected CLR code Data Dog is using.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
It looks like the agent is more restrictive in the format its allowed to receive than what the tracer is producing. I think we can add code to where the tracer sends spans to remove nil strings or set them to the empty string.
To disable automatic instrumentation you have to remove an environment variable. (
SET COR_ENABLE_PROFILING=0
) We should document this, but we should also provide a way to configure this through the apm section of the datadog agent config yaml. We should also limit the amount we log on errors, since the trace agent being down is entirely possible under normal usage.@vasiliy0 besides the noise in the logs, did this break the application? Or did IIS continue to work properly?
@vasiliy0: We released 0.3.1-beta which should fix these errors. Thanks again.