Migrate Zero Code OpenTelemetry APM
Overview
Zero-code instrumentation adds the OpenTelemetry API and SDK capabilities to your application as an agent or agent-like installation, without requiring changes to your application code. It automatically instruments the libraries your application uses — HTTP requests, database calls, message queues, and so on. To instrument your own application logic beyond library calls, use the language-specific OpenTelemetry APIs.
Send to Kloudfuse
Regardless of which zero-code agent you use, configure the OTLP exporter by setting the following environment variables before starting your application:
export OTEL_EXPORTER_OTLP_ENDPOINT="https://<kloudfuse-hostname>/ingester/otlp" (1)
export OTEL_EXPORTER_OTLP_HEADERS="Kf-Api-Key=<api-key>" (2)
export OTEL_SERVICE_NAME="my-service"
export OTEL_RESOURCE_ATTRIBUTES="deployment.environment=production"
| 1 | Replace <kloudfuse-hostname> with your Kloudfuse cluster hostname. |
| 2 | Replace <api-key> with your Kloudfuse API key. |
Troubleshooting
Agent Not Attaching
Each language agent has a different attachment mechanism. Verify that the agent is activated correctly for your language:
-
Java: Check that
JAVA_TOOL_OPTIONSor-javaagentis set and the JAR path is correct. Look forOpenTelemetry Java agent loadedin startup logs. -
Python: Run
opentelemetry-instrument python app.pyinstead ofpython app.pydirectly. -
JavaScript/Node.js: Pass
--require @opentelemetry/auto-instrumentations-node/registerto thenodecommand. -
.NET: Verify the auto-instrumentation was installed with the official install script and that
CORECLR_ENABLE_PROFILING=1is set.
Environment Variables Not Picked Up
Zero-code agents read OTEL_* environment variables at startup.
If variables are set after the process starts, they will have no effect.
For container environments, set the variables in the container spec (env: in Kubernetes or -e in Docker) rather than inside the running container.
Only Some Libraries Are Instrumented
Zero-code agents instrument libraries that are present at startup. Libraries loaded dynamically after startup may not be instrumented. If spans are missing for a specific library, check whether a dedicated instrumentation package exists for it and install it alongside the agent.