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

Published
Length
3 min read

Luis Felipe Dias

All posts

You link new relic and teamcity to track build events and app health together. TeamCity runs your build steps and sends deploy markers straight to New Relic. This setup lets your team see how each new release affects app speed. When a build finishes, the server sends a short message with the change details. Engineers can then check error rates right after a new build goes live. How data and keys flow between new relic and teamcity The link between new relic and teamcity relies on outbound we

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.

You link new relic and teamcity to track build events and app health together. TeamCity runs your build steps and sends deploy markers straight to New Relic.

This setup lets your team see how each new release affects app speed. When a build finishes, the server sends a short message with the change details. Engineers can then check error rates right after a new build goes live.

How data and keys flow between new relic and teamcity

The link between new relic and teamcity relies on outbound web requests and API keys. TeamCity acts as the sender during the build or deploy step. New Relic acts as the receiver and stores the event data.

First, an admin creates a user key or ingest key inside the monitoring tool. Next, the admin stores that secret inside the build server as a hidden value. When a build job runs, the build runner reads the stored key. The runner then makes a web call to the monitoring API endpoint.

This call carries the app name, the revision number, and the build user. The monitoring platform logs the timestamp and draws a line on your performance charts. Teams can also pull build status logs and send them to a central log store. This flow works in one direction during most standard build tasks. In some cases, a deploy script also queries the monitoring API to check active alerts. If an alert is firing, the script can stop the release before it breaks production.

Common failure modes and how to scope roles

Many teams use one master API key for every project on the build server. This shared key creates a big security risk for the whole company. If one build script leaks the key in a plain text log, anyone can read it. An attacker could use an over-privileged key to delete dashboards or read sensitive app data.

Another common issue happens when teams use personal user keys for build jobs. When that engineer leaves the company, the admin deletes their account. The deploy scripts then fail during the next release because the key is dead.

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 keys to single projects. Create a dedicated service account for your build server rather than using personal accounts. Give each project in TeamCity its own narrow ingest key. Make sure that key can only write deploy events and cannot read account settings. Store the key as a password field so the build log masks the value. You should also restrict network paths so only deploy agents can reach external APIs. Rotate these keys on a set schedule to keep your pipeline safe.

Tracking build health and release metrics

Once your keys and roles are safe, you can track build performance over time. Build agents often get slow when disks fill up or tests take too long. By sending queue times and build durations to your monitoring tool, you spot bottlenecks fast.

Set up a step at the end of each run to send the job status. Include the project name, the agent name, and the total run time. You can then build a simple chart to watch failed builds across all teams. If a specific agent fails five times in an hour, an alert can notify the platform team. This keeps your build queue fast and helps developers ship code without long waits.

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 type of API key should TeamCity use for New Relic?

Use a scoped ingest key or a service user key tied to one project. Do not use a personal admin key that has full account write permissions.

How do we stop build logs from leaking our API keys?

Mark the secret parameter as a password type inside the project settings. The build server will rewrite matched fields in the log output with stars.

Can TeamCity stop a deploy if New Relic shows high error rates?

Yes, a build step can query the alert status API before pushing new code. If the query returns an active incident, the step fails and stops the run.

The query runs. The emails stay hidden.