All Products
Search
Document Center

Simple Log Service:Trace data formats

Last Updated:Aug 25, 2023

This topic describes the trace data formats that are supported by Simple Log Service.

Simple Log Service is compatible with the trace data formats that are defined in OpenTelemetry Trace 1.0. If trace data is written by using protocols such as OpenTelemetry, Jaeger, Zipkin, OpenCensus, and SkyWalking, Simple Log Service automatically maps the trace data to a data format defined in OpenTelemetry. For other trace data, you can use the data transformation feature to map the data to a data format supported by Simple Log Service.

Raw trace data

Raw trace data is collected to a Logstore named {instance}-traces. The following table describes the fields that are defined when the data is collected.

Field

Type

Required

Description

Example

host

String

No

The hostname of the host where the resource resides. The value is extracted from host.name of the resource field.

test-host

service

String

Yes

The service name of the resource. The value is extracted from service.name of the resource field.

test-service

resource

JSON Object

No

Other resource-related fields. The host and service fields are also resource-related fields. Examples: process ID, process name, and pod name. For more information, see Resource Semantic Conventions.

{"k8s.pod.name":"xxxx", "k8s.pod.namespace":"kube-system"}

otlp.name

String

No

The name of Trace SDK.

go-sdk

otlp.version

String

No

The version of Trace SDK.

v1.0.0

name

String

Yes

The name of the span.

/get/314159

kind

String

No

The type of the span. Examples: CLIENT and SERVER. For more information, see SpanKind.

SERVER

traceID

String

Yes

The ID of the trace. The value is a hexadecimal string.

0123456789abcde0123456789abcde

spanID

String

Yes

The ID of the span. The value is a hexadecimal string.

0123456789abcde

parentSpanID

String

Yes

The ID of the parent span. The value is a hexadecimal string.

0123456789abcde

links

JSON Array

No

The other spans that are associated with the trace data. For more information, see Specifying links.

[{"TraceID" : "abc", "SpanId" : "abc", "TraceState" : "", "Attributes" : { "k" : "v" } }]

logs

JSON Array

No

The log and event information that is associated with the trace data. For more information, see Add Events.

None

traceState

String

No

The trace state, which is defined in the World Wide Web Consortium (W3C) specification. For more information, see W3C Trace Context Specification.

None

start

INT

Yes

The start time. The value is a UNIX timestamp. Unit: nanoseconds.

1686294916826000000

end

INT

No

The end time. The value is a UNIX timestamp. Unit: nanoseconds.

1686294924827000000

duration

INT

Yes

The latency. The value is the difference between the start and end fields. Unit: nanoseconds.

8001000

attribute

JSON Object

Yes

The attribute information about the span, such as the URL and status code of the HTTP request. For more information, see Attribute Naming.

{"custom":"custom","host.hostname":"myhost","my-label":"myapp-type","null-value":"","service.name":"myapp"}

statusCode

String

Yes

The status code of the HTTP request. Valid values: OK, ERROR, and UNSET. The value UNSET is equivalent to the value OK.

ERROR

statusMessage

String

No

The status message of the HTTP request.

stack overflow

Data of call relationships among dimensions

Trace data includes the data of call relationships among dimensions. The data of call relationships is generated after calculation and is stored in a Logstore named {instance}-traces-deps. The following table describes the fields for the data.

Field

Type

Description

version

String

The call relationship among different dimensions. Valid values:

  • service: the call relationship among services.

  • service_name: the call relationship among services and methods.

  • service_name_host: the call relationship among services, methods, and hosts.

  • service_name_host_resource: the call relationship among services, methods, hosts, and resources.

child_host

String

The host information of the callee.

This field is available only if version is service_name_host or service_name_host_resource.

child_name

String

The method of the callee.

This field is available only if version is service_name, service_name_host, or service_name_host_resource.

child_resource

JSON Object

The resource information of the callee.

This field is available only if version is service_name_host_resource.

child_service

String

The service name of the callee.

child_type

JSON Object

The supplementary information of the callee.

inner_percentile

String

The percentile. Simple Log Service uses the inner_percentile function to parse data to obtain the percentile.

max_latency

Double

The maximum latency for calling the method of the service.

min_latency

Double

The minimum latency for calling the method of the service.

n_status_fail

Double

The number of times that the method of the service fails to be called.

n_status_succ

Double

The number of times that the method of the service is successfully called.

parent_host

JSON Array

The host information of the caller.

This field is available only if version is service_name_host or service_name_host_resource.

parent_name

JSON Array

The method of the caller.

This field is available only if version is service_name, service_name_host, or service_name_host_resource.

parent_resource

JSON Object

The resource information of the caller.

This field is available only if version is service_name_host_resource.

parent_service

INT

The service name of the caller.

This field is available only if version is service, service_name, or service_name_host_resource.

parent_type

INT

The supplementary information of the caller.

sum_latency

INT

The cumulative latency for calling the method of the service.

Intermediate result data of aggregated metrics

Trace data includes the intermediate result data of aggregated metrics. The intermediate result data of aggregated metrics is generated after calculation and is stored in a Logstore named {instance}-traces-metrics. The following table describes the fields for the data.

Field

Type

Description

host

STRING

The host value of the span.

inner_percentile

STRING

The percentile. Simple Log Service uses the inner_percentile function to parse data to obtain the percentile.

max_latency

Double

The maximum latency for calling the method of the service.

min_latency

Double

The minimum latency for calling the method of the service.

n_status_fail

INT

The number of times that the method of the service fails to be called.

name

STRING

The name of the span.

resource

JSON Object

The resource information of the span.

service

STRING

The service name of the span.

sum_latency

Double

The cumulative latency for calling the method of the service. In most cases, this field is used together with the total field to calculate the average latency.

total

INT

The total number of times that the method of the service is called.

type

JSON Object

The supplementary information of the span. In most cases, the following items are included:

  • parent: the information about the root node.

  • mq: the message queue (MQ) that is used in the call. If this item is empty, no MQ is used in the call.

  • kind: the type of the span.

  • env: the environment information of the span. The value is extracted from resource.deployment.environment.

  • version: the version of the span. The value is extracted from resource.service.version.

  • db: the database that is used in the call. If this item is empty, no database is used in the call.

version

String

The type of the metric. The value is fixed as metric_info.