Code attributes semantic convention stability migration guide

The experimental code.* semantic conventions were promoted to stable in v1.33.0. This guide outlines the breaking changes and offers migration guidance for instrumentations and telemetry backends adopting the stable attributes.

Instrumentation authors MAY use the standard OTEL_SEMCONV_STABILITY_OPT_IN migration approach. When used, it should support the code and code/dup values.

Summary of changes

This section summarizes the changes made to the code attribute semantic conventions from v1.29.0 to v1.33.0.

ChangeComments
code.linenocode.line.number
code.columncode.column.number
code.filepathcode.file.path
code.namespaceRemoved, integrated into code.function.name
code.functionRemoved, integrated into code.function.name
New: code.function.nameSee definition and examples below

code.function.name is defined as follows:

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.

Examples:

  • Java method: com.example.MyHttpService.serveRequest
  • Java anonymous class method: com.mycompany.Main$1.myMethod
  • Java lambda method: com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod
  • PHP function: GuzzleHttp\Client::transfer
  • Go function: github.com/my/repo/pkg.foo.func5
  • Elixir: OpenTelemetry.Ctx.new
  • Erlang: opentelemetry_ctx:new
  • Rust: playground::my_module::my_cool_func
  • C function: fopen