Integrate Datadog logs, APM, and custom metrics
Nullplatform supports Datadog as a logs and metrics provider. This page explains how to integrate Datadog with nullplatform to leverage its monitoring and observability features.
Grant nullplatform access to Datadog
You can enable Datadog for the following scope types:
- Instance-based
- Kubernetes-based
For instance-based scopes
Datadog for instance-based scopes is a supported provider.
To configure it, you'll need to access nullplatform:
- Log in to your organization's portal at
https://<your-org-name>.app.nullplatform.io.
- Go to Platform settings > Metrics/Logging.
- Click + New configuration and select Datadog as the provider.
- Fill in the required configuration details.
- Click Create configuration to save your setup.
See the Supported integrations and Providers docs for more details on this configuration.
For Kubernetes-based scopes
To enable Datadog for your Kubernetes-based scopes:
-
Create a Kubernetes secret named
datadog-secret
containing your Datadog API key. Use the following template:apiVersion: v1
kind: Secret
metadata:
name: datadog-secret
namespace: nullplatform-tools
type: Opaque
data:
DATADOG_API_KEY: <your key> -
Go to the null-metrics file and update the
env
section of thenullplatform-log-controller
container:env:
- name: DATADOG_LOGS_ENABLED
value: 'true'
- name: DATADOG_PERFORMANCE_METRICS_ENABLED
value: 'true'
- name: DATADOG_API_KEY
valueFrom:
secretKeyRef:
name: datadog-secret
key: DATADOG_API_KEY
Enable logs and metrics when creating scopes
Once Datadog access is granted through providers, configure scopes to use Datadog for logs and metrics:
- Navigate to Development > Scopes and click + New scope.
- Fill in the required configuration details:
- Select the environment and country.
- Give the scope a descriptive name.
- Select the target: either Server instances or Kubernetes, depending on your configuration.
- Click Advanced > Logs/Metrics and select Datadog as provider.
- Click Create scope to complete the task.
Create custom tags
In nullplatform, you can create parameters to send custom tags to Datadog. These parameters are defined as environment variables in the format NP_DD_<tag-name>
. The tag value comes from the content of the environment variable.
For example, setting NP_DD_ENV=test
will be relayed to Datadog as env:test
.
To create custom tags:
- In nullplatform, go to Development > Parameters, and click + New parameter.
- Fill in the required details:
.
- Name: Use
NP_DD_<tag-name>
(e.g.,NP_DD_ENV
). The name of the variable will autocomplete as you type. - Type: Select Environment variable.
- Scope: Choose the scope where the parameter should apply.
- Value: Enter the desired tag value (e.g.,
test
).
- Name: Use
- Click Create parameter to save your changes.
Your new custom tag will now be created as a parameter, and you’ll see it listed with the configuration details you added.
Send nullplatform metrics to Datadog
By enabling Datadog as the metric provider in your scope, nullplatform automatically sends special logs to your Datadog account, which can be transformed into detailed performance metrics.
When configuring metrics (e.g., memory, CPU, HTTP metrics), they will also be visible in the Performance section of your application in the nullplatform UI.
Available metrics for monitoring your system (grouped by category for easier navigation):
Memory metrics
nullplatform.scope.memory_usage_kb
- Query:
source:nullplatform-sys_agg
- Measure:
@user_memory_kb
- Group By: Common Group By fields
nullplatform.scope.memory_usage_percentage
- Query:
source:nullplatform-sys_agg
- Measure:
@memory_usage_percentage
- Group By: Common Group By fields
CPU metrics
nullplatform.scope.cpu_usage_percentage
- Query:
source:nullplatform-sys_agg
- Measure:
@cpu_usage_percentage
- Group By: Common Group By fields
HTTP metrics
nullplatform.scope.request_count
- Query:
source:nullplatform-http_agg
- Measure:
@counter
- Group By:
nullplatform.scope.response_time
- Query:
source:nullplatform-http_agg
- Measure:
@response_time
- Group By:
See the Group By info in the Reference section at the bottom of this page.
Recommendation: set a proxy agent to deliver custom metrics and APM
To transmit custom metrics and APM data to Datadog we recommend you configure a Proxy Agent. This setup lets your application send data directly to the agent minimizing the number of host agents needed, streamlining your architecture.
Here is a diagram of the proposed architecture:
For optimal performance and reliability, we recommend using a Network Load Balancer (NLB) with at least two agents.
Metrics reference
Common Group By fields
The following fields are commonly used across multiple metrics:
Field name | Description |
---|---|
@account | The account name. |
@account_id | The unique identifier for the account. |
@namespace | The namespace name. |
@namespace_id | The unique identifier for the namespace. |
@application | The application name. |
@application_id | The unique identifier for the application. |
@scope | The scope name. |
@scope_id | The unique identifier for the scope. |
@deployment_id | The unique identifier for the deployment. |
@instance_id | The unique identifier for the instance. |
Additional Group by fields
The following fields are used for HTTP metrics:
Field name | Description |
---|---|
@quality | The quality of the request (HTTP metrics only). |
@code | The HTTP response code (HTTP metrics only). |
@is_healthcheck | Indicates if the request is a healthcheck (HTTP metrics only). |