-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[DOCS-11051] Add Azure Event Hub using Kafka source #30211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 13 commits
12b675f
bb457cc
5904b01
4302f35
9521580
2bc4f0a
0d575f1
5f08c2b
81a3b95
c405046
27e8efd
bd2acea
e0266b5
b18a965
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,112 @@ | ||||||
--- | ||||||
title: Send Azure Event Hubs Logs to Observability Pipelines | ||||||
disable_toc: false | ||||||
--- | ||||||
|
||||||
## 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: | ||||||
|
||||||
- [Create an Event Hubs namespace](#create-an-azure-event-hubs-namespace) | ||||||
- [Create an Event Hub (Kafka topic)](#create-an-event-hub-kafka-topic) | ||||||
- [Configure shared access policy](#configure-shared-access-policy) | ||||||
- [Set up diagnostic settings](#set-up-diagnostic-settings) | ||||||
- [Configure Kafka-compatible connection for the event hub](#configure-kafka-compatible-connection-for-the-event-hub) | ||||||
|
||||||
After Azure Event Hubs has been set up, you [set up a pipeline with the Kafka source](#set-up-a-pipeline-with-the-kafka-source) to send Azure Event Hubs logs to Observability Pipelines. | ||||||
|
||||||
## Set up Azure Event Hubs for the Kafka source | ||||||
|
||||||
### Create an Azure Event Hubs namespace | ||||||
|
||||||
1. In the Azure Portal, navigate to [Event Hubs](https://portal.azure.com/#browse/Microsoft.EventHub%2Fnamespaces). | ||||||
1. Click **Create**. | ||||||
1. Fill in the **Project Details** (subscription, resource group) and **Instance Details** (namespace name, region, select Standard, Premium, or Dedicated tier). | ||||||
1. Ensure the region matches your Azure resources (for example, `westus`). | ||||||
1. Click **Review + create**. | ||||||
|
||||||
**Note**: The Kafka endpoint is automatically enabled for standard and higher tiers. | ||||||
|
||||||
### Create an event hub (Kafka topic) | ||||||
|
||||||
1. In the namespace you created, select **Event Hubs** and click **+ Event Hub**. | ||||||
1. Enter a name (for example, `datadog-topic`) and configure the settings (for example, 4 partitions and a 7-day retention time). | ||||||
1. Click **Review + create**. This Event Hub acts as a Kafka topic. | ||||||
|
||||||
### Configure shared access policy | ||||||
|
||||||
1. In the Event Hub you created, navigate to **Settings** > **Shared access policies**. | ||||||
1. Click **+ Add**. | ||||||
1. Enter a policy name (for example, `DatadogKafkaPolicy`). | ||||||
1. Select the **Manage** checkbox, which should automatically select the **Send** and **Listen** checkboxes. | ||||||
1. Click **Create**. | ||||||
1. Copy the **Primary connection string** to use for Kafka authentication. | ||||||
|
||||||
### Set up diagnostic settings | ||||||
|
||||||
1. Configure Azure resources (for example, VMs, App Services) or subscription-level activity logs to stream logs to the Event Hub. | ||||||
1. For resources: | ||||||
1. Navigate to the resource and then to **Monitoring** > **Diagnostic settings**. | ||||||
1. Click **+ Add diagnostic setting**. | ||||||
1. Select log categories you want (for example, AuditLogs, SignInLogs for Microsoft Entra ID). | ||||||
1. In **Destination details**: | ||||||
1. Check the **Stream to an event hub** box. | ||||||
1. Select the namespace and Event Hub (`datadog-topic`). | ||||||
1. Click **Save**. | ||||||
1. For activity logs: | ||||||
1. Navigate to **Microsoft Entra ID** > **Monitoring** > **Audit logs** > **Export Data Settings**. | ||||||
1. Check the **Stream to the Event Hub** box. | ||||||
1. 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 | ||||||
|
||||||
1. In the Azure Portal, navigate to your Event Hubs Namespace (for example, `myeventhubns`). | ||||||
1. 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`). | ||||||
1. 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 | ||||||
|
||||||
1. Azure Event Hubs uses SASL_SSL with the PLAIN mechanism for Kafka authentication. | ||||||
1. The connection string is formatted for Observability Pipelines: | ||||||
``` | ||||||
Username: $$ConnectionString | ||||||
Password: Endpoint=sb://<NAMESPACE>.servicebus.windows.net/;SharedAccessKeyName=<PolicyName>;SharedAccessKey=<Key> | ||||||
``` | ||||||
|
||||||
## Set up a pipeline with the Kafka source | ||||||
|
||||||
1. Navigate to [Observability Pipelines](https://app.datadoghq.com/observability-pipelines). | ||||||
1. Select the Kafka source. | ||||||
1. In the **Group ID** field, specify or create a unique consumer group (for example, `datadog-consumer-group`). | ||||||
1. Enter `datadog-topic` in the **Topics** field. | ||||||
1. Toggle the switch to enable SASL authentication. | ||||||
1. In the **Mechanism** dropdown menu, select **PLAIN**. | ||||||
1. Enable TLS. | ||||||
1. Download the certificate from [https://curl.se/docs/caextract.html](https://curl.se/docs/caextract.html) and save it to `/var/lib/observability-pipelines-worker/config/cert.pem`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should host this cert in docs? I don't think this third party site is something we can rely on. But I think certs expire, so I am not really sure what to do here. I found this out via: https://datadoghq.atlassian.net/wiki/spaces/PRODUCTSA/pages/5118492913/One+Oncology+2025#:~:text=Third%20TLS%20needs%20to%20be%20enabled.%20But%20I%20didn%27t%20know%20what%20cert%20to%20use.%20I%20found%20this%20really%20old%20github%20issue%20post There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might also want to be specific saying "Save this cert to this path on your OP worker host/container"? If it is containerized they will likely have to mount a volume to load it. This is a bit chicken and egg problem because this guide assumes they haven't deployed OPW yet, so that directory won't yet exist until OPW has been installed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this work?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hm I'm also not sure what's best here either..if it expires, how does someone find another one to use in this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested change looks good to me. Regarding cert, I don't really know 😓 I could ask the broader PSA team and see if someone smarter than me on these things has any thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I asked PSA team for suggestions, I am out of my depth here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Someone Smarter than me helped me out :) @krlv (Thank you so much!) His verbatim response below:
@emarsha94 and/or I will need to test this, I think we must do this before we proceed with publishing. I'll also check container land for these certs to see if they can be used. Hopefully our Azure Event Hubs environment is still around so we can test this without having to set everything up again 🤞 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Slacked this as well, but putting here for visibility: If it's going to take some time to test, do you think we could just say something like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just don't know if those certs already exist on a standard distribution or in our container image and if they'll work, thus why I want to test again. |
||||||
1. Enter `/cert.pem` in the **Certificate path** field. | ||||||
{{< img src="observability_pipelines/sources/kafka_settings.png" alt="The Kafka source settings with example values" style="width:45%;" >}} | ||||||
1. Click **Next: Select Destination**. | ||||||
1. After you set up your destinations and processors, click **Next: Install**. | ||||||
1. Select your platform in the **Choose your installation platform** dropdown menu. | ||||||
1. Enter the environment variables for your Kafka source: | ||||||
1. For **Kafka Bootstrap Servers**, enter `<NAMESPACE>.servicebus.windows.net:9093` (for example, `myeventhubns.servicebus.windows.net:9093`). | ||||||
1. For **Kafka SASL Username**, enter `$$ConnectionString`. | ||||||
1. For **Kafka SASL Password**, enter the full connection string (for example, `Endpoint=sb://<NAMESPACE>.servicebus.windows.net/;SharedAccessKeyName=<PolicyName>;SharedAccessKey=<Key>`). | ||||||
1. Enter your Kafka TLS passphrase. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we left this blank in our test, but @emarsha94 will have to confirm -- I don't see in either of our notes where we denoted needing this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this is the art we didnt give to the customer before in the notes, and we had to update. $$ConnectionString is definitely needed for instance There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since I am going to have to set this up to test it again for the certificate, I'll make note if we leave this blank or not when we get it to a working state. |
||||||
{{< img src="observability_pipelines/sources/kafka_env_vars.png" alt="The install page with example values for the kafka environment variables" style="width:100%;" >}} | ||||||
1. Enter the environment variables for your destinations, if applicable. | ||||||
1. Follow the rest of the instructions on the page to install the Worker based on your platform. | ||||||
|
||||||
#### Check your Observability Pipelines environment file | ||||||
|
||||||
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: | ||||||
|
||||||
- `DD_OP_SOURCE_KAFKA_SASL_USERNAME="$$ConnectionString"` | ||||||
- `DD_OP_SOURCE_KAFKA_BOOTSTRAP_SERVERS=<NAMESPACE>.servicebus.windows.net:9093` | ||||||
- `DD_OP_SOURCE_KAFKA_SASL_PASSWORD=<Endpoint=sb://<NAMESPACE>.servicebus.windows.net/;SharedAccessKeyName=<PolicyName>;SharedAccessKey=<Key>>` |
Uh oh!
There was an error while loading. Please reload this page.