How to migrate from Datadog to Grafana
Export Datadog dashboards and monitors, collect with Prometheus and OpenTelemetry beside the Agent, rebuild panels in PromQL and LogQL, then cut over.
- Workflow and data
- 7 steps
- Keycloak
In short
- Leaving Datadog dashboards replaces three layers: collection moves to Prometheus exporters or OpenTelemetry, storage to Prometheus and Loki, and dashboards and alerts to Grafana.
- Grafana documents no self-serve import of Datadog dashboards, so each panel in use is rebuilt from the exported JSON, with its query translated to PromQL or LogQL and checked against the Datadog figure.
- Datadog monitors become Grafana alert rules, and the @-handles in their messages become contact points and notification policies that reach the same people.
- The Datadog Agent comes off last, once both systems have raised the same alerts for a full cycle.
On this page (10)
Moving from Datadog dashboards to Grafana is a rebuild of three layers, not an import. Datadog is a whole observability platform: its Agent collects, Datadog stores, and its dashboards and monitors show and alert. Grafana is the part you look at, so the other two layers are replaced as well. Prometheus exporters or the OpenTelemetry Collector collect, Prometheus keeps the metrics and Loki the logs, and Grafana draws them and evaluates the alerts. Grafana documents no self-serve import of Datadog dashboards, so panels are rebuilt and queries move from Datadog’s syntax to PromQL and LogQL. Datadog APM, real user monitoring, synthetic tests and the security products are scoped separately and are not covered here. This guide covers the order we run the rest in, and the places it usually goes wrong.
Why teams move from Datadog to Grafana
Datadog is a strong product, and the teams that leave it usually do so for three reasons.
- Telemetry that stays where you choose. Metrics and logs carry hostnames, user identifiers and error payloads. With Prometheus, Loki and Grafana on machines you control, they stay in the jurisdiction you picked.
- Open formats that outlive the tool. Prometheus exporters, OpenTelemetry, PromQL and dashboards kept as JSON files are not tied to one vendor. Instrumentation done once survives a later change of backend.
- Labels without a meter. For the metrics you send yourself, Datadog counts every combination of a metric name and its tag values as a custom metric, and bills custom metrics beyond the plan’s allotment. In Prometheus, a label costs memory and disk instead: cardinality is still a sizing question, but it is not a line on an invoice.
What you give up is real. Datadog is one product for metrics, logs, traces, real user monitoring, synthetic tests and security, with links from one to the other. Its integrations install dashboards and monitors out of the box, and its anomaly, outlier and forecast monitors have no built-in counterpart in Grafana OSS: Grafana documents its own forecasting and outlier detection as Grafana Cloud features. Grafana OSS also leaves SAML sign-in, team sync, data source permissions and reporting to Grafana Enterprise. And there are three systems to run instead of none, which is the part Pilae takes on.
Step 1: export dashboards, monitors and log pipelines
Take the exports before you change anything. They are the specification for everything you rebuild, so commit them to the repository the Grafana configuration will live in.
For one dashboard, the Configure icon in its top right corner offers Export dashboard JSON. For a monitor, the header of its status page has an Export button. For a whole account, use the API with an application key whose owner holds the dashboards_read, monitors_read and logs_read_config permissions, against your Datadog site’s API host.
# Your Datadog site's API host, for example api.datadoghq.eu
DD=https://api.datadoghq.eu
dd() { curl -sf -H "DD-API-KEY: $DD_API_KEY" -H "DD-APPLICATION-KEY: $DD_APP_KEY" "$DD$1"; }
mkdir -p datadog/dashboards
# Dashboards: the list comes in pages (count, start), then one file each
start=0
while ids=$(dd "/api/v1/dashboard?count=100&start=$start" | jq -r '.dashboards[].id') \
&& [ -n "$ids" ]; do
for id in $ids; do
dd "/api/v1/dashboard/$id" > "datadog/dashboards/$id.json"
done
start=$((start + 100))
done
# Monitors (all of them when no page is given) and log pipelines
dd /api/v1/monitor > datadog/monitors.json
dd /api/v1/logs/config/pipelines > datadog/log-pipelines.json
Each dashboard file holds its widgets with their queries, its template variables and its layout. Each monitor holds its query, its thresholds and options, its tags, and its message, where the @ handles name who is notified. The pipelines hold the filters and processors, Grok parsers included, that turn raw log lines into attributes in Datadog. Nothing in them runs in Grafana as it is; all of it says what to rebuild.
Step 2: list what is used, and what collects it
Most Datadog accounts carry dashboards nobody opens and monitors that never fire. Sort each one into rebuild, merge or retire, and name an owner for each one you keep.
- Dashboards in use. The Popularity column of the dashboard list scores each dashboard by its traffic, relative to the most visited one, and updates daily. Where Audit Trail is enabled, Datadog’s guide to tracking dashboard access lists who requested each dashboard.
- Monitors that fire. Monitor alerts and recoveries are recorded as events in the Event Explorer, so a search over the last ninety days, grouped by monitor, shows which ones fired. The export says who each one notifies.
- Custom metrics. The Metrics Catalog filters custom metrics with its Metric Category facet, and its Query Activity facet finds metrics nobody has used in a dashboard, monitor, notebook or API call over a recent window. A metric nobody reads is not rebuilt.
- What each Agent collects. On a host,
sudo datadog-agent statuslists the running checks, and their configuration sits in/etc/datadog-agent/conf.d/<check>.d/conf.yaml, or under%ProgramData%\Datadog\conf.don Windows. Fleet Automation shows the Agents and their configuration across the fleet. - Log sources. Which services and files send logs, and which pipeline parses each one.
- What is out of scope. APM services, real user monitoring applications, synthetic tests and security products, each with its owner, for the separate conversation.
An openmetrics.d check in that list is good news: the application already exposes Prometheus metrics, and Prometheus scrapes the same endpoint without new instrumentation.
Step 3: collect in parallel beside the Datadog Agent
The Datadog Agent stays where it is. The new collection goes on beside it, so both systems see the same machines while the dashboards are rebuilt.
What replaces each layer of Datadog
- Show and alert: Grafana dashboards, alert rules, contact points and notification policies, in place of Datadog dashboards and monitors.
- Store: Prometheus for metrics and Loki for logs, in place of Datadog’s own storage.
- Collect: Prometheus exporters and the OpenTelemetry Collector, in place of the Datadog Agent and its integrations.
- Hosts. The node exporter, an official Prometheus exporter, on Linux, and the Windows exporter on Windows; or the Collector’s host metrics receiver where you prefer one agent for metrics and logs.
- Services the Agent’s integrations covered. Prometheus’s list of exporters covers the common ones, among them the MySQL server, PostgreSQL, Redis and HAProxy exporters and the JMX exporter for Java. The Blackbox exporter probes endpoints from outside, over HTTP or TCP among others, in place of the Agent’s HTTP checks.
- Custom metrics over DogStatsD. The Agent listens for DogStatsD on port 8125 by default. During the parallel run it keeps that port and forwards every packet it receives to the Collector’s StatsD receiver on another port, with
statsd_forward_hostandstatsd_forward_portindatadog.yaml. The receiver reads DogStatsD-style tags, but Datadog’s configuration warns that the receiving server may not handle DogStatsD-specific packets, so test it with your own traffic. When the Agent goes, the Collector takes port 8125 and the applications do not change. - Applications on OpenTelemetry. They export to a Collector instead of the Agent. The Collector sends metrics to Prometheus’s OTLP receiver, which is off until Prometheus starts with
--web.enable-otlp-receiver, and logs to Loki’s/otlpendpoint through its OTLP HTTP exporter. - Log files. The Collector’s file log receiver tails files and parses them with operators, a JSON parser or a regular expression, much as a Datadog pipeline did with Grok.
Two things change on the way. Names: Prometheus’s default translation of OpenTelemetry metrics turns dots into underscores and adds unit and type suffixes, so checkout.latency does not keep its name. And labels: Loki indexes labels, not the full text, so keep a few low-cardinality ones such as service, environment and host, and leave request and user identifiers in the log line or in structured metadata. Loki’s own documentation advises against keeping pod names and instance IDs as labels.
Step 4: translate the queries to PromQL and LogQL
A Datadog metric query reads space_aggr:metric{tags} by {key}, with a time aggregation applied over each interval. PromQL starts from the series, selects them with label matchers, and wraps them in functions and aggregations. Most panels translate line for line once you know which exporter metric stands for the Datadog one.
| What the panel shows | Datadog query | PromQL |
|---|---|---|
| CPU in user space, per host | avg:system.cpu.user{*} by {host} |
100 * avg by (instance) (rate(node_cpu_seconds_total{mode="user"}[5m])) |
| Disk in use, as a fraction | avg:system.disk.in_use{*} by {host,device} |
1 - node_filesystem_avail_bytes / node_filesystem_size_bytes |
| Memory available | avg:system.mem.usable{*} by {host} |
node_memory_MemAvailable_bytes |
| Requests per second | sum:http.requests{service:web}.as_rate() |
sum(rate(http_requests_total{service="web"}[5m])) |
| 95th percentile latency | p95:http.request.duration{service:web} |
histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket{service="web"}[5m]))) |
Three differences catch teams out.
- Units.
system.cpu.useris a percentage, andsystem.disk.in_usea fraction. The node exporter counts CPU seconds, so a rate of them times 100 gives the percentage. - Counters. Datadog converts counts and rates with the
.as_count()and.as_rate()modifiers. Prometheus counters only go up, andrate()andincrease()turn them into a per-second rate or a total over a range. - Percentiles. Datadog computes percentiles of a distribution metric on its servers, across all hosts, once they are enabled for that metric. In Prometheus, the application records a histogram, and
histogram_quantilereads the percentile from the buckets summed across instances. Never average percentiles computed per host.
Log queries move from Datadog’s search syntax to LogQL: a stream selector on labels, line filters, a parser, then a range function. For logs written as JSON with a level field, Datadog’s service:web status:error becomes a selector on service_name and a filter on the parsed level, and a log monitor’s count over five minutes becomes count_over_time.
{service_name="web"} | json | level="error"
sum(count_over_time({service_name="web"} | json | level="error" [5m]))
Step 5: rebuild the dashboards as code
Build each dashboard from its export, panel by panel, in a scratch folder of Grafana. Then save its JSON into the repository, and let provisioning load it from there.
| Datadog | Grafana |
|---|---|
| Timeseries widget | Time series panel |
| Query Value widget | Stat panel |
| Top List widget | Bar gauge or Table panel |
| Hostmap | No direct equivalent: a Table or Stat panel per host |
| Monitor Summary widget | Alert list panel |
| Template variable | Dashboard variable, filled from label values |
Tag, such as env:prod |
Label, such as env="prod" |
| Log search in a widget | Logs panel on a LogQL query |
Provisioning reads a provider file in provisioning/dashboards that points at a directory of dashboard JSON files, and data sources from provisioning/datasources. With foldersFromFilesStructure, the folders in Grafana follow the folders in the repository. With allowUiUpdates left off, Grafana refuses to save a provisioned dashboard from the interface, so every change goes through a reviewed commit. Grafana overwrites a provisioned dashboard whenever its file changes, which is the point: the repository is the copy that counts.
For the dashboards Datadog’s integrations installed for you, start from a published Grafana dashboard for the same exporter rather than rebuilding Datadog’s panel by panel. Check its queries against your labels before you commit it.
Step 6: rebuild monitors as alert rules
A Datadog monitor query reads time_aggr(time_window):space_aggr:metric{tags} by {key} operator #. In Grafana, the same monitor is an alert rule: a PromQL or LogQL query, a condition with the threshold, an evaluation group whose interval sets how often it runs, and labels that route it.
- Multi alerts. A Datadog multi alert raises one alert per group. A Grafana rule raises one alert instance per series its query returns, so
by (instance)in PromQL does the same job. - Flapping. A pending period holds a rule until its condition has held for that long, and a keep firing for period stops it resolving and firing again on a flapping signal.
- No data. Grafana gives a rule’s No Data state its own handling, which by default raises a separate alert; set it per rule, as Datadog’s no-data notifications were. A host that stops reporting is also an ordinary rule on
up == 0. - Anomaly, outlier and forecast monitors have no built-in counterpart in Grafana OSS. They become static thresholds, a comparison with the same series a week earlier using PromQL’s
offset, or a linear forecast withpredict_linear. - Log monitors become rules on
count_over_timein Loki.
The routing is where people notice the move, so rebuild it to reach exactly the same people.
| Datadog | Grafana |
|---|---|
@ handle in the message: email, Slack, PagerDuty |
Contact point: Email, Slack, PagerDuty, Microsoft Teams, Webhook |
@team- handle |
Notification policy matching a team label |
| Notification rules that route by tag | Notification policies that route by label |
{{#is_alert}} blocks and tag variables |
Notification templates using the alert’s labels |
| Renotification | Timing options on the notification policy |
| Downtime | Silence for one-off windows, mute timing for recurring ones |
Keep these as code too. Grafana provisions alert rules, contact points, notification templates, notification policies and mute timings from files in provisioning/alerting, and contact point settings read environment variables, so webhook URLs and keys stay out of the repository. Rules first built in the interface are exported from Alerts & IRM, Alert rules, Export rules, as YAML, JSON or Terraform. Two consequences: provisioned resources cannot be edited in the interface, and the notification policy tree is one resource, so a provisioned tree replaces whatever was set by hand.
Step 7: compare, move the pager, then remove the Agent
Both systems now see the same machines. Use that to prove the rebuild before anyone depends on it.
Compare panels side by side. Open each Datadog dashboard and its Grafana rebuild on the same time range. Small differences have known causes: rollup intervals, the moments each system samples, and percentiles read from histogram buckets rather than from a distribution. A different shape, a missing host or a factor of 100 is a bug in the translation. With Grafana Enterprise, the Datadog data source can put both on one dashboard; with Grafana OSS, two windows do the job.
Compare alerts. Send Grafana’s alerts to a test channel first, and check that each one fires when its Datadog monitor does, for the same hosts. Then point the contact points at the people and services the monitors notify.
The cutover, in order
- Parallel: Exporters and the Collector run beside the Datadog Agent on every host.
- Compare: Dashboards match, and every kept rule has fired with its monitor for a full cycle, monthly jobs included.
- Route: Contact points switch to the real recipients, and the Datadog monitors are muted.
- Remove: The Datadog Agent comes off, host group by host group, and the Collector takes port 8125.
- Close: API and application keys are revoked and the subscription ends.
History does not move. Grafana shows what Prometheus and Loki collected from the start of the parallel run, and Datadog keeps its own history only while the account is open. Keep the exported JSON in the repository. If a regulation or a report needs past logs, set up a Datadog log archive early: it forwards every log ingested from then on, indexed or not, to a bucket you control as compressed JSON. If a report needs past metric values, export them through the metrics query API before the account closes.
Running Grafana in production
A Grafana that replaces Datadog is three systems, each with its own storage.
- Grafana on PostgreSQL. Users, dashboards, alert state and annotations live in its database, and the default SQLite file cannot back a second Grafana node.
- Prometheus sized by series. Its local storage is not clustered or replicated, so treat it like a single-node database and back it up. Retention is set by time or by size, and long retention goes to remote storage through its remote write and read APIs.
- Loki with a bucket. Log chunks go to S3-compatible storage. Retention is off by default and logs are kept forever, so enable it in the compactor, globally or per stream, before the bucket grows.
- Sign-in. Grafana OSS signs people in through OpenID Connect, which covers Keycloak and Microsoft Entra ID, or LDAP. SAML and team sync need Grafana Enterprise.
- Upgrades. Grafana ships often. Each upgrade is tried against a copy of your dashboards and alert rules first.
Pilae operates Grafana this way, with Prometheus and Loki beside it, each sized for your series count and log volume. Data sources, dashboards and alert rules are provisioned from your repository, so a rebuilt instance comes back identical. The Grafana database goes offsite daily, encrypted, and on Enterprise a restore test every month is recorded in the console. The Pilae Agent tests each upgrade against a copy of your dashboards, waits for your approval and applies it in your window. It runs on your premises or on dedicated machines in Pilae Cloud, answering only on your private network behind the Pilae gate. Your Grafana is yours: the monitoring Pilae runs on the apps we operate is separate, and it alerts our engineers, not your on-call rota.
Let Pilae run the move
Pilae runs Datadog to Grafana migrations at a fixed price: the exports and the inventory, collection in parallel with the Datadog Agent, dashboards and alert rules rebuilt as code with every query checked against Datadog, alert routing to the same people, and the removal of the Agent. Then we operate Grafana for you under a contract that, from the Business plan, includes a monthly availability commitment with service credits. See migration services for what the fixed price covers, or tell us which Datadog dashboards your teams open and we will scope it.
Questions
Can Grafana import Datadog dashboards?
Can Grafana show our Datadog data during the move?
Do our applications need new instrumentation?
What about Datadog APM, RUM and synthetic tests?
Is Grafana open source?
How long does a Datadog to Grafana migration take?
Let us run the move for you
An inventory, a parallel run and a cutover plan, at a fixed price. Then we operate the app.
- Go deeperSaaS migrationA fixed-scope migration off Google Workspace, Microsoft 365, Zapier, Airtable and ChatGPT to open-source apps, with a parallel run and a cutover plan.
- CheckManaged operationsPatching, daily encrypted backups, monitoring and incident response for your open-source apps, under an SLA with an availability commitment of up to 99.9%.
