Send logs to Datadog
Create a stream that sends the logs of your applications to a Datadog log intake URL, in Azion Console or with the Azion API, and confirm the delivery.
You can send the logs of a stream to Datadog from Azion Console or with the Azion API.
Data Stream sends each batch of log lines to the log intake URL of your Datadog account and authenticates with a Datadog API key. In the stream form, the endpoint is set in the field labeled Connector, and Datadog is its Datadog option. For every field and its bounds, refer to Endpoints.
In this guide, the stream reads the requests that one workload receives, through the Applications data source.
Prerequisites
Console
- An Azion account with the Edit Data Stream permission. For the permissions, refer to Stream settings.
- A workload on the account that receives requests.
- A Datadog account.
- The log intake URL of your Datadog account, with its scheme, such as
https://http-intake.logs.datadoghq.com/v1/input. - A Datadog API key, created in the Datadog dashboard.
- Access to Azion Console. To sign in, refer to How to access Azion Console.
Create the stream
A workload filter limits the stream to the workload you pick. Unlike a stream with sampling, a stream with a workload filter leaves your other streams active.
Console
To create the stream in Azion Console:
Access Azion Console > Data Stream.
In the General section, enter a Name. For example: logs-to-datadog.
In the Input section, select Applications in Data Source.
In the Transform section, turn off Sampling while Option is still All Current and Future Workloads, its starting value. A stream cannot carry sampling and a workload filter together.
In the Transform section, set Option to Filter Workloads. In Available Workload, select your workload and move it to Chosen Workload with the arrow.
In the Render Template section, select Applications Event Collector in Template.
In the Output section, select Datadog in Connector.
In URL, enter the log intake URL of your Datadog account. For example: https://http-intake.logs.datadoghq.com/v1/input.
In API Key, enter your Datadog API key.
In the Status section, keep Active turned on.
The Console shows Your data stream has been created. The stream appears in the Data Stream list with Datadog in the Connector column and the Active status.
Neither the Console nor the API contacts Datadog when you save. A mistyped URL or an invalid API key shows up only as a failed send. The stream starts to send one to two minutes after you activate it.
Confirm the delivery
Each attempt of the stream to send a batch, successful or not, appears in Real-Time Events with the status code Datadog returned. Make a few requests to the workload and allow about a minute. The stream sends a batch every 60 seconds, or earlier when the batch holds 2,000 log lines.
Console
To find the sends in Azion Console:
Access Azion Console > Real-Time Events.
Each row is one send. Find the rows with DATADOG in Endpoint Type, and read their Status Code.
A Status Code of 200 means Datadog accepted the batch. Streamed Lines gives the number of log lines in the batch.
Any status other than 200 is the answer of Datadog, except 503, which means Data Stream found the endpoint unavailable. For the causes, refer to Troubleshoot Data Stream.