Browse docs
On this page

Send OpenTelemetry data

Set up the OpenTelemetry SDK or a Collector so your services' traces, metrics and logs fill the Application Observability add-on's dashboards and alerts, and check that they are arriving.

Turning on the Application Observability add-on does not collect anything by itself. Its dashboards and alerts fill in once your services send OpenTelemetry traces, metrics and logs to your workspace. This page covers what that takes.

What you need

  1. An ingest key. Create one from OpenTelemetry Collector in Connect Your Data. The key is shown once, so copy it then.
  2. Instrumentation in each service. The OpenTelemetry SDK for your language, with instrumentation for your framework and for the libraries that make outbound calls: HTTP clients, database drivers and message brokers. The dashboards about dependencies need those outbound spans.
  3. A service name (OTEL_SERVICE_NAME) for each service, so every dashboard splits by service.
  4. An exporter pointed at your workspace over OTLP/HTTP, either straight from the service or through a Collector you already run.

Send straight from a service

Every OpenTelemetry SDK reads the same environment variables. Set these for each service:

Shell
export OTEL_SERVICE_NAME=checkout-api
export OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.obistack.com/ingest/otel
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer%20${LOGS_API_KEY}"
export OTEL_TRACES_EXPORTER=otlp
export OTEL_METRICS_EXPORTER=otlp
export OTEL_LOGS_EXPORTER=otlp

The exporter adds /v1/traces, /v1/metrics and /v1/logs to the endpoint itself. Then start the service with your language's zero-code instrumentation, which traces the common frameworks, HTTP clients and database drivers without code changes.

Node.js

Shell
npm install @opentelemetry/api @opentelemetry/auto-instrumentations-node

node --require @opentelemetry/auto-instrumentations-node/register app.js

--require loads the instrumentation before your application, which it needs to patch the libraries your code imports.

Python

Shell
pip install opentelemetry-distro opentelemetry-exporter-otlp-proto-http
opentelemetry-bootstrap -a install

export OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
opentelemetry-instrument python app.py

opentelemetry-bootstrap installs the instrumentation for each library it finds in your environment. Run it again after adding a library.

Java

Download opentelemetry-javaagent.jar from the OpenTelemetry Java instrumentation releases, then start your application with it:

Shell
java -javaagent:./opentelemetry-javaagent.jar -jar app.jar

Other languages

Go, .NET, Ruby, PHP and others have OpenTelemetry SDKs that read the same environment variables. Follow the OpenTelemetry getting started guide for your language and keep the settings above.

Send through a Collector

If you already run an OpenTelemetry Collector, point your services at it as usual and add your workspace as an exporter on its traces, metrics and logs pipelines. See OpenTelemetry Collector for the config block.

Turn on the add-on

A workspace Owner or Admin turns on Application Observability from Add-ons in the app. Data you sent before turning it on shows up straight away, within your retention.

Check it is arriving

Send some traffic through your service, then run this in the Log Explorer over the last 15 minutes:

_signal=span | stats count() by service.name, span.kind
  • A row for each service means traces are arriving.
  • No CLIENT rows means nothing is tracing outbound calls, so the dependency and database dashboards stay empty. Add instrumentation for your HTTP client and database driver.
  • Nothing at all means traces are not reaching your workspace. Check the endpoint, the key, and that OTEL_TRACES_EXPORTER is not none.

For runtime and host metrics, run _signal=metric | stats count() by metric.name.

If a dashboard is still empty, see What the managed dashboards need for the attributes each one reads.