GraphQL 서버 스팬 시맨틱 컨벤션 (Semantic conventions for GraphQL server spans)
GraphQL 서버 구현에 들어오는 요청(operation)을 나타내는 스팬에서 따라야 하는 시맨틱 컨벤션을 소개해요.
출처: 문서
본문
이 스팬은 GraphQL 서버 구현에서 들어오는 하나의 작업(operation)을 나타내요.
스팬 이름은 graphql.operation.type를 사용할 수 있을 때
{graphql.operation.type} 형식을 따라야 해요(SHOULD). graphql.operation.type을 사용할 수 없다면
스팬 이름은 GraphQL Operation으로 지어야 해요(SHOULD).
경고 (Warning)
graphql.operation.name 값은 클라이언트가 제공하는 값으로 카디널리티(cardinality)가
높을 수 있어요. 이 값을 (기본적으로) GraphQL 서버 스팬 이름에 사용하는 것은
권장되지 않아요(NOT RECOMMENDED).
계측은 graphql.operation.name을 사용할 수 있을 때 {graphql.operation.type} {graphql.operation.name} 형식의
더 설명적인 스팬 이름을 활성화하는 구성 옵션을 제공할 수 있어요(MAY).
스팬 종류(kind)는 SERVER여야 해요(SHOULD).
스팬 상태(status)는 오류 기록(Recording Errors) 문서를 따라야 해요(SHOULD).
속성 (Attributes):
| Key | Stability | Requirement Level | Value Type | Description | Example Values |
|---|---|---|---|---|---|
graphql.operation.name |
Recommended |
string | The name of the operation being executed. | findBookById |
|
graphql.operation.type |
Recommended |
string | The type of the operation being executed. | query; mutation; subscription |
|
graphql.document |
Opt-In |
string | The GraphQL document being executed. [1] | query findBookById { bookById(id: ?) { name } } |
[1] graphql.document: 계측이 민감한 정보를 안정적으로 식별하고 삭제(redact)할 수 있다면 그렇게 해야 해요(SHOULD).
graphql.operation.type에는 다음과 같은 잘 알려진 값 목록이 있어요. 그중 하나에 해당한다면
반드시 해당 값을 사용해야 하고(MUST), 그렇지 않으면 사용자 정의 값을 사용할 수 있어요(MAY).
| Value | Description | Stability |
|---|---|---|
mutation |
GraphQL mutation | |
query |
GraphQL query | |
subscription |
GraphQL subscription |