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
Observability on AWS: CloudWatch, X-Ray, Application Signals, ADOT, Managed Prometheus and Grafana
A complete overview of observability on AWS: CloudWatch components (metrics, logs, alarms, Applic...
oneagentctl and API cheat sheet: OneAgent tags, properties, host group, network and modes
oneagentctl commands and API calls to manage tags, host properties, host group, network zone, pro...
OpenTelemetry traces in Elasticsearch and Kibana APM
Instrument applications with OpenTelemetry or EDOT SDKs, send traces to Elasticsearch, get Kibana...
OpenTelemetry: automatic vs manual instrumentation
Understand the differences between automatic and manual instrumentation with OpenTelemetry, their...
New Relic dashboards: building, sharing and analysing
Building useful dashboards in New Relic: NRQL widgets, chart choice, template variables, facet li...
Alerts, service levels and incidents in New Relic
Setting up useful alerting in New Relic: policies and NRQL conditions, static and anomaly thresho...
Dynatrace: analysing database statements (modifications, queries and procedures, transactions)
How Dynatrace captures database calls from the application, groups them into database services, c...
Datadog on Kubernetes: Operator, Cluster Agent and Autodiscovery
Monitor Kubernetes with Datadog: the Datadog Operator and the DatadogAgent resource, Cluster Agen...
Logs with OpenTelemetry: data model, appenders, correlation and collection
Master the log signal: the LogRecord data model, the Logs Bridge API and appenders (Logback, Log4...