Telemetry

In CAP telemetry is OpenTelemetry: spans around service and database calls, metrics beside them, and a correlation id that lets one request be followed across the services it touches. Which runtime the service is on decides how the signals arrive and what the application has to write to add one of its own.

Overview

SAP SHIPS
Node.js →

@cap-js/telemetry Automatic OpenTelemetry instrumentation for CAP Node.js services and their database calls, exported as traces and metrics to the console, SAP Cloud Logging, Dynatrace, Jaeger or an OTLP endpoint.

Java →

com.sap.cds:cds-services-bom CAP instrumentation for OpenTelemetry, traces and metrics through the Java agent and extension library, for SAP Cloud Logging or Dynatrace.

Not covered: It stops at the server. Traces begin when a request arrives, so frontend performance and client-side errors, the half the user actually experiences, are outside what the runtime can see. Two more edges sit inside the server: on Node.js database tracing reaches @cap-js/cds-dbs databases and not other drivers, and on Java the CAP-specific instrumentation creates no spans at all until the matching logger is raised, even with the agent attached.

THE COMMUNITY ADDS

@cap-js-community/business-metrics turns CDS annotations into counter and gauge metrics, so a business count does not have to be written as OpenTelemetry API calls. cap-ui-telemetry takes the browser side the runtime cannot see, reading UI5's FESR headers and accepting batches of client errors, and writes them as cds.log records. cap-mcp-guard adds a span per agent request against the application's own OpenTelemetry SDK, and @sanjay-sde/cap-js-log-control lowers the diagnostic logging the OTLP exporters produce so real errors stay visible.

Artifacts9

9 of 9 artifacts
ArtifactSignals
CDS plugins7
@cap-js-community/business-metricsBusiness-level metrics from CDS annotations via @cap-js/telemetry
Signals
none
@cap-js/telemetryOpenTelemetry instrumentation for CAP services
Signals
none
@sanjay-sde/cap-js-log-controlCAP plugin controlling CDS logger and OpenTelemetry log verbosity
Signals
none
cap-mcp-guardPolicy enforcement and field masking for MCP-enabled CAP apps
Signals
none
cap-ui-telemetryUI5 frontend performance and error capture for CAP
Signals
none
cds-cachingCAP caching plugin for query results and remote service responses
Signals
Functional boundary
opentelemetry-cdsOpenTelemetry support for the CDS Node.js runtime
Signals
none
Packages2
@sap-ux/telemetryLibrary for sending usage telemetry data
Signals
none
com.sap.cds:cds-services-bomMaven bill of materials pinning CAP Java module versions
Signals
none

Tasks4Beta

Shown workingCoversCovers, under conditionsLikely, from its propertiesAssessed, not knownNot assessed
Count a business event as a metric1 shown working, 1 covers, 1 under conditions, 1 likely

A count the business asks for, how often an order is released or a document read, is emitted as a metric beside the runtime's technical ones, with the tenant on it.

Shown working@cap-js/telemetry
Coverscom.sap.cds:cds-services-bom
Covers, under conditions@cap-js-community/business-metrics

Telemetry is enabled in the CAP application configuration enableBusinessMetrics is set under cds.requires.telemetry.metrics The project is a CAP Node.js project with service definitions Tenant is the only dimension available, which the README states for the counting annotation

Open artifact →

Likely, from its propertiescds-caching
See what the browser did before the request arrived1 under conditions, 1 not known

The time a UI5 interaction took in the browser, and the JavaScript errors it hit, land in the backend beside the server's own telemetry, so a complaint about a slow or broken screen can be checked.

Covers, under conditionscap-ui-telemetry@sap/cds 8.0 or later on Node.js A UI5 app that sends the FESR headers SAP Cloud Logging bound to the CAP app for the custom fields to be indexed
Assessed, not known@cap-js/telemetry
See where a slow request spent its time2 covers, 2 likely, 1 not known

A request that takes too long is broken down into the service calls, handlers and database statements it ran, with the elapsed time of each, so the slow part can be named.

Covers@cap-js/telemetry
Coverscom.sap.cds:cds-services-bom
Likely, from its propertiescap-mcp-guard
Likely, from its propertiescds-caching
Assessed, not knownopentelemetry-cds
Send a service's traces and metrics to SAP Cloud Logging1 shown working, 1 under conditions, 1 likely

The spans and metrics a deployed CAP service produces arrive in an SAP Cloud Logging instance, where they can be searched and put on a dashboard.

Shown working@cap-js/telemetry

cds.requires.telemetry.kind is set to to-cloud-logging An SAP Cloud Logging instance exists and the application is bound to it The instance was created or updated with ingest_otlp enabled, so the binding carries OpenTelemetry credentials @grpc/grpc-js, @opentelemetry/exporter-trace-otlp-grpc and @opentelemetry/exporter-metrics-otlp-grpc are added as dependencies A user-provided service instance used for the binding carries the tag Cloud Logging

Open artifact →

Covers, under conditionscom.sap.cds:cds-services-bom

The application uses the SAP Java Buildpack, which the documented configuration steps assume The application is bound to a cloud-logging service instance created with ingest_otlp enabled OTEL_METRICS_EXPORTER and OTEL_TRACES_EXPORTER are set to cloud-logging The CAP span loggers are raised, since the CAP-specific instrumentation creates no spans by default

Open artifact →

Likely, from its propertiescap-ui-telemetry

Content9

Group by9 of 9 pieces
Piece, what it offers
CAP in the age of AI #5 - agents wrap-up
YouTube — SAP Developers playlists, DJ Adams, Johannes Vogt, Simon Engel, Stefan Rudi, Daniel Schlachter, part 5 of 7, Video
Implementation of Observability using OpenTelemetry in SAP BTP
SAP Community, Deepankar, Blog
Evaluate SAP Integration Suite, Advanced Event Mesh Datadog Distributed Tracing
SAP Community, FlorianOkos, Blog
Show 4 more
Configure SAP Integration Suite, Advanced Event Mesh Distributed Tracing
SAP Community, FlorianOkos, Blog
Adding Custom Metrics to a CAP application using cap-js/telementry plugin and SAP Cloud Logging
SAP Community, gopalanand, Blog
Kyma Integration with SAP Cloud Logging. Part 2: Let's ship some traces
SAP Community, gabbi, Blog
SAP Cloud Logging Serviceでコンテナメトリクスを監視する
SAP Community, kyoneo, BlogA recipeRunnable code
CAP in the age of AI #5 - agents wrap-up
YouTube — SAP Developers playlists, DJ Adams, Johannes Vogt, Simon Engel, Stefan Rudi, Daniel Schlachter, part 5 of 7, Video
Kyma Integration with SAP Cloud Logging. Part 2: Let's ship some traces
SAP Community, gabbi, Blog
CAP just got faster: What's new in cds-caching 1.0
SAP Community, Mike Zaschka, BlogThe reasoningA reference
Version drift
Boosting performance in SAP Cloud Application Programming Model (CAP) applications with cds-caching
SAP Community, Mike Zaschka, BlogThe reasoningA recipe
Version drift

Details

Coverage
statecore and community, CAP
assessed
relationshipcore adopted it
also inABAP, BTP/BAIP
Comparison properties3

These are the questions used to compare what the artifacts do. Values come from their documentation and may apply to a particular ecosystem or runtime. Each recorded value in the comparison opens its statement and sources.

SignalsWhere it sends dataInstrumented by
For your agent