Ingest Your First Traces
This quickstart is for an application that is already running locally. If you
are new to the stack, start with the installation guide
and confirm that the OTel Collector is accepting telemetry on port 4317.
1. Choose an instrumentation path
Section titled “1. Choose an instrumentation path”For an APM workflow, start with auto-instrumentation. It creates framework and client spans without requiring changes to application code. Use manual instrumentation when you need custom business spans or your framework is not supported.
Python
Section titled “Python”pip install opentelemetry-distro opentelemetry-exporter-otlpopentelemetry-bootstrap -a install
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4317"export OTEL_SERVICE_NAME="orders-service"opentelemetry-instrument python app.pyNode.js
Section titled “Node.js”npm install @opentelemetry/auto-instrumentations-node \ @opentelemetry/sdk-node \ @opentelemetry/exporter-trace-otlp-grpc
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4317"export OTEL_SERVICE_NAME="orders-service"node --require @opentelemetry/auto-instrumentations-node/register app.jscurl -L -o opentelemetry-javaagent.jar \ https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4317"export OTEL_SERVICE_NAME="orders-service"java -javaagent:opentelemetry-javaagent.jar -jar app.jarSee Auto-Instrumentation for .NET, Ruby, Go eBPF, configuration options, and supported libraries.
2. Manual instrumentation (Python)
Section titled “2. Manual instrumentation (Python)”Use this smaller example when you want to see how spans are created explicitly.
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlpfrom opentelemetry import tracefrom opentelemetry.sdk.trace import TracerProviderfrom opentelemetry.sdk.trace.export import BatchSpanProcessorfrom opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
exporter = OTLPSpanExporter(endpoint="http://localhost:4317", insecure=True)provider = TracerProvider()provider.add_span_processor(BatchSpanProcessor(exporter))trace.set_tracer_provider(provider)
tracer = trace.get_tracer("my-app")
with tracer.start_as_current_span("handle-request") as span: span.set_attribute("http.method", "GET") span.set_attribute("http.url", "/api/users")
with tracer.start_as_current_span("query-database") as child: child.set_attribute("db.system", "postgresql") # your database query hereFor manual instrumentation in other languages, see the application guides.
3. Generate and verify a trace
Section titled “3. Generate and verify a trace”Send at least one request to the instrumented application. For example:
curl http://localhost:8080/healthThen open OpenSearch Dashboards and:
- Navigate to Observability → Traces.
- Search for your trace by name or filter by time range.
- Click a trace to see the span tree, timing, and attributes.
If the trace does not appear within a few seconds, check the APM troubleshooting guide before changing your application code.
Next steps
Section titled “Next steps”- Explore Application Monitoring - open the service map, services catalog, and RED metrics
- OpenTelemetry Demo Application - explore a realistic distributed system
- Create Your First Dashboard - build custom visualizations
- Agent Tracing - trace AI agent workflows with GenAI semantic conventions
- Send Data - more instrumentation options