question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datadog.Trace.ClrProfiler.Native

See original GitHub issue

Running a full framework console app on windows server, tracer 2.18, agent 7.39.2.1

log is dumping this line and apm isn’t working: https://github.com/DataDog/dd-trace-dotnet/blob/dff77dd9b50f8a3dd6b5d35687aaaa617904d9a4/tracer/src/Datadog.Trace/ContinuousProfiler/ProfilerStatus.cs#L73

any clear indication as to what would cause this? same setup is working in another env with the same configuration and apm is working on this machine for other apps (mix of services, iis sites, console apps). Not sure if the root cause is Failed to get the runtime-id from native: Unable to load DLL 'Datadog.Trace.ClrProfiler.Native'

Relevant logs:

2022-11-02 17:37:26.839 +00:00 [INF] Using ApiWebRequestFactory for discovery transport.  { MachineName: ".", Process: "[61536 REDACTED]", AppDomain: "[1 REDACTED.exe]", TracerVersion: "2.18.0.0" }
2022-11-02 17:37:26.909 +00:00 [INF] Using ApiWebRequestFactory for trace transport.  { MachineName: ".", Process: "[61536 REDACTED]", AppDomain: "[1 REDACTED.exe]", TracerVersion: "2.18.0.0" }
2022-11-02 17:37:26.999 +00:00 [INF] Building automatic tracer  { MachineName: ".", Process: "[61536 REDACTED]", AppDomain: "[1 REDACTED.exe]", TracerVersion: "2.18.0.0" }
2022-11-02 17:37:27.004 +00:00 [INF] Failed to get the runtime-id from native: Unable to load DLL 'Datadog.Trace.ClrProfiler.Native': The specified module could not be found. (Exception from HRESULT: 0x8007007E)  { MachineName: ".", Process: "[61536 REDACTED]", AppDomain: "[1 REDACTED.exe]", TracerVersion: "2.18.0.0" }
2022-11-02 17:37:27.039 +00:00 [INF] Continuous Profiler is enabled.  { MachineName: ".", Process: "[61536 REDACTED]", AppDomain: "[1 REDACTED.exe]", TracerVersion: "2.18.0.0" }
2022-11-02 17:37:27.044 +00:00 [WRN] No profiler related feature(s) will be enabled. Failed to retrieve profiler status native pointer. System.DllNotFoundException: Unable to load DLL 'Datadog.Profiler.Native': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Datadog.Trace.ContinuousProfiler.NativeInterop.NativeMethods.GetProfilerStatusPointer()
   at Datadog.Trace.ContinuousProfiler.NativeInterop.GetProfilerStatusPointer()
   at Datadog.Trace.ContinuousProfiler.ProfilerStatus.EnsureNativeIsIntialized()
 { MachineName: ".", Process: "[61536 REDACTED]", AppDomain: "[1 REDACTED.exe]", TracerVersion: "2.18.0.0" }
2022-11-02 17:37:27.109 +00:00 [INF] Using ApiWebRequestFactory for telemetry transport.  { MachineName: ".", Process: "[61536 REDACTED]", AppDomain: "[1 REDACTED.exe]", TracerVersion: "2.18.0.0" }
2022-11-02 17:37:27.110 +00:00 [INF] Using ApiWebRequestFactory for telemetry transport direct to intake.  { MachineName: ".", Process: "[61536 REDACTED]", AppDomain: "[1 REDACTED.exe]", TracerVersion: "2.18.0.0" }
2022-11-02 17:37:27.374 +00:00 [INF] DATADOG TRACER CONFIGURATION - {"date":"2022-11-02T17:37:27.3620794+00:00","os_name":"Windows","os_version":"Microsoft Windows NT 6.2.9200.0","version":"2.18.0.0","platform":"x64","lang":".NET Framework","lang_version":"4.8","env":"prod","enabled":true,"service":"REDACTED_SERVICE_NAME","agent_url":"http://127.0.0.1:8126/","agent_transport":"Default","debug":false,"health_checks_enabled":false,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"tags":[],"log_injection_enabled":true,"runtime_metrics_enabled":true,"disabled_integrations":[],"routetemplate_resourcenames_enabled":true,"routetemplate_expansion_enabled":false,"querystring_reporting_enabled":true,"obfuscation_querystring_regex_timout":200.0,"partialflush_enabled":false,"partialflush_minspans":500,"runtime_id":"7a8c630f-ff6a-4146-ba5c-69b24ce38936","agent_reachable":true,"agent_error":"","appsec_enabled":false,"appsec_trace_rate_limit":100,"appsec_rules_file_path":"(default)","appsec_libddwaf_version":"(none)","iast_enabled":false,"iast_deduplication_enabled":true,"iast_weak_hash_algorithms":"HMACMD5,MD5,HMACSHA1,SHA1","iast_weak_cipher_algorithms":"DES,TRIPLEDES,RC2","direct_logs_submission_enabled_integrations":[],"direct_logs_submission_enabled":false,"direct_logs_submission_error":"","exporter_settings_warning":["No transport configuration found, using default values"],"dd_trace_methods":"","activity_listener_enabled":false,"profiler_enabled":false,"code_hotspots_enabled":false,"wcf_obfuscation_enabled":true,"data_streams_enabled":false,"span_sampling_rules":null}  { MachineName: ".", Process: "[61536 REDACTED]", AppDomain: "[1 REDACTED.exe]", TracerVersion: "2.18.0.0" }```

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mrtristancommented, Nov 4, 2022

thanks @andrewlock

from what i can tell the cli app is the only one that had the env var issue (set at runtime) so i’d expect the iis app to be working. i did uninstall / reinstall the tracer msi.

Two quick questions come to mind:

  • i noticed some env vars expect true in the docs and others expect 1 - could getting that wrong cause issues?
  • any issue with any of these being set at a machine level? (obviously some are mine and some as you mentioned are set automagically) image

FYI I did open a support ticket 24 hours ago. pretty quiet there so far.

PS - I kept an eye out for you at Dash. Wanted to thank you for the great blog and everything you put out there for the dotnet community.

0reactions
andrewlockcommented, Mar 16, 2023

I identified that the issue was pertaining to some of the env vars being set by the running application instead of them being set by a calling process.

Ah, yes, that would totally make sense. We hook very early into the execution process (before the application starts executing your code) so by then it’s too late to set the variables. Thanks for the update!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tracing .NET Core Applications
Datadog, the leading service for cloud-scale monitoring. ... Trace.ClrProfiler.Native.so export DD_DOTNET_TRACER_HOME=/opt/datadog # Set additional Datadog ...
Read more >
齐国隆冬强/dd-trace-dotnet
Trace.AspNet\Datadog.Trace.AspNet.csproj rem Build C++ projects rem The native profiler depends on the Datadog.Trace.ClrProfiler.Managed.
Read more >
NET Auto-Instrumentation
These Auto-Installers are forked from Datadog's contribution of their tracers to the OpenTelemetry ... Trace.ClrProfiler.Native.so export ...
Read more >
Datadog.Trace 2.35.0
Trace NuGet package. This package contains the Datadog .NET APM tracer for configuring custom instrumentation. If you are only using automatic instrumentation, ...
Read more >
Debugging a native deadlock in a .NET Linux application
I started by using the pstacks command to get an overview of the callstacks: This revealed one thread executing Datadog.Trace.Agent.Api.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found