Kibana: APM & Synthetics
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
Checked on 2026-11-09 against Kibana 9.5.x. Tested with Elasticsearch 9.5.6 and Kibana 9.5.6 in the hands-on lab (trial licence): the lab’s Bookshelf traces produced the aggregated APM metrics that the latency rule reads, and the rule fired in slow mode; the Applications UI views and Synthetics private locations were not exercised.
To do this by hand, follow Tour of the Observability Apps.
Infrastructure metrics say whether the machine is healthy; the next question is whether the service is. Two Observability apps answer it from opposite sides. APM (the Applications UI) looks from the inside: it builds the service inventory, latency and error charts, traces and the dependency map from telemetry that the application itself emits. Synthetics looks from the outside: it calls the service on a schedule, from one or more locations, the way a user would, and tells you when the call fails, even when the service emits nothing. Together they are the symptom-based halves of the RED method (see Monitoring Methods: RED, USE & Golden Signals). This page explains both, how they are fed in the lab, how to alert on them, and what is deprecated.
APM: services, traces and dependencies
Elastic APM is described as an application performance monitoring system built on the Elastic Stack. From instrumented services it collects response times for incoming requests, database queries, cache calls and external HTTP requests; it groups unhandled errors and exceptions by stack trace, so new errors stand out and their frequency can be tracked; and agents add host-level and runtime metrics (JVM metrics for Java, for example). The Kibana side is the Applications UI.
The views, in the order you normally use them:
| View | What it answers |
|---|---|
Service inventory |
Is any service unhealthy right now? A service is listed only if it sent transactions or spans in the selected time window, so a service that stopped reporting disappears instead of turning red. It shows active alert badges, SLOs per service, an Environment selector and, with anomaly detection enabled, an Anomalies column with each service’s highest anomaly score (Stack 9.5 and later; 9.0 to 9.3 sorted by a health status instead). |
Service overview |
Latency, throughput and failed transaction rate for one service, then its transactions, errors, metrics, infrastructure and logs. |
Traces and the trace sample timeline |
Where did the time go in one request? A distributed trace across services, drilled into from a transaction. |
Dependencies |
How healthy are the downstream things you cannot instrument (databases, third-party APIs)? Latency, throughput and failed transaction rate per dependency; compare current with past usage, so that steady traffic with rising latency points at the dependency. Dependency operations (the queries or calls a dependency runs) is beta. |
Service map |
Which services call which? Built from distributed traces, so an uninstrumented service does not appear as a connected node and a missing |
Errors and transactions |
Which error groups and which transaction groups hurt most. |
Service map details that matter operationally: services with the same name in different environments are confused unless you
use the environment selector, and OpenTelemetry users must set the deployment.environment resource attribute, otherwise
services show under "unset". The map’s controls (Presentation, Find in page, filters for dependencies, alert status, SLO
status and anomaly severity) are generally available on the Stack from 9.5; copying the map to a dashboard and the
"View in Service map" links are Planned for the Stack, and so is the Agent Builder "Investigate map" action. Service groups,
which group services by a KQL query on service.name, service.environment and similar fields to reduce noise and combine
alerts, are in beta.
Getting Bookshelf into APM with EDOT
Elastic recommends OpenTelemetry for new work. The language SDKs are the Elastic Distributions of OpenTelemetry (EDOT)
for Java, .NET, Node.js, Python, PHP and the browser; other community SDKs work over OTLP but are community-supported. On
the collector side there are three options: the OpenTelemetry Collector inside Elastic Agent (Stack 9.2 and later, sharing
elastic-agent.yml), Elastic Agent used as a standalone EDOT Collector (data stored in the OpenTelemetry-native format by
default) or the upstream otelcol-contrib, which is community-supported. In Elastic Cloud the managed OTLP endpoint takes
OTLP directly without your own collector. The legacy APM Server or managed-inputs OTLP intake translates to ECS, is not
recommended for new users, and does not support EDOT SDKs.
For the self-managed lab this means Bookshelf keeps sending OTLP to the EDOT Collector (set up in
Ingesting Monitoring Data); the Spring Boot side is
on Metrics & Observability. Two collector details decide whether the
Applications UI shows anything: it needs the elasticapm processor and connector, which upstream Contrib does not include,
and a self-managed deployment needs the collector in Gateway mode for APM. Without them, traces are searchable in Discover
but the service inventory stays empty.
Source: OpenTelemetry with Elastic APM and Get started with APM. The collector processor and Gateway requirement are described in the EDOT Collector reference, Elastic Distribution of OpenTelemetry Collector.
Alerting and machine learning on services
APM has four rule types, created from the Applications UI under Alerts and rules or from the Rules page:
-
Latency threshold: abnormal latency, scoped to environment, service name, transaction type or transaction name.
-
Failed transaction rate threshold: the rate of failed transactions in a service exceeds a threshold.
-
Error count threshold: the number of errors exceeds a threshold, scoped to environment, service or error group.
-
APM Anomaly: latency, throughput or failed transaction rate is anomalous, or the transaction count is unusually low (also to zero). The low-count detector is generally available on Serverless and Planned for the Stack. In Stack 9.0 to 9.5 you create the rule from Alerts then Manage Rules; from 9.6 and on Serverless there is a Create anomaly rule entry in the Applications pages.
The thresholds, the group-by choices and the action variables of these rules are on Observability Rules; the shape of a good alert is on Designing Actionable Alerts.
APM anomaly detection runs one machine learning job per environment, with detectors for latency, throughput, failed transaction rate and (for new jobs) low transaction count. It only considers "request" and "page-load" transaction types, needs a licence that includes machine learning, and needs enough trace data to learn from. Enable it with Anomaly detection then Create Job on any Applications page. Existing jobs keep their original detectors: to add the low-count detector you delete the environment’s transaction job and recreate it, which erases its model and history, and then you must reselect the detector in every rule. In 9.5 the service inventory and the alert details colour services by anomaly severity, and the service map uses a legend from gray (no data) through blue, yellow and orange to red (critical, 75 to 100).
Source: Create APM rules and alerts, Create an APM anomaly rule and Machine learning for APM. The jobs and results are explained on Machine Learning & AIOps.
Synthetics: checking from the outside
Synthetics periodically checks the status of services and applications. Monitor types:
-
Lightweight monitors: HTTP/S (the endpoint returns the expected status code and text), TCP (a port is accessible and its service is running) and ICMP, IPv4 and IPv6 (a host is reachable, which says nothing about the service on it).
-
Browser monitors: real Chromium journeys that test critical user actions (log in, add to a cart, check out) on a schedule.
Monitors run from locations: Elastic’s global managed testing infrastructure, or Private Locations that you operate. A self-managed lab has no Elastic-hosted infrastructure to run checks from, so it uses a Private Location.
Source: Synthetic monitoring.
Creating monitors in the UI
Open Synthetics, choose Create monitor, pick the type, one or more locations and the frequency, optionally Run test under Advanced options, and save. Browser monitors take an inline script or the script recorder, and one inline monitor holds only one journey, without imported dependencies (use a project for that). Advanced options include maintenance windows to suppress alerts and, from Stack 9.1, Kibana spaces. On the Stack from 9.4, creating or editing a monitor automatically creates default alert rules, which you manage under Settings then Alerting.
Source: Create monitors in the Synthetics UI.
Creating monitors as a project
A Synthetics project defines monitors as code, YAML for lightweight monitors and TypeScript or JavaScript for browser
monitors, kept in Git and deployed with the CLI from CI. The setup is npm install -g @elastic/synthetics, then
npx @elastic/synthetics init bookshelf-synthetics, which creates journeys/, lightweight/, synthetics.config.ts,
package.json and sample GitHub Actions workflows. The deployment needs a project API key, generated in the Synthetics app
under Settings then Project API Keys (Editor access; the "Elastic managed locations enabled" toggle must be on to push to
managed locations), exported as SYNTHETICS_API_KEY.
A lightweight monitor for Bookshelf, in lightweight/bookshelf.yml:
heartbeat.monitors:
- type: http
id: bookshelf-health
name: Bookshelf health
urls: "http://bookshelf:8080/actuator/health"
schedule: '@every 1m'
timeout: 10s
tags: ["bookshelf", "lab"]
check.response.status: [200]
private_locations: ["lab-private-location"]
Run the journeys locally with npx @elastic/synthetics journeys and deploy with
npx @elastic/synthetics push --auth $SYNTHETICS_API_KEY --url <kibana-url>; npx @elastic/synthetics locations lists the
Private Locations for a deployment. Each journey or lightweight monitor becomes one monitor in the Synthetics UI. HTTP checks
treat 4xx and 5xx status codes as down by default; the timeout defaults to 16 seconds.
Private Locations
A Private Location is an Elastic Agent enrolled in Fleet, which needs only outbound connections. Requirements and limits
from the documentation: an agent policy created in Fleet (from Stack 9.4 it must be in the same Kibana space as the
location), a Fleet-enrolled agent (standalone agents cannot be used), the elastic-agent-complete image for browser monitors
(the standard elastic-agent image supports only TCP, ICMP and HTTP monitors), the NET_RAW and SETUID capabilities, and a
direct connection to Elasticsearch (ingest pipelines and Logstash outputs are not supported). Create the location in Settings
then Private Locations. Sizing guidance: about 2 GiB of RAM and 2 cores per browser instance, 512 MiB and 2 cores for
lightweight monitors, two simultaneous browser tests per agent by default (SYNTHETICS_LIMIT_{TYPE} changes the limit) and
no more than 10,000 monitors per location. A scalable location, where several agents share one policy and Kibana assigns
each monitor to one agent with failover, needs an Enterprise subscription or trial and is generally available on Serverless
and Planned for the Stack; a classic location with several agents on the same policy can run duplicate or missing tests.
Alerting on monitors
The Synthetics monitor status rule is created from Synthetics then Overview then Alerts and rules. Its conditions are
a failure threshold (the monitor is down N times, measured in checks or in a time range, where retests count as checks) and a
location threshold (down in at least a number of locations, 1 to 10); an optional Alert on no data puts a monitor that sends
nothing into a pending state; filters limit the rule to certain monitors; the rule queries only synthetics-*. Advanced
options are alert delay and flapping detection. A browser monitor down in 3 of its last 5 runs, evaluated every minute and
firing after three consecutive matches, is the page’s own example. Alert on no data and flapping detection are generally
available on the Stack since 9.1.
The context variables available to actions include context.monitorName, context.monitorUrl, context.status,
context.reason, context.recoveryReason, context.locationNames, context.lastErrorMessage and context.viewInAppUrl.
A connector message for the lab’s webhook receiver (http://webhook-receiver:8080/kibana) can use them directly; connectors
and action frequency are on
Actions, Frequency & Action Variables and
Connectors.
Uptime is deprecated
The Uptime app and the Uptime monitor status rule are deprecated since 8.15 and unavailable on Serverless. The Synthetics UI does not support autodiscovery for infrastructure or Kubernetes monitoring; the documented alternatives are Heartbeat with autodiscovery or Elastic Agent with the Uptime Monitors integration, both reporting to the deprecated Uptime app. Migrating means recreating the monitors in Synthetics: "IS DOWN" replaces "ANY MONITOR IS DOWN", "WITHIN THE LAST" replaces "WITHIN last", and the Uptime availability condition has no counterpart in the monitor rule: use the Synthetics availability SLI of SLOs with a burn rate rule instead. The Elastic Synthetics integration is no longer recommended for new monitors either.
Source: Uptime monitoring and the migration notes on the monitor status rule page above.
What can go wrong
-
Traces arrive but no service appears: the
elasticapmprocessor or connector is missing, or a self-managed collector is not in Gateway mode. -
The service map shows isolated nodes: a hop does not propagate
traceparent, or the services run in different environments; setdeployment.environmenton every service. -
A service that crashes vanishes from the inventory (no transactions in the time window) instead of showing red: alert on absence with a Synthetics check or a no-data rule, not on the inventory.
-
A Private Location agent that reports "unhealthy" with a large number of monitors may be exceeding Fleet Server’s default 1 MiB check-in body limit.
-
Alerts from monitors flap during a rolling restart: set an alert delay or the location threshold instead of muting.
-
Browser monitors fail on a Private Location running the standard agent image: use
elastic-agent-complete.
Verify it in the lab
-
With the
kibanaprofile and the load generator running, open Applications then Service Inventory: the Bookshelf service must be listed, with latency, throughput and failed transaction rate. -
Open the service, then Dependencies. The lab’s stand-in makes no database calls, so no dependency appears there; with the real Spring Boot service the PostgreSQL database shows as a dependency and the Service map draws Bookshelf and the database.
-
Switch the load generator to failing-request mode: within a minute the failed transaction rate rises in the service overview. The stand-in sends no exception events, so the Errors tab stays empty.
-
The lab does not run a Fleet Server or a Private Location agent: add both to the Compose file, create the monitor from the YAML above, and push it. The monitor must report up from the first run.
-
Create the monitor status rule with a webhook connector pointing to
http://webhook-receiver:8080/kibana, stop the Bookshelf container, and wait for the failure threshold: the webhook receiver must log one alert withcontext.statusdown, and a recovery notification when the container returns.
In the books
The provided books do not cover Elastic APM, Synthetics or Uptime. Their Elastic material (Paro, Chhajed, Melachi and Shah) concerns Elasticsearch, Beats, Logstash and Kibana visualisation in earlier versions, so everything on this page is newer than the books. Publisher pages are listed in the bibliography of the section index.
Where to go next
-
SLOs for APM and Synthetics availability and latency SLIs