Script icon
If icon
SlackIncomingWebhook icon
Log icon
Return icon
Schedule icon

New Relic APM Apdex Score Degradation Sentinel

Audits New Relic APM applications for Apdex user satisfaction score degradation, evaluates latency SLA breaches, and alerts SRE teams via Slack.

Categories
CloudInfrastructure

Audits New Relic APM performance metrics to detect end-user satisfaction degradation, slow database transactions, and service latency anomalies.

How it works

  1. Triggers every 15 minutes on schedule to inspect APM production telemetry.
  2. Runs a containerized Python script querying the New Relic REST API for application summary statistics.
  3. Extracts real-time Apdex satisfaction ratings, mean response time in milliseconds, and error percentages.
  4. Evaluates if the composite Apdex score falls below configured operational thresholds using an If conditional task.
  5. Dispatches an alert to Slack with the application name, latency stats, and direct New Relic One triage links if degraded.
  6. Logs nominal performance metrics and exports a telemetry manifest for SRE SLA accounting.

Architecture diagram

flowchart TD
    A[Schedule Trigger: Every 15 Minutes] --> B[Task: evaluate_newrelic_apdex]
    B --> C{Task: check_apdex_degradation}
    C -- Apdex Below Threshold --> D[Task: notify_slack_apdex_degradation]
    C -- Nominal Performance --> E[Task: log_healthy_apdex]
    D --> F[Task: export_apdex_manifest]
    E --> F

What you get

  • Proactive notification when application latency degrades user satisfaction before users complain.
  • Holistic real-time correlation between response time, throughput, and unhandled error rates.
  • Instant Slack alerts equipped with deep links into New Relic One transaction traces and database query breakdowns.
  • Structured JSON execution audit reports suitable for monthly SRE SLA reviews and reliability accounting.

Who it's for

  • Application Performance Engineers tuning database query execution and caching layers.
  • Site Reliability Engineers maintaining uptime and response latency Service Level Objectives (SLOs).
  • Engineering Managers tracking cross-service performance degradation following major software releases.

Why orchestrate this with Kestra

While New Relic provides alerting policies, configuring custom multi-condition evaluations with contextual Slack actions across fragmented microservices requires substantial configuration overhead. Kestra offers a version-controlled, scheduled orchestration flow that queries New Relic REST APIs, evaluates complex satisfaction scores, maintains audit histories, and integrates seamlessly into incident response automation loops without extra agent daemons.

Use cases

  • Customer Experience Latency Guardrails: Detect customer-facing latency creep before user abandonment spikes on e-commerce transaction APIs.
  • Post-Release Regression Detection: Confirm that new application microservice releases maintain acceptable user satisfaction SLAs.
  • Noisy Neighbor Performance Isolation: Identify when database lock contention or third-party API delays degrade overall service responsiveness.

Inputs

Name Type Default Description
newRelicAppId STRING 12345678 Numeric application ID for the target APM service in New Relic.
minApdexThreshold FLOAT 0.85 Minimum acceptable Apdex satisfaction score (ranging from 0.0 to 1.0) before alerting.
newRelicApiKey SECRET None Encrypted New Relic REST API key or User API key with APM Read scope.
slackWebhookUri SECRET None Encrypted Slack Incoming Webhook endpoint for alerting Service Reliability teams.

Expected outputs

Primary execution outputs exported by export_apdex_manifest:

  • app_name: Evaluated New Relic application service name.
  • current_apdex: Real-time calculated Apdex satisfaction index.
  • response_time_ms: Average transaction response duration in milliseconds.
  • is_degraded: Boolean flag indicating whether Apdex breached threshold.
  • recommended_action: Actionable remediation advice and triage links.

Example expression: {{ outputs.export_apdex_manifest.value.is_degraded }}

Prerequisites

  • An active New Relic account with deployed APM agents.
  • A New Relic REST API key or User API key with read permissions.
  • A Slack Incoming Webhook URL stored in Kestra secrets.

Secrets

  • NEW_RELIC_API_KEY: New Relic API authentication key.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook URL.

Quick start

  1. Store your New Relic API key in Kestra secrets.
  2. Deploy this flow into your observability namespace.
  3. Set newRelicAppId to your target APM application ID from New Relic One.
  4. Run manual execution to verify API communication and Apdex score extraction.

Common pitfalls and troubleshooting

  • EU Region Endpoint: European New Relic accounts utilize https://api.eu.newrelic.com. Ensure your API endpoint matches account region.
  • Low Throughput Volatility: Applications with very low requests per minute (RPM) can experience volatile Apdex swings on individual slow calls.
  • Target Apdex Configuration: Apdex score is computed against the target response time (T) configured in New Relic application settings.

How to extend

  • Automated Container Restart: Trigger an orchestration workflow to reboot degraded service pods when Apdex remains below 0.70.
  • Thread Dump Capture: Initiate a diagnostic workflow to collect Java or Go stack traces from degraded application nodes.
  • Multi-App Service Fleet Audit: Loop through all critical enterprise application IDs using io.kestra.plugin.core.flow.ForEach.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.