What you will learn in this TP
- Install an APM agent without changing code
- Generate traffic and read transactions, Apdex and errors
- Deploy the infrastructure agent
- Check collection with NRQL
All steps and instructions are shown. Recommended for this lab: guided
Introduction #
Context. Your company's online shop is slow at peak times, and nobody knows why. You instrument the order service and the server hosting it to finally get numbers.
Prerequisites: a free New Relic account (license key), a machine with Docker, curl and jq · Estimated time: 40 min
Aboutique-tp application and a tp-poste host visible in New Relic, with transactions, errors, logs and system metrics.Setup #
Guided steps, with their solution.
1. Get the license key
Why? The license key authenticates data ingest; a user key would not work.
In New Relic, open API keys and copy an INGEST - LICENSE key. Export it inNEW_RELIC_LICENSE_KEYwithout writing it to a versioned file.2. Instrument the application
Why?
newrelic-admin run-programloads the agent before Flask: no code line to change.Create the Flask order application, itsDockerfilewith thenewrelic==14.3.0agent, then run theboutiquecontainer on port 8000.3. Generate traffic
Why? Without traffic, the agent has nothing to measure; a steady volume gives reliable percentiles.
Send 400 requests to/commande/<n>and count the HTTP codes returned.4. Read APM
Why? The APM summary answers the first three incident questions: is it slow, is it failing, since when?
Open APM & Services › boutique-tp. Note throughput, Apdex, error rate, the slowest transaction and the error class in Errors inbox. Open a transaction trace of a slow order.5. Add the infrastructure agent
Why? Application slowness often comes from a saturated host: you need to see both layers.
Run the infrastructure agent as a container with the nametp-posteand theenvandteamattributes, then check it connects.6. Check with NRQL
Why? Knowing how to check collection yourself avoids concluding too quickly that "there is no problem".
In Query your data, write four queries: transactions per name with p95, errors per class, CPU and memory oftp-poste, and the number of logs linked to the application.
Validate your work
Check that each goal above is reached and that you get the result described in the introduction.
Difficulty level : ●●○○○ (2/5)
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
New Relic: the observability platform at a glance
Discover New Relic: history, the unified platform and NRDB, MELT data types, entities and golden ...
New Relic APM: agents, OpenTelemetry and distributed traces
Instrumenting applications with New Relic: language agents, configuration, transactions and Apdex...
Infrastructure, logs and Kubernetes with New Relic
Monitoring servers, containers and Kubernetes with New Relic: infrastructure agent, on-host integ...
NRQL: querying all your New Relic data
Mastering NRQL, New Relic's query language: SELECT … FROM structure, filters, aggregation functio...
Datadog APM and OpenTelemetry: traces, services and correlation with logs
Instrument applications for Datadog APM (dd-trace, single step instrumentation, OpenTelemetry), u...
Installing Phoenix and tracing your first LLM application
Install Arize Phoenix (pip, Docker), send your first OpenInference traces from an OpenAI applicat...
Observability on Azure: Azure Monitor, Log Analytics, Application Insights, managed Prometheus and Grafana
A complete overview of observability on Azure: Azure Monitor (metrics, logs and Log Analytics, KQ...
Application Observability in Grafana Cloud
Application Observability in Grafana Cloud: RED metrics from traces, service map, OpenTelemetry o...
Elastic Observability: logs, infrastructure, APM and synthetics
Elastic Observability features: log exploration, infrastructure inventory with Elastic Agent and ...