DataKit 추적 데이터 구조
개요
이 기사는 주류 Telemetry 플랫폼 데이터 구조와 DataKit 플랫폼 데이터 구조와의 매핑 관계를 설명하는 데 사용됩니다.
현재 지원되는 데이터 구조: DataDog/Jaeger/OpenTelemetry/SkyWalking/Zipkin/PinPoint
데이터 변환 단계:
- 외부 추적 데이터 액세스는 여러 데이터 프로토콜을 통해 데이터를 수신한 후 데이터를 역직렬화합니다.
- 역직렬화된 개체는
Line Protocol(라인 프로토콜 형식)로 변환됩니다.
- 스팬 데이터 작업에는 샘플링, 필터링, 특정 태그 추가 및 기타 작업이 포함됩니다.
DataKit Point Protocol 데이터 구조
| Tag |
Description |
container_host |
Host name of container |
endpoint |
End point of resource |
env |
Environment arguments |
http_host |
HTTP host |
http_method |
HTTP method |
http_route |
HTTP route |
http_status_code |
HTTP status code |
http_url |
HTTP URL |
operation |
Operation of resource |
pid |
Process id |
project |
Project name |
service |
Service name |
source_type |
Source types [app/framework/cache/message_queue/custom/db/web/...] |
span_type |
Span types |
status |
Span status |
| Metric |
Description |
Type |
Unit |
create_time |
storage create timestamp |
int |
s |
duration |
Span duration |
int |
us |
message |
Raw data content |
string |
|
parent_id |
Parent ID of span |
string |
|
priority |
priority rules |
string |
|
resource |
Resource of service |
string |
|
span_id |
Span ID |
string |
|
start |
Span start timestamp |
int |
us |
time |
DataKit received timestamp |
int |
ns |
trace_id |
Trace ID |
string |
|
span_type는 Trace에서 현재 Span의 상대 위치입니다. 그 값은 다음과 같이 설명됩니다.
entry: 현재 API는 입구이며, 트레이스가 서비스에 들어간 후 첫 번째 호출입니다.
local: 현재 API는 진입 후 및 퇴장 전의 API입니다.
exit: 현재 API는 트레이스에 대한 서비스의 마지막 호출입니다.
unknown: 현재 API의 상대 위치 상태가 불분명합니다.
priority 클라이언트에 대한 샘플 우선순위 규칙:
PRIORITY_USER_REJECT = -1 사용자가 신고를 거부하기로 선택함
PRIORITY_AUTO_REJECT = 0 클라이언트 샘플러가 보고를 거부하기로 결정했습니다.
PRIORITY_AUTO_KEEP = 1 클라이언트 샘플러 선택 보고서
PRIORITY_USER_KEEP = 2 사용자가 보고를 선택합니다.
OpenTelemetry Tracing 데이터 구조
DataKit이 OTLP(OpenTelemetry Importer)에서 전송된 데이터를 수집할 때 간단한 원시 데이터는 다음과 같이 JSON을 통해 직렬화됩니다.
resource_spans:{
resource:{
attributes:{key:"message.type" value:{string_value:"message-name"}}
attributes:{key:"service.name" value:{string_value:"test-name"}}
}
instrumentation_library_spans:{instrumentation_library:{name:"test-tracer"}
spans:{
trace_id:"\x94<\xdf\x00zx\x82\xe7Wy\xfe\x93\xab\x19\x95a"
span_id:".\xbd\x06c\x10ɫ*"
parent_span_id:"\xa7*\x80Z#\xbeL\xf6"
name:"Sample-0"
kind:SPAN_KIND_INTERNAL
start_time_unix_nano:1644312397453313100
end_time_unix_nano:1644312398464865900
status:{}
}
spans:{
...
}
}
OpenTelemetry에서 resource_spans와 DKProto 간의 대응 관계는 다음과 같습니다.
| Field Name |
Data Type |
Unit |
Description |
Correspond To |
| trace_id |
[16]byte |
|
Trace ID |
DKProto.TraceID |
| span_id |
[8]byte |
|
Span ID |
DKProto.SpanID |
| parent_span_id |
[8]byte |
|
Parent Span ID |
DKProto.ParentID |
| name |
string |
|
Span Name |
DKProto.Operation |
| kind |
string |
|
Span Type |
DKProto.SpanType |
| start_time_unix_nano |
int64 |
나노초 |
기간 시작 시간 |
DKProto.Start |
| end_time_unix_nano |
int64 |
나노초 |
스팬 만료 시간 |
DKProto.Duration = end - start |
| status |
string |
|
Span Status |
DKProto.Status |
| name |
string |
|
resource Name |
DKProto.Resource |
| resource.attributes |
map[string]string |
|
리source 태그 |
DKProto.tags.service, DKProto.tags.project, DKProto.tags.env, DKProto.tags.version, DKProto.tags.container_host, DKProto.tags.http_method, DKProto.tags.http_status_code |
| span.attributes |
map[string]string |
|
스팬 태그 |
DKProto.tags |
OpenTelemetry에는 몇 가지 고유한 필드가 있지만 DKProto에는 이에 해당하는 필드가 없으므로 레이블에 배치됩니다. 다음과 같이 값이 0이 아닌 경우에만 표시됩니다.
| Field |
Date Type |
Uint |
Description |
Correspond |
| span.dropped_attributes_count |
int |
|
Span 삭제된 태그의 개수 |
DKProto.tags.dropped_attributes_count |
| span.dropped_events_count |
int |
|
삭제된 이벤트의 span 수 |
DKProto.tags.dropped_events_count |
| span.dropped_links_count |
int |
|
Span 삭제된 연결 수 |
DKProto.tags.dropped_links_count |
| span.events_count |
int |
|
스팬 관련 이벤트 수 |
DKProto.tags.events_count |
| span.links_count |
int |
|
스팬과 연결된 스팬 수 |
DKProto.tags.links_count |
Jaeger Tracing 데이터 구조
Jaeger Thrift Protocol의 Batch 데이터 구조
| Field Name |
Data Type |
Unit |
Description |
Correspond to |
| Process |
struct pointer |
|
프로세스 관련 데이터 구조 |
DKProto.Service |
| SeqNo |
int64 pointer |
|
일련번호 |
해당 관계 DKProto에 연결하지 마십시오 |
| Spans |
array |
|
스팬 배열 구조 |
아래 표를 참조하세요 |
| Stats |
struct pointer |
|
클라이언트 통계 구조 |
DKProto와 직접적으로 일치하지 않습니다. |
Jaeger Thrift Protocol의 Span 데이터 구조
| Field Name |
Data Type |
Unit |
Description |
Correspond To |
| TraceIdHigh |
int64 |
|
Trace ID 및 TraceIdLow의 상위 비트가 Trace ID를 형성합니다. |
DKProto.TraceID |
| TraceIdLow |
int64 |
|
추적 ID 낮은 비트 및 TraceIdHigh는 추적 ID를 형성합니다. |
DKProto.TraceID |
| ParentSpanId |
int64 |
|
Parent Span ID |
DKProto.ParentID |
| SpanId |
int64 |
|
Span ID |
DKProto.SpanID |
| OperationName |
string |
|
이 Span을 생성하는 메소드 이름 |
DKProto.Operation |
| Flags |
int32 |
|
Span Flags |
DKProto와 직접적으로 일치하지 않습니다. |
| Logs |
array |
|
Span Logs |
DKProto와 직접적으로 일치하지 않습니다. |
| References |
array |
|
Span References |
DKProto와 직접적으로 일치하지 않습니다. |
| StartTime |
int64 |
나노초 |
기간 시작 시간 |
DKProto.Start |
| Duration |
int64 |
나노초 |
시간이 많이 걸린다 |
DKProto.Duration |
| Tags |
array |
|
Span 태그는 현재 Span 상태 필드만 사용합니다. |
DKProto.Status |
SkyWalking Tracing Data 데이터 구조
Segment Object Generated By Protobuf Protocol V3
| Field Name |
Data Type |
Unit |
Description |
Correspond To |
| TraceId |
string |
|
Trace ID |
DKProto.TraceID |
| TraceSegmentId |
string |
|
세그먼트 ID와 스팬 ID를 함께 사용하여 스팬을 고유하게 식별합니다. |
DKProto.SpanID 상위 비트 |
| Service |
string |
|
서비스 이름 |
DKProto.Service |
| ServiceInstance |
string |
|
노드 논리적 관계 이름 |
사용되지 않은 필드 |
| Spans |
array |
|
추적 span 배열 |
아래 표를 참조하세요 |
| IsSizeLimited |
bool |
|
트레이스에 모든 스팬을 포함할지 여부 |
사용되지 않은 필드 |
Segment Object 내 SkyWalking Span Object 데이터 구조
| Field Name |
Data Type |
Unit |
Description |
Correspond To |
| ComponentId |
int32 |
|
타사 프레임워크의 수치적 정의 |
사용되지 않은 필드 |
| Refs |
array |
|
스레드와 프로세스 전반에 걸쳐 상위 세그먼트 저장 |
DKProto.ParentID 상위 비트 |
| ParentSpanId |
int32 |
|
상위 스팬 ID는 세그먼트 ID와 함께 상위 스팬을 고유하게 식별하는 데 사용됩니다. |
DKProto.ParentID 낮은 비트 |
| SpanId |
int32 |
|
Span ID와 Segment ID는 Span을 고유하게 식별하는 데 함께 사용됩니다. |
DKProto.SpanID 낮은 비트 |
| OperationName |
string |
|
Span Operation Name |
DKProto.Operation |
| Peer |
string |
|
통신 피어 |
DKProto.Endpoint |
| IsError |
bool |
|
스팬 상태 필드 |
DKProto.Status |
| SpanType |
int32 |
|
스팬 유형 수치 정의 |
DKProto.SpanType |
| StartTime |
int64 |
밀리초 |
기간 시작 시간 |
DKProto.Start |
| EndTime |
int64 |
밀리초 |
Span 종료 시간과 StartTime을 빼면 소요된 시간을 나타냅니다. |
DKProto.Duration |
| Logs |
array |
|
Span Logs |
사용되지 않은 필드 |
| SkipAnalysis |
bool |
|
백엔드 분석 건너뛰기 |
사용되지 않은 필드 |
| SpanLayer |
int32 |
|
Span 기술 스택의 수치적 정의 |
사용되지 않은 필드 |
| Tags |
array |
|
Span Tags |
사용되지 않은 필드 |
Zipkin Tracing Data 데이터 구조
Zipkin Thrift Protocol의 Span V1 데이터 구조
| Field Name |
Data Type |
Unit |
Description |
Correspond To |
| TraceIDHigh |
uint64 |
|
추적 ID 상위 비트 |
직접적인 서신 없음 |
| TraceID |
uint64 |
|
Trace ID |
DKProto.TraceID |
| ID |
uint64 |
|
Span ID |
DKProto.SpanID |
| ParentID |
uint64 |
|
Parent Span ID |
DKProto.ParentID |
| Annotations |
array |
|
서비스 이름 가져오기 |
DKProto.Service |
| Name |
string |
|
Span Operation Name |
DKProto.Operation |
| BinaryAnnotations |
array |
|
Span 상태 필드 가져오기 |
DKProto.Status |
| Timestamp |
uint64 |
마이크로초 |
기간 시작 시간 |
DKProto.Start |
| Duration |
uint64 |
마이크로초 |
스팬에는 시간이 걸립니다 |
DKProto.Duration |
| Debug |
bool |
|
디버그 상태 필드 |
사용되지 않은 필드 |
Zipkin Span V2 데이터 구조
| Field Name |
Data Type |
Unit |
Description |
Correspond To |
| TraceID |
struct |
|
Trace ID |
DKProto.TraceID |
| ID |
uint64 |
|
Span ID |
DKProto.SpanID |
| ParentID |
uint64 |
|
Parent Span ID |
DKProto.ParentID |
| Name |
string |
|
Span Operation Name |
DKProto.Operation |
| Debug |
bool |
|
디버그 상태 |
사용되지 않은 필드 |
| Sampled |
bool |
|
샘플링 상태 필드 |
사용되지 않은 필드 |
| Err |
string |
|
Error Message |
DKProto와 직접적으로 일치하지 않습니다. |
| Kind |
string |
|
Span Type |
DKProto.SpanType |
| Timestamp |
struct |
마이크로초 |
마이크로초 시간 구조는 Span 시작 시간을 나타냅니다. |
DKProto.Start |
| Duration |
int64 |
마이크로초 |
스팬에는 시간이 걸립니다 |
DKProto.Duration |
| Shared |
bool |
|
공유 상태 |
사용되지 않은 필드 |
| LocalEndpoint |
struct |
|
서비스 이름을 가져오는 데 사용됩니다. |
DKProto.Service |
| RemoteEndpoint |
struct |
|
통신 피어 |
DKProto.Endpoint |
| Annotations |
array |
|
지연 시간 관련 이벤트를 설명하는 데 사용됩니다. |
사용되지 않은 필드 |
| Tags |
map |
|
Span 상태를 가져오는 데 사용됩니다. |
DKProto.Status |