Closed DeanLangford closed 1 year ago
Additional debug info. I added autodynatrace
back into the application and set AUTODYNATRACE_LOG_LEVEL=True
. This provided additional information:
...
2023-02-01 20:58:43,978: 1 DEBUG autodynatrace - init: Initialized autodynatrace with AgentState: 0
2023-02-01 20:58:43,982: 1 DEBUG autodynatrace - instrument_lib: Attempting to instrument urllib
2023-02-01 20:58:44,002: 1 DEBUG autodynatrace - instrument_lib: Attempting to instrument subprocess
2023-02-01 20:58:44,004: 1 INFO autodynatrace - instrument: Instrumented 2/23 libraries (subprocess, urllib). Will instrument when imported: (aiohttp, bottle, celery, conflu
2023-02-01 20:58:44,016: 1 DEBUG autodynatrace - dynatrace_trace: Tracing subprocess.check_output
2023-02-01 20:58:44,016: 1 DEBUG autodynatrace - dynatrace_trace: Tracing subprocess.run
2023-02-01 20:58:44,016: 1 DEBUG autodynatrace - dynatrace_trace: Tracing subprocess.Popen
2023-02-01 20:58:44,726: 1 DEBUG autodynatrace - on_import: Instrumenting imported lib 'sqlalchemy'
2023-02-01 20:58:45,618: 1 DEBUG autodynatrace - on_import: Instrumenting imported lib 'paramiko'
[D 230201 20:58:46 __init__:252] initialize: ref count = 1
[D 230201 20:58:46 __init__:265] Attempt to re-initialize agent with options=['loglevelsdk=finest', 'loglevel=finest'], libname=None only increases reference count.
2023-02-01 20:58:46,294: 1 DEBUG autodynatrace - wrapper: Custom tracing - axis-linker-dev: __main__.main
2023-02-01 20:58:46,295: 1 DEBUG autodynatrace - dynatrace_trace: Tracing subprocess.Popen
2023-02-01 20:58:46,575: 1 DEBUG autodynatrace - dynatrace_putrequest: Tracing urllib, url: '<REDACTED>', tag: 'b'FW4;219149364;1;1861374877;1;0;45
Agent init: InitResult(status=InitResult.STATUS_ALREADY_INITIALIZED, error=None)
Agent state: 0
Agent found: True
Agent is compatible: True
Agent version: 1.257.240.20230127-171125/1.7.1
...
💡 Also, I did find a Service called __main__
in Dynatrace. I had overlooked that earlier because I was filtering on a specific Management Zone.
❓Does that mean I have to add the @autodynatrace.trace
annotation to every method I was to trace? Is there a way to do that at a higher lever: class, module, or even package?
The SDK here does not do any tracing automatically, you have to manually use tracers, or develop the automation yourself (e.g. using Pythons monkey patching capabilities). However, since most tracers here create full services, not only code-level nodes, it may be a bit too heavyweight to trace everything. It is usually better to only trace operations of particular interest. The SDK has no support for code-level-only nodes.
For the autodynatrace question I defer to @dlopes7.
Thanks @Oberon00. I started using openTelemetry-instrumentation
and some of its plugins directly (because I happen to not be using any of the auto instrumented technologies that this package handles) since the time I created this "issue" and have manually traced a few, key entry points.
I'm closing this issue since it appears to be expected behavior and not a "bug" as I first thought. Thanks, again!
I'm trying to get code-level tracing working using either setup option:
AUTOWRAPT_BOOTSTRAP=autodynatrace
import autodynatrace
+@autodynatrace.trace
annotation onmain()
Working through Dynatrace support via in-product chat, I was asked to post the issue here instead. Support Ticket #128811.
After dropping down to the
oneagent
package instead of theautodynatrace
package, and adding some additional debug statements, I verified that the agent is loading correctly:The above is with
autodynatrace
not being used. Before doing that, I was seeing this, which leads me to think thatautodynatrace
was also loading the agent, as expected:I also added some additional logging by increasing the logging level:
Sample code being used:
I don't see any code-level Python traces using this minimal setup.
Related: I found this issue which looks similar, where version 1.257 was also mentioned and 1.258 resolved it: https://github.com/dynatrace-oss/OneAgent-SDK-Python-AutoInstrumentation/issues/64.