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

Code

원문 보기 위키 갱신

이 속성들은 소스 코드에 대한 컨텍스트를 제공해요.

출처: 문서

본문

  • 코드 속성(Code Attributes)
  • 더 이상 사용되지 않는 코드 속성(Deprecated Code Attributes)

코드 속성(Code Attributes)

이 속성들은 소스 코드에 대한 컨텍스트를 제공해요.

Attributes: | | Key | Stability | Value Type | Description | Example Values

| code.column.number | | int | The column number in code.file.path best representing the operation. It SHOULD point within the code unit named in code.function.name. This attribute MUST NOT be used on the Profile signal since the data is already captured in ‘message Line’. This constraint is imposed to prevent redundancy and maintain data integrity. | 16

| code.file.path | | string | The source code filename that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute MUST NOT be used on the Profile signal since the data is already captured in ‘message Function’. This constraint is imposed to prevent redundancy and maintain data integrity. | /usr/local/MyApplication/content_root/app/index.php

| code.function.name | | string | The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within code.stacktrace attribute value. This attribute MUST NOT be used on the Profile signal since the data is already captured in ‘message Function’. This constraint is imposed to prevent redundancy and maintain data integrity. [1] | com.example.MyHttpService.serveRequest; GuzzleHttp\Client::transfer; fopen

| code.line.number | | int | The line number in code.file.path best representing the operation. It SHOULD point within the code unit named in code.function.name. This attribute MUST NOT be used on the Profile signal since the data is already captured in ‘message Line’. This constraint is imposed to prevent redundancy and maintain data integrity. | 42

| code.stacktrace | | string | A stacktrace as a string in the natural representation for the language runtime. The representation is identical to exception.stacktrace. This attribute MUST NOT be used on the Profile signal since the data is already captured in ‘message Location’. This constraint is imposed to prevent redundancy and maintain data integrity. | at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\n at com.example.GenerateTrace.main(GenerateTrace.java:5)

[1] code.function.name: Values and format depends on each language runtime, thus it is impossible to provide an exhaustive list of examples. 이 값들은 보통 네이티브 스택 트레이스 표현에 저장된 값과 같거나 그 접두어예요. code.stacktrace without information on arguments.

예시:

  • Java 메서드: com.example.MyHttpService.serveRequest
  • Java 익명 클래스 메서드: com.mycompany.Main$1.myMethod
  • Java 람다 메서드: com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod
  • PHP 함수: GuzzleHttp\Client::transfer
  • Go 함수: github.com/my/repo/pkg.foo.func5
  • Elixir: OpenTelemetry.Ctx.new
  • Erlang: opentelemetry_ctx:new
  • Rust: playground::my_module::my_cool_func
  • C 함수: fopen

더 이상 사용되지 않는 코드 속성(Deprecated Code Attributes)

이 더 이상 사용되지 않는 속성들은 소스 코드에 대한 컨텍스트를 제공해요.

Attributes: | | Key | Stability | Value Type | Description | Example Values

| code.column | Replaced by code.column.number. | int | Deprecated, use code.column.number | 16

| code.filepath | Replaced by code.file.path. | string | Deprecated, use code.file.path instead | /usr/local/MyApplication/content_root/app/index.php

| code.function | Value should be included in code.function.name which is expected to be a fully-qualified name. | string | Deprecated, use code.function.name instead | serveRequest

| code.lineno | Replaced by code.line.number. | int | Deprecated, use code.line.number instead | 42

| code.namespace | Value should be included in code.function.name which is expected to be a fully-qualified name. | string | Deprecated, namespace is now included into code.function.name | com.example.MyHttpService