Integrating Datadog with Mulesoft
Datadog is a monitoring and analytics tool for information technology (IT) and DevOps teams that can be used to determine performance metrics as well as event monitoring for infrastructure and cloud services. The software can monitor services such as servers, databases, and tools. Datadog monitoring software is available for deployment on-premises or as a software as a service (SaaS).
A Rest application program interface (API) is used to allow Datadog to integrate with numerous services, tools, and programming languages.
The user interface includes customizable dashboards that can show graphs composed of multiple data sources in real time. Datadog can also send users notifications of performance issues on any set metric, such as compute rates. Users are notified through means such as email, Slack, or PagerDuty.
Features
The features that Datadog offers include:
- Provides an IT/DevOps team with a single view of their infrastructure (including servers, apps, metrics, and other services).
- Customizable dashboards.
- Alerts based on critical issues.
- Support for over 250 product integrations.
- Automatically collects and analyzes logs, latency, and error rates.
- Allows for access to the API.
Steps to implement Datadog for MuleSoft Logs
- Create a Datadog Account.
- Create an API key in DataDog.
- Add a custom HTTP appender in log4j2.xml file in the mule application.
- Add Datadog appender in Async root level.
- Deploy mule application to Cloudhub.
Creating Datadog Account
- https://us5.datadoghq.com/signup
- Enter the required fields and click on Signup.
Creating API Key
On successful creation of Datadog account, create the API key. To do so:
- Click on the profile icon in the top right corner.
- Go to Organization Settings .
- Create a new Key or copy the existing key.
- To create a new key, click on “+New key”.
- Copy the API key.
Adding custom HTTP Appender
- Locate log4j2.xml in your application (src/main/resources/log4j2.xml).
- Add a custom HTTP appender along with the existing Rolling file appender.
- Paste API Key in log4j2.xml.
Adding Datadog Appender
- Add custom AppenderRef in AsyncRoot.
Deploy mule application to the Cloudhub
- Create a flow as follows, as an example.
- Deploy the application to Cloudhub.
- Right-click on the app > Anypoint Platform > Deploy to Cloudhub.
- Upon successful deployment, trigger the flow through the Public Endpoint by passing any query parameter “name”.
- Go to Datadog, hover over the logs icon, and click on the search.
- Filter based on time.
- You will be able to see the logs as shown in the screenshot below.