RousselTMLEARNING

TP · New Relic: from discovery to expertise

Lab: Instrument an application and a host

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
Mode :

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

A boutique-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. 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 in NEW_RELIC_LICENSE_KEY without writing it to a versioned file.
  2. 2. Instrument the application

    Why? newrelic-admin run-program loads the agent before Flask: no code line to change.

    Create the Flask order application, its Dockerfile with the newrelic==14.3.0 agent, then run the boutique container on port 8000.
  3. 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. 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. 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 name tp-poste and the env and team attributes, then check it connects.
  6. 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 of tp-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

  • ⏱ Estimated time : ≈ 40 min

Sign in to track your progress and take notes. Sign in

⭐ Rate this lesson

3.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

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...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!