The Simplest Way to Make New Relic and dbt Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing new relic and dbt lets teams track data transformations alongside app health metrics. You send dbt run statuses and test results into New Relic to catch broken pipelines fast. Data teams build tables with dbt while ops teams watch alerts in New Relic. Linking these two systems gives both teams one shared view of pipeline health. When a nightly build fails, engineers see the database error right next to app logs. This shared view cuts down the time spent guessing why a dashboard shows st

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Pairing new relic and dbt lets teams track data transformations alongside app health metrics. You send dbt run statuses and test results into New Relic to catch broken pipelines fast.

Data teams build tables with dbt while ops teams watch alerts in New Relic. Linking these two systems gives both teams one shared view of pipeline health. When a nightly build fails, engineers see the database error right next to app logs. This shared view cuts down the time spent guessing why a dashboard shows stale data.

How new relic and dbt share pipeline data

To link new relic and dbt, you export run results after each build finishes. Each dbt run creates metadata files that list model timing, row counts, and test failures. A small script or webhook reads those files and sends the events to New Relic. You use a write-only ingest key so the script can only push telemetry data.

New Relic stores these pipeline events in its central database for fast querying. From there, teams build charts that track how long each data model takes to run. You can also set up alert rules that ping your team when a test fails. If a core revenue table breaks, the right engineer gets an alert right away.

At the same time, dbt needs a way to log in to your data warehouse. It uses a dedicated database role to read raw tables and write clean models. Keeping the monitoring key separate from the warehouse role protects your core data. Each tool gets only the exact permissions it needs to do its job.

Common failure modes and how to scope roles

Many teams make the mistake of using one shared admin account for every dbt job. When a heavy query slows down the warehouse, New Relic shows the spike. Still, the logs only show the shared account name instead of the person responsible. Teams also often use broad API keys that allow full read and write permissions everywhere.

If an attacker steals a broad key, they can read or delete critical metrics. Another common problem happens when engineers run local dbt builds against production data without logging. Those unlogged queries can lock tables and break scheduled runs without leaving a clear trail.

End-to-End Encryption + New Relic Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix these issues by scoping roles and network paths between both systems. Give your telemetry script a restricted New Relic key that only writes custom events. In your warehouse, create separate database roles for scheduled jobs and local developer tests. Map each role to a specific team or service so logs show clear ownership.

Next, lock down the network paths between your job runner, warehouse, and monitoring endpoints. Allow outbound traffic from the job runner only to the warehouse and New Relic API. Turn on query logging for every warehouse role so every table change leaves a record. When data masks rewrite emails or card numbers in results, safe testing gets much easier.

Setting up alerts that cut through the noise

Sending every single dbt log line to New Relic creates alert fatigue for your team. Instead, focus your alerts on three core signals: failed tests, slow models, and skipped runs. A sudden jump in model run time often points to a bad join or missing index. Tracking run times over weeks helps you spot slow models before they break SLAs.

Group your alerts by data domain so finance issues go to the finance data team. Clear routing stops engineers from muting channels when unrelated test tables fail in staging. With clean roles and focused alerts, your data pipeline stays fast, clear, and easy to fix.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

What data should we send from dbt to New Relic?

Send model run times, build statuses, test pass rates, and row counts after each job. Avoid sending raw table rows or sensitive customer fields like phone numbers into monitoring logs.

How do we secure the keys used between both tools?

Store your New Relic ingest key and warehouse credentials in an encrypted secret store. Rotate these keys on a set schedule and give each key write-only or least-privilege permissions.

Can we track local developer dbt runs in New Relic?

Yes, you can send metadata from staging runs to a separate New Relic tag or account. Keep staging metrics apart from production alerts so developer tests do not page on-call engineers.

The query runs. The emails stay hidden.