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
@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.
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.
@cap-js-community/business-metrics@cap-js-community/business-metricsAn extension of @cap-js/telemetry that turns two CDS annotations into business metrics, a counter on an entity event or action and a gauge on numeric fields.community org, cap turns CDS annotations into counter and gauge metrics, so a business count does not have to be written as OpenTelemetry API calls. cap-ui-telemetrycap-ui-telemetryUI5 frontend performance (FESR) and client error capture for CAP, written as cds.log records and forwarded to SAP Cloud Logging, rather than as OpenTelemetry spans.independent, cap 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-guardcap-mcp-guardA CDS plugin — the trust layer for AI agents accessing SAP CAP business data — request interception, policy enforcement, field masking/pseudonymization, and OpenTelemetry-native observability for MCP-enabled applications.independent, cap adds a span per agent request against the application's own OpenTelemetry SDK, and @sanjay-sde/cap-js-log-control@sanjay-sde/cap-js-log-controlA CAP plugin for controlling CDS logger verbosity and OpenTelemetry DiagLogger noise, reducing log clutter so that real errors surface.independent, cap lowers the diagnostic logging the OTLP exporters produce so real errors stay visible.
Artifacts
Tasks
Count a business event as a metric
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.
@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
See what the browser did before the request arrived
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.
cap-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
See where a slow request spent its time
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.
Send a service's traces and metrics to SAP Cloud Logging
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.
@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
com.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
Content
Show 4 more
Details
Coverage
Comparison properties
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.
For your agent
- Ref
capability:telemetry- JSON
- /capabilities/telemetry.json
- MCP
- Connecting an agent