Skip to content

fix(append-opentelemetry): emit code.module.name instead of code.function.name - #337

Merged
tisonkun merged 3 commits into
mainfrom
fix/otel-module-path
Dec 3, 2026
Merged

tisonkun merged 3 commits into
mainfrom
fix/otel-module-path

Conversation

@tisonkun

@tisonkun tisonkun commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Emit Record::module_path under the "code.module.name" attribute key instead of "code.function.name" in logforth-append-opentelemetry, keeping all four source-location attributes under the code.* namespace (code.module.name, code.file.path, code.line.number, and code.column.number).
  • Update appenders/opentelemetry/README.md, CHANGELOG.md, and OpenTelemetry integration tests.

Context

Rust compile-time logging callsites (core::module_path!()) only know the module path, never the enclosing function or method name. Emitting module paths under code.function.name conflates distinct functions within the same module when backends aggregate by code.function.name, while code.namespace is deprecated and does not follow Semantic Conventions' <object>.<property> naming model.

Upstream tracking issues:

Test Plan

  • cargo x check
  • cargo x test
  • cargo x lint

…name

Rust compile-time logging callsites only expose `module_path!()`, not the enclosing function or method name. Recording a module path under `code.function.name` conflates distinct functions in the same module when backends aggregate by `code.function.name` (tracked upstream in open-telemetry/opentelemetry-rust#3896 and open-telemetry/semantic-conventions#4440).

Emit `Record::module_path` under `module_path` while retaining `code.file.path`, `code.line.number`, and `code.column.number` for file, line, and column metadata.

Signed-off-by: tison <wander4096@gmail.com>
Emit `Record::module_path` under `code.module.name` alongside `code.file.path`, `code.line.number`, and `code.column.number`, matching the three-segment `code.<object>.<property>` Semantic Conventions naming model proposed in open-telemetry/semantic-conventions#4440.

Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun changed the title fix(append-opentelemetry): emit module_path instead of code.function.name fix(append-opentelemetry): emit code.module.name instead of code.function.name Dec 3, 2026
@tisonkun
tisonkun merged commit 7f98305 into main Dec 3, 2026
10 checks passed
@tisonkun
tisonkun deleted the fix/otel-module-path branch December 3, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant