Send logs to Zerobus Ingest from Datadog Observability Pipelines
For every setting of the Databricks (Zerobus) destination, see Datadog's Databricks (Zerobus) destination. For the workspace URL and endpoint steps, see Get your workspace URL and Zerobus Ingest endpoint. For the service principal steps, see Configure authentication.
Maintained by: Datadog, in its Observability Pipelines documentation. Databricks maintains the Zerobus Ingest steps.
Datadog Observability Pipelines includes a native Databricks (Zerobus) destination. The Observability Pipelines Worker streams logs to Zerobus Ingest and writes them into a Unity Catalog Delta table, so you don't need to run a message bus between the pipeline and the table. After you finish these steps, the logs that the pipeline sends appear as rows in that table.
When to use this path
- You send logs through Datadog Observability Pipelines and want them in a Unity Catalog table.
- Your logs have fields that map to the columns of one table. The destination drops fields that the table doesn't define, and it rejects values that don't match the column types (see Troubleshooting).
Otherwise, to write your own client, see Choose an interface.
How it works
- Interface: The Worker sends logs to the Zerobus Ingest endpoint of your workspace.
- Schema: The table is created ahead of time in Unity Catalog. Log fields that aren't in the table schema are dropped, so a field the table doesn't define isn't written.
- Types: Each log field value must match the data type of its column. A mismatch can drop the whole batch. String timestamps must be converted to the
TIMESTAMPtype first. - Authentication: The Worker authenticates with an OAuth service principal, using its client ID and an OAuth client secret. For the requirements, see Configure authentication.
- Delivery: Zerobus Ingest can deliver a record more than one time. A retried record can produce a duplicate row. See Delivery guarantees.
- Buffering: Datadog uses a 500-event memory buffer unless you configure one. You can configure a memory or disk buffer on the destination.
Requirements
- A Datadog account with Observability Pipelines.
- A Datadog API key that is enabled for Remote Configuration. See Install the Worker.
- A workspace in a region that supports Zerobus Ingest. See Availability.
- A service principal with an OAuth client secret and the Workspace access entitlement. See Configure authentication.
- A target table that meets the Table requirements.
- Permission to grant privileges on the target catalog, schema, and table, for example as their owner or with
MANAGE. See Who can manage privileges?.
Create the schema and table
Replace <catalog>.<schema>.<table> with your table name. Datadog's example table defines five columns. The CREATE SCHEMA statement is optional if the schema exists. See Create schemas.
Zerobus Ingest doesn't write to tables backed by default storage. Create the schema with a MANAGED LOCATION clause, in place of the CREATE SCHEMA statement in the following example. Replace <storage-location> with a cloud storage path that isn't default storage. An existing schema on default storage doesn't work, so use a new schema. See Limitations.
CREATE SCHEMA <catalog>.<schema> MANAGED LOCATION '<storage-location>';
CREATE SCHEMA IF NOT EXISTS <catalog>.<schema>;
CREATE TABLE <catalog>.<schema>.<table> (
host STRING,
message STRING,
service STRING,
source_type STRING,
timestamp TIMESTAMP
);
The table can have more columns. Add one for each log field you want to keep. For the table's full requirements, see Table requirements.
Create the service principal and grant access
- In your Databricks workspace, create a service principal. See Configure authentication.
- Generate an OAuth secret for the service principal. Save the Application ID (the client ID, a UUID) and the client secret. You enter both in Step 3.
- On the service principal's Configurations tab, make sure that the Workspace access entitlement is selected. Zerobus Ingest requires it.
- Grant the service principal access to the catalog, schema, and table:
GRANT USE CATALOG ON CATALOG <catalog> TO `<service-principal-uuid>`;
GRANT USE SCHEMA ON SCHEMA <catalog>.<schema> TO `<service-principal-uuid>`;
GRANT SELECT, MODIFY ON TABLE <catalog>.<schema>.<table> TO `<service-principal-uuid>`;
Replace <service-principal-uuid> with the service principal's client ID.
Add the Databricks destination to a pipeline
- In Datadog, go to Observability Pipelines and create a logs pipeline. See Set up pipelines.
- Add a log source. For the list of sources, see Sources.
- Add the Databricks (Zerobus) destination, and enter these values:
Setting | Value |
|---|---|
Ingestion Endpoint | The Zerobus Ingest endpoint for your workspace, with the |
Table Name |
|
Unity Catalog Endpoint |
|
Auth - Client ID | The service principal's client ID (UUID) |
Auth - Client Secret | The identifier of the OAuth client secret, not the secret itself. If you leave it blank, Datadog uses the default identifier. |
Ingestion Endpoint: https://<workspace-id>.zerobus.<region>.gcp.databricks.com
To find your workspace ID and region, see Get your workspace URL and Zerobus Ingest endpoint.
For the client secret, enter only the identifier, without a DD_OP_ prefix. The default identifier is DESTINATION_DATABRICKS_ZEROBUS_OAUTH_CLIENT_SECRET. With environment variables, Datadog prepends DD_OP_ to the identifier, so the default environment variable is DD_OP_DESTINATION_DATABRICKS_ZEROBUS_OAUTH_CLIENT_SECRET.
Optionally, to change the buffer, turn on Buffering Options on the destination. See Destination buffers.
Install the Worker and deploy the pipeline
Run the install command that Datadog shows on the pipeline's Install step, and add the destination's environment variable for the client secret. That command also includes your source's port mappings and environment variables, so keep them. The Docker form has this shape, with the source-specific flags left out:
docker run -i -e DD_API_KEY \
-e DD_OP_PIPELINE_ID=<pipeline-id> \
-e DD_SITE=<datadog-site> \
-e DD_OP_DESTINATION_DATABRICKS_ZEROBUS_OAUTH_CLIENT_SECRET \
datadog/observability-pipelines-worker run
Before you run the command, read the Datadog API key and the client secret into their variables, so neither stays in your shell history:
read -rsp 'Datadog API key: ' DD_API_KEY && export DD_API_KEY
read -rsp 'Client secret: ' DD_OP_DESTINATION_DATABRICKS_ZEROBUS_OAUTH_CLIENT_SECRET && export DD_OP_DESTINATION_DATABRICKS_ZEROBUS_OAUTH_CLIENT_SECRET
This example uses the default identifier from Step 3. If you entered a different identifier, use DD_OP_ followed by that identifier as the variable name in both commands. An -e flag without a value passes the variable from your environment, so the secret isn't typed on the command line. Use the command in the Datadog UI as the source of truth for the exact flags. For the other install methods, including Secrets Management and Kubernetes, see Install the Worker.
Check the table
After logs reach the pipeline, query the table. Replace <catalog>.<schema>.<table> with your table name:
SELECT host, message, service, source_type, timestamp
FROM <catalog>.<schema>.<table>
ORDER BY timestamp DESC
LIMIT 10;
The result shows the rows the pipeline wrote, with the values from the log fields that match the table's columns.
To monitor the destination, filter Datadog's Pipelines Usage Metrics by the component_type tag, which identifies the destination type.
Troubleshooting
Symptom | Cause | Fix |
|---|---|---|
The Worker logs | A string timestamp is sent to a | Add a Custom Processor with |
The Worker logs | A field value doesn't match its column type, for example an object sent to a | Convert the field with a Custom Processor. See Data type of log field values. |
Some fields are missing from the table | The table has no column with that name. The destination drops fields that the table schema doesn't define. | Add a column with the same name and a matching type (Step 1), or accept that the field is dropped. |
No rows appear in the table | The service principal is missing a grant, or the client ID or secret identifier is wrong. | Check the grants in Step 2 and the values in Step 3. For error codes, see Zerobus Ingest errors. |
Additional resources
- Databricks (Zerobus) destination: Datadog's reference for every setting, the secret defaults, and the health metrics.
- Set up pipelines and Install the Worker: Datadog's pipeline and Worker setup.
- Use Zerobus Ingest: the workspace URL, the endpoint, and the service principal steps shared by all interfaces.
- Zerobus Ingest errors: the error codes Zerobus Ingest returns.
- Zerobus Ingest quotas: the default quotas and the regions where Zerobus Ingest is available.