Technology
Databricks Apps
Monitor Databricks Apps with correlated OpenTelemetry traces, logs, and metrics in Dash0.
Overview
Overview
Databricks Apps provides a serverless environment for building and running data and AI applications directly on the Databricks platform.
Configure your Databricks App to export OpenTelemetry traces, logs, and metrics to Dash0. This provides a single, correlated view of application requests, errors, performance, and custom telemetry.
Use Cases
- Monitor request performance and application availability.
- Track errors and investigate failed requests using correlated traces and logs.
- Analyze application and business metrics in Dash0.
- Understand dependencies and activity across your Databricks App.
Setup
Overview
This guide configures a Databricks App to export OpenTelemetry traces, logs, and metrics directly to Dash0 over OTLP/HTTP.
Prerequisites
You need:
- A Databricks workspace with permission to create or update a Databricks App.
- A Dash0 OTLP/HTTP endpoint, authorization token, and target dataset.
- Access to the app source and its
app.yamlfile. - An application that is already instrumented with OpenTelemetry, or permission to add instrumentation.
Store the Dash0 export headers as a secret
Open a Databricks Web Terminal, or another Bash terminal with an authenticated Databricks CLI.
Create a dedicated secret scope:
databricks secrets create-scope dash0-observabilityStore the Dash0 authorization and dataset headers in that scope:
read -rsp "Dash0 auth token: " DASH0_AUTH_TOKEN
printf 'Authorization=Bearer %s,Dash0-Dataset={{dataset}}' "$DASH0_AUTH_TOKEN" \
| databricks secrets put-secret dash0-observability otlp-headers
unset DASH0_AUTH_TOKENReplace {{dataset}} with the Dash0 dataset that should receive the telemetry.
Using a dedicated scope limits the app to secrets required for this integration. Databricks secret permissions apply to the entire scope rather than an individual secret.
Give the Databricks App access to the secret
In your Databricks workspace:
- Open Databricks Apps.
- Select the app you want to monitor.
- Open Settings.
- Under Resources, click Add resource and select Secret.
- Select the
dash0-observabilityscope. - Select the
otlp-headerssecret. - Set Permission to Can read.
- Set Resource key to
dash0_otlp_headers. - Click Save.
The resource key lets app.yaml reference the secret without placing its value in source control.
Configure OpenTelemetry export
When Databricks App telemetry is enabled, Databricks automatically configures OpenTelemetry to send application telemetry to a local gRPC collector at http://localhost:4314. The configuration below intentionally replaces that exporter destination and protocol so the application sends telemetry directly to Dash0 over OTLP/HTTP. It leaves OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES unchanged, preserving the app name and the workspace.id and app.name attributes injected by Databricks.
Add the following entries to the existing env section of the app's app.yaml. Keep the app's existing startup command unless you are also adding auto-instrumentation.
env:
- name: OTEL_SDK_DISABLED
value: "false"
- name: OTEL_TRACES_SAMPLER
value: always_on
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "{{endpoint_otlp_http}}"
- name: OTEL_EXPORTER_OTLP_PROTOCOL
value: http/protobuf
- name: OTEL_EXPORTER_OTLP_HEADERS
valueFrom: dash0_otlp_headers
- name: OTEL_TRACES_EXPORTER
value: otlp
- name: OTEL_METRICS_EXPORTER
value: otlp
- name: OTEL_LOGS_EXPORTER
value: otlpReplace {{endpoint_otlp_http}} with the OTLP/HTTP base endpoint for your Dash0 region. Do not append /v1/traces, /v1/logs, or /v1/metrics; the OpenTelemetry exporters add the appropriate signal path.
If Databricks App telemetry is not enabled, configure OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES explicitly in your application. Use a stable service name and include workspace.id and app.name along with any custom resource attributes.
The always_on sampler is useful while verifying the integration. For production workloads, select a sampling configuration appropriate for your traffic volume.
Confirm that the application is instrumented
The exporter configuration tells an OpenTelemetry SDK where to send telemetry. It does not generate telemetry by itself.
If your application already initializes an OpenTelemetry SDK or uses auto-instrumentation, no application-code changes are required. Deploy the updated configuration and continue to verification.
If it is not instrumented, follow the relevant Dash0 language integration:
Databricks also provides framework-specific instrumentation examples for Streamlit, Dash, Flask, FastAPI, and Node.js.
Example: auto-instrument a Flask application
For a Python Flask application, add these packages to requirements.txt:
opentelemetry-distro
opentelemetry-exporter-otlp-proto-http
opentelemetry-instrumentation-flask
opentelemetry-instrumentation-loggingThen prefix the existing startup command with opentelemetry-instrument. For an application normally started with python app.py, use:
command:
- opentelemetry-instrument
- python
- app.pyThis example instruments incoming Flask requests and Python logging. Add manual spans or custom metrics only when the application needs telemetry for application-specific operations.
For a pre-built application whose source cannot be changed, direct export works only if the application already emits OpenTelemetry data and honors the standard OTEL_* environment variables.
Deploy the app
In your Databricks workspace:
- Open Databricks Apps.
- Select the app.
- Open Overview.
- Click Deploy.
- Wait until the app status is Running.
- Open the application and exercise one or more workflows to generate telemetry.
Saving the source does not update a running deployment. You must deploy the latest version.
Verify telemetry in Dash0
Allow a few seconds for the exporters to send their first batches.
- Open Tracing → All spans in Dash0.
- Filter for
service.name = "databricks-app". - Confirm that spans appear for the workflows you exercised.
- Open Logging → All logs and apply the same service-name filter.
- Confirm that application logs are present and include trace and span IDs when emitted within a trace.
- Open Metrics and filter for the same service.
- Confirm that framework-generated or custom application metrics are present.