ARMS provides a Grafana Tempo-compatible HTTP API that supports standard Tempo API endpoints and TraceQL query syntax.
Compatibility
Grafana Tempo is an open-source distributed tracing backend that stores trace data from OpenTelemetry, Jaeger, Zipkin, and other protocols in Object Storage Service (OSS) and provides high-performance query services at scale.
The ARMS Tempo-compatible HTTP API translates TraceQL queries into Simple Log Service index-based and SQL analysis syntax. Simple Log Service returns results in a Grafana Tempo-compatible format.
Tempo-compatible API endpoints
The Tempo-compatible API endpoint format is https://${sls-endpoint}/trace/tempo/, where ${sls-endpoint} is the Simple Log Service endpoint for your trace data region. Example: https://cn-hangzhou.log.aliyuncs.com/trace/tempo.
Supported regions:
|
Region |
Region ID |
|
Hangzhou |
cn-hangzhou |
|
Beijing |
cn-beijing |
|
Ulanqab |
cn-wulanchabu |
|
Heyuan |
cn-heyuan |
|
Singapore |
ap-southeast-1 |
|
Kuala Lumpur |
ap-southeast-3 |
For information about the corresponding endpoints, see Endpoint.
Supported Tempo-compatible APIs
Supported GET request paths:
|
API path |
Description |
|
/api/traces/<traceID> |
Queries trace details. |
|
/api/v2/traces/<traceID> |
Queries trace details (Tempo API V2). |
|
/api/search |
Lists traces with search criteria. |
|
/api/search/tags |
Gets available tag keys. |
|
/api/v2/search/tags |
Gets available tag keys (Tempo API V2). |
|
/api/search/tag/{tags}/values |
Queries tag values. |
|
/api/v2/search/tag/{tags}/values |
Queries tag values (Tempo API V2). |
|
/ready |
Checks service availability. |
|
/api/echo |
Validates Tempo data source connectivity. |
Supported TraceQL syntax
Keywords
|
Category |
Field |
Description |
Example |
|
Span |
status |
Status. Valid values:
|
status=ok |
|
statusMessage |
Status message. |
statusMessage="404 NOT FOUND" |
|
|
duration |
The span duration. You can specify a unit. Otherwise, the default
|
duration > 500 ms |
|
|
name |
Span name, mapped to |
name="/components/api/v1/mall/product" |
|
|
kind |
The span type. Valid values:
|
kind=server |
|
|
spanId |
Span ID. |
spanId=fe81595a906fe2a4 |
|
|
Trace |
traceDuration |
Total trace duration. |
traceDuration > 100 ms |
|
traceId |
Trace ID. |
traceId="ea1a0100f617397599186332534d0001" |
|
|
Attribute |
Fields that start with
|
Span attributes, mapped to |
span.http.path="/api/search" |
|
Resource |
Fields that start with
|
Resource attributes, mapped to |
resource.namespace="arms" |
|
Unscoped Attribute |
Fields that start with
|
Unscoped attributes, mapped to |
.db.statement="select * from log" |
Operators
|
Category |
Operator |
Description |
Example |
|
Span selector |
{expression} |
The expression must be enclosed in |
{status=ok} |
|
Comparison operators |
= |
Equal to |
{name="/components/api/v1/mall/product"} |
|
!= |
Not equal to |
{resource.service.name!="mall-gateway"} |
|
|
=~ |
Regex match |
{resource.service.name=~"mall-gateway|mall-client"} |
|
|
!~ |
Regex negation |
{service!~"mall-gateway|mall-client"} |
|
|
> |
Greater than |
{duration>500 ms} |
|
|
>= |
Greater than or equal to |
{duration>=500 ms} |
|
|
< |
Less than |
{duration<1s} |
|
|
<= |
Less than or equal to |
{duration<=1s} |
|
|
Logical operators |
{condA && condB} |
AND |
{ span.http.status_code >= 200 && span.http.status_code < 300 } |
|
{condA || condB} |
OR |
{name="/components/api/v1/mall/product" || resource.service.name="mall-gateway"} |
Grant permissions to a RAM user
Grant a RAM user query or write access to the Tempo-compatible API using one of these methods:
-
Simple mode: system policies, no custom configuration
-
Custom mode: fine-grained access control with custom policies
Simple mode
Attach system policies to grant required permissions to a RAM user. No custom configuration required.
Available system policies:
|
System policy |
Query permission |
Write permission |
|
AliyunLogFullAccess |
Yes |
Yes |
|
AliyunLogReadOnlyAccess |
Yes |
No |
Custom mode
Create a custom policy to grant a RAM user the permissions to query or write data through the Tempo-compatible API.
Sample policy:
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"log:GetIndex",
"log:GetLogStoreContextLogs",
"log:ListLogStores",
"log:GetLogStoreHistogram",
"log:GetLogstoreLogs",
"log:GetLogStoreContextLogs",
"log:GetCursorOrData",
"log:GetLogstore"
],
"Resource": "acs:log:*:*:project/*"
}
]
}