Raw Data Outbound Traces API

Introduction

The SAP Cloud ALM Raw Data Outbound Traces API is used to read traces produced by the different SAP Cloud ALM monitoring use-cases with the OpenTelemetry format in PULL mode. This API can be used to integrate data from an open source, an in-house tool, or a third-party tool by exporting SAP Cloud ALM data in the OTel format.

The number of traces records returned by the API depends on the time period and time filter parameters used during the API calls.

The following traces data providers are supported:

Traces Providers

SAP Cloud ALM Monitoring Use Cases

rum

Real User Monitoring

Data Protection and Privacy

The SAP Cloud ALM API Raw Data Outbound Traces can return personal and sensitive data which must not be accessed or stored without technical and organizational measures to safeguard data protection and privacy.

Check the following guide for more information: https://help.sap.com/docs/cloud-alm/setup-administration/data-protection-privacy

Type

PULL API

URL Format

Traces data are retrieved from SAP Cloud ALM via a dedicated HTTP API end-point: https://<tenant name>.<provider name>/api/calm-traces/v1/traces

Documentation

Trace data are retrieved from SAP Cloud ALM via an HTTP API end-point documented in the SAP API HUBInformation published on SAP site.

Operations

  • GET /traces

    • calm-traces/v1/traces GET

Authorizations

Access to the traces API require the following security scopes:

Security Scope

Descriptions

calm-api.traces.read

Mandatory security scope to access any CALM traces

calm-api.rum.read

To access Real User Monitoring use case data

calm-api.rum.personal.read

To read trace in Real User Monitoring use case.

This security scope is necessary to allow extraction of data that could contain personal and sensitive data.

A request without security scope authorization always receives an authorization exception (HTTP 403).

Examples

The following call demonstrates an access to the "Real User Monitoring" for the last 5 minutes with a filter on service id.

https://{{HOST}}/api/calm-traces/v1/traces?provider=rum&format=protobuf-json&serviceId=bfcd7461-8f46-4822-87e9-248e4c3ed270&period=5M&limit=10&onLimit=ERROR

API Details

The SAP Cloud ALM Raw Data Outbound Traces accepts the following parameters

Query parameters

Name

Description

Comments

format

Expected output format of the traces API. You can select between text, protobuf-binary, or protobuf-json format.

Supported values:
  • protobuf-binary

  • protobuf-json

String

Default: protobuf-binary

provider

The traces data provider accessed though the traces API.

Supported values:
  • rum

String

Mandatory

version

Version of the traces provider.

String

Example: v1

Default

Oldest non-deprecated version.

period

Semantic period to collect. This parameter can be used instead of parameters “from” and “to”; it is converted to “from” and “to”. Parameter “to” is set to Now, where 'Now' is the current UTC unix time on SAP Cloud ALM side, and parameter “from” is calculated by subtracting “period” to parameter “to”. If parameters “to” and/or “from” are provided in addition to “period”, an error is returned (incompatible parameters “from”/”to” and “period”).

Possible values: <X>M, where X is in [1,30].

String

Default: 5M

from

UTC timestamp indicating the beginning of the collection period. The largest possible period to collect is 30 minutes; if the period (from/to) goes above 30 minutes, an error is returned. Caution: “from” timestamp is inclusive.

Optional

Format: YYYYMMDDHHmmss

to

UTC timestamp indicating the end of the collection period. The oldest timestamp accepted for parameter “to” is defined by the traces provider, if “to” goes beyond this limit, an error should be returned by the traces provider. If “to” is not provided or if “to” value is in the future, the newest trace records until Now are returned. Caution: “to” is exclusive.

Optional

Format: YYYYMMDDHHmmss

<filters>

Traces Records filters are passed as URL parameter.

The list of filters depends on the Traces Data Provider. See next chapter for a description of filters per traces data providers.

Optional

limit

Pagination support. Maximum number of trace records to return. Minimum value is 1, maximum value is 1000.

Default: 100

offset

Pagination support. Number of trace records to skip. If the offset goes beyond the total number of trace records available, then no trace records are returned (no error).

Default: 0

onLimit

Indicates what to do if the number of records goes above the maximum limit (parameter “limit”). Possible values are: ERROR (return an error), TRUNCATE: truncate the response.

Default: ERROR

Filters Real User Monitoring - The table below describes the filters available for Real User Monitoring.

Filter Name

Description

Comment

serviceId

LMS service Id

Mandatory

request

Request name

Optional

requestType

Type of request:
  • SAP_UI5

  • DIAG

  • HTTP

  • SAP_ITS

  • RFC

  • SAP_WDA

  • HTTPS

  • RFCS

  • WS

  • WEB_UI

  • DB

  • BATCH

  • CODE

Optional

user

User name of the request.

Optional

Status Codes The following status codes apply to this HTTP action.

Status Code

Description

202

Data accepted

400

Structure of the request is invalid

Unknown parameter “XYZ”

Parameters “from”/”to” and “period” are incompatible

Parameter XYZ has an unsupported value “XYZ”, you can use…

403

Authentication failure. Security scope is missing

404

The request path is incorrect

Unknown use-case "XYZ"

Unknown use-case version "X"

Service "XYZ" not found

408

The request took too long to reach the endpoint.

413

The payload was too big. 

428

Pre-condition not full filled

429

The request rate quota has been exceeded.

500

Internal Server Error

502

Bad Gateway

503

Service Unavailable

504

Gateway Timeout

Response Headers

Header

Description

x-total-count

Total number of traces spans. Returned only if parameter "onLimit" = "TRUNCATE"

Response Body Example

Limitations

The following rules apply when accessing the SAP Cloud ALM Traces API.
  • Throughput

    • Maximum 100 requests per minute

  • Limits

    • Maximum time series per response: 1000. (HTTP Error Code 403 + Error Message)

Models Mapping

Known Restrictions
  • The json protobuf encoding does not support the deviations described https://opentelemetry.io/docs/specs/otlp/#json-protobuf-encodingInformation published on non-SAP site ; to manage correlation id use the protobuf binary format. With protobuf json format, spanId and traceId are base-64-encoded and not case-insensitive-hex-encoded-strings.

  • Real User Monitoring: only non aggregated spans are returned by the interface.

This section details how the SAP Cloud ALM data model is mapped to the OTLP data model.
  • Some mapping rules are common to all scenarios (see section Common mapping).

  • Some mapping rules are specific to each scenario (see dedicated scenario mapping tables).

Common Mapping

SAP Cloud ALM (source)

OTLP (target)

Comments

Service name

resourceTraces / resource / attribute / service.name

Required

Service type

resourceTraces / resource / attribute / service.namespace

Optional

  • externalId for Cloud Service

  • systemNumber for Technical System

resourceTraces / resource / attribute / service.instance.id

Optional

Service description

resourceTraces / resource / attribute / sap.service.display_name

Optional

SAP Extension

resourceTraces / resource / attribute / telemetry.sdk.name

Depends on data source

resourceTraces / resource / attribute / telemetry.sdk.language

Depends on data source

resourceTraces / resource / attribute / telemetry.sdk.version

Depends on data source

Real User Monitoring mapping

In addition to the common mapping rules, the table below describes the mapping rules specific to Real User Monitoring scenario.

Resource Attributes

SAP Cloud ALM (source)

OTLP (target)

Comments

Browser version

resourceTraces / resource / attribute / browser.mobile

Optional

Browser version

resourceTraces / resource / attribute / browser.brands

Optional

Client operating system version

resourceTraces / resource / attribute / os.name

Optional

Client operating system version

resourceTraces / resource / attribute / os.version

Optional

Client operating system version

resourceTraces / resource / attribute / os.type

Optional

Trace Span

Real User Monitoring Object

OTLP Span

Comment

MeasuredAt + MeasuredAtMs + responseTime

end_time_unix_nano

Required

MeasuredAt + MeasuredAtMs

start_time_unix_nano

Required

Depends on direction and requestType

kind

 

Name1

name

Required

Mapped as defined in W3C mapping.

parent_span_id

 

Mapped as defined in W3C mapping.

span_id

Required

status

 

Mapped as defined in W3C mapping.

trace_id

Required

trace_state

 
Trace Span Attributes

Real User Monitoring Object

OTLP Span

Comment

RequestType

sap.calm.request_type

Optional

UserName

enduser.id

Optional

Name2

http.request.method

Optional. Only present for HTTP calls

SentBytes

http.request.body.size

Optional

SAP Passport

http.request.header.sap.passport

Optional

ReceivedBytes

http.response.body.size

Optional

StatusCode

http.response.status_code

Optional

Name1

messaging.destination.name

Optional. Only present for messaging

Name2

messaging.operation

Optional. Only present for messaging

CpuTime

process.cpu.time

Optional

Memory

process.memory.usage

Optional

Name1

rpc.method

Optional. Only present for ABAP RFC

"ABAP"

rpc.system

Optional. Only present for ABAP RFC

Instance

server.address

Optional

Name1

url.full

Optional. Fallback for unknown request types

Name1

url.path

Optional. Only present for HTTP calls

WaitTime

waitTime

Optional

Ip

client.address

Optional

Destination

db.connection_string

Optional

Phrase

error.type

Optional. Only present if http.response.status.code >= 400

"device"|"browser"

event.domain

Optional. Only present for frontend spans

NetworkTime

networkTime

Optional. Only present for frontend spans

SAP Passport

passport

Optional

ReceivedBytes

receivedBytes

Optional

SentBytes

sentBytes

Optional

SrvRoundTripTime

serverRoundTripTime

Optional. Only present for frontend spans

RoundTrips

numberOfRoundTrips

Optional. Only present for frontend spans