This product is not supported for your selected Datadog site. ().
Overview
This document walks through how to send Azure Event Hubs logs to Observability Pipelines using the Kafka source. The setup steps include setting up Azure Event Hubs for the Kafka source:
Fill in the Project Details (subscription, resource group) and Instance Details (namespace name, region, select Standard, Premium, or Dedicated tier).
Ensure the region matches your Azure resources (for example, westus).
Click Review + create.
Note: The Kafka endpoint is automatically enabled for standard and higher tiers.
Create an event hub (Kafka topic)
In the namespace you created, select Event Hubs and click + Event Hub.
Enter a name (for example, datadog-topic) and configure the settings (for example, 4 partitions and a 7-day retention time).
Click Review + create. This Event Hub acts as a Kafka topic.
Configure shared access policy
In the Event Hub you created, navigate to Settings > Shared access policies.
Click + Add.
Enter a policy name (for example, DatadogKafkaPolicy).
Select the Manage checkbox, which should automatically select the Send and Listen checkboxes.
Click Create.
The Primary Key and Primary connection string is needed for Kafka authentication when you set up the Observability Pipeline’s Kafka source.
Set up diagnostic settings
Configure Azure resources (for example, VMs, App Services) or subscription-level activity logs to stream logs to the Event Hub.
For resources:
Navigate to the resource and then to Monitoring > Diagnostic settings.
Click + Add diagnostic setting.
Select log categories you want (for example, AuditLogs, SignInLogs for Microsoft Entra ID).
In Destination details:
Check the Stream to an event hub box.
Select the namespace and Event Hub (datadog-topic).
Click Save.
For activity logs:
Navigate to Microsoft Entra ID > Monitoring > Audit logs > Export Data Settings.
Check the Stream to the Event Hub box.
Repeat for each region. Logs must stream to Event Hubs in the same region.
Configure Kafka-compatible connection for the Event Hub
Azure Event Hubs exposes a Kafka endpoint at NAMESPACE.servicebus.windows.net:9093, which Observability Pipelines uses as the Kafka source.
Get the Kafka endpoint
In the Azure Portal, navigate to your Event Hubs Namespace (for example, myeventhubns).
On the Overview page, under the Essentials section, locate the Host name or Fully Qualified Domain Name (FQDN). It is in the format: <NAMESPACE>.servicebus.windows.net (for example, myeventhubns.servicebus.windows.net).
Append the Kafka port :9093 to form the Bootstrap Servers value: <NAMESPACE>.servicebus.windows.net:9093.
For example, if your namespace is myeventhubns, the Bootstrap Servers is myeventhubns.servicebus.windows.net:9093.
You need this information when you set up the Observability Pipelines Kafka source.
Set up authentication
Azure Event Hubs uses SASL_SSL with the PLAIN mechanism for Kafka authentication.
The connection string is formatted for Observability Pipelines:
In the Certificate path field, enter /ca-certificates.crt if you used the example above. Otherwise, enter the name of your certificate.
Click Next: Select Destination.
After you set up your destinations and processors, click Next: Install.
Select your platform in the Choose your installation platform dropdown menu.
Enter the environment variables for your Kafka source:
For Kafka Bootstrap Servers, enter <NAMESPACE>.servicebus.windows.net:9093 (for example, myeventhubns.servicebus.windows.net:9093).
For Kafka SASL Username, enter $$$$ConnectionString. Note: You must have $$$$ in front of ConnectionString because $$$$ ends up being $$ when transposed into the environment.
For Kafka SASL Password, enter the full connection string. For example, Endpoint=sb://<NAMESPACE>.servicebus.windows.net/;SharedAccessKeyName=<PolicyName>;SharedAccessKey=<Key>.
This is the Primary Connection String in your Event Hub instance shared access policies.
In the Certificate path field, enter /ca-certificates.crt.
Click Next: Select Destination.
After you set up your destinations and processors, click Next: Install.
Select your platform in the Choose your installation platform dropdown menu.
Enter the environment variables for your Kafka source:
For Kafka Bootstrap Servers, enter <NAMESPACE>.servicebus.windows.net:9093 (for example, myeventhubns.servicebus.windows.net:9093).
For Kafka SASL Username, enter \$\$ConnectionString. Note: You must escape the $ in front of ConnectionString, otherwise the environment variable won’t be loaded.
For Kafka SASL Password, enter the full connection string wrapped in quotes ("). For example, "Endpoint=sb://<NAMESPACE>.servicebus.windows.net/;SharedAccessKeyName=<PolicyName>;SharedAccessKey=<Key>".
This is the Primary Connection String in your Event Hub instance shared access policies.
If you run into issues after installing the Worker, check your Observability Pipelines environment file (/etc/default/observability-pipelines-worker) to make sure the environment variables are correctly set:
If you see the error Missing environment variable DD_OP_SOURCE_KAFKA_SASL_PASSWORD and you are running the Worker in a VM, make sure that the variable is in quotes (") when you run the Worker install script. For example: