본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

CloudEvents 스팬 시맨틱 컨벤션 (Semantic conventions for CloudEvents spans)

원문 보기 위키 갱신

CloudEvents 관련 계측(instrumentation)에서 스팬(span)을 기록할 때 따라야 하는 시맨틱 컨벤션을 소개해요.

출처: 문서

본문

  • 정의 (Definitions)
  • 컨벤션 (Conventions)
  • 스팬 속성 (Span attributes)

정의 (Definitions)

CloudEvents 스펙에서 정의한 내용을 가져오면:

CloudEvents란 서비스, 플랫폼, 시스템 간의 상호 운용성(interoperability)을 제공하기 위해 이벤트 데이터를 공통된 형식으로 표현하는 스펙이에요.

CloudEvents의 개념이나 용어, 배경에 대해 더 자세한 내용이 궁금하다면 CloudEvents Primer 문서를 참고해 주세요.

컨벤션 (Conventions)

CloudEvent 전용 계측(instrumentation)은 메시징 스팬 시맨틱 컨벤션(Semantic Conventions for Messaging Spans)에 설명된 스팬 구조를 따라야 해요(SHOULD).

만약 CloudEvents를 위 컨벤션과 별개로 계측한다면, CloudEvents 분산 추적 확장(CloudEvents Distributed Tracing Extension)을 활용해 트레이스 컨텍스트(trace context)를 전파할 수 있어요.

스팬 속성 (Span attributes)

추가로, 계측은 위 컨벤션에 따라 생성된 스팬에 다음과 같은 CloudEvent 전용 속성들을 기록할 수 있어요.

속성 (Attributes):

Key Stability Requirement Level Value Type Description Example Values
cloudevents.event_id Required string The event_id uniquely identifies the event. 123e4567-e89b-12d3-a456-426614174000; 0001
cloudevents.event_source Required string The source identifies the context in which an event happened. https://github.com/cloudevents; /cloudevents/spec/pull/123; my-service
cloudevents.event_spec_version Recommended string The version of the CloudEvents specification which the event uses. 1.0
cloudevents.event_subject Recommended string The subject of the event in the context of the event producer (identified by source). mynewfile.jpg
cloudevents.event_type Recommended string The event_type contains a value describing the type of event related to the originating occurrence. com.github.pull_request.opened; com.example.object.deleted.v2

더 알아보기 (Learn more)