Skip to content

Use #[track_caller] on log/trace helpers #1618

@Mirko-von-Leipzig

Description

@Mirko-von-Leipzig

Trace, spans and logs automatically fill in the current code file path and line numbers. This is great but if we're using a helper function this allocates the helper functions details instead of the caller.

For example, all our gRPC spans are created by our helper trace function and get

code.file.path  crates/utils/src/tracing/grpc.rs

which is less than helpful. Adding #[track_caller] would assign a more correct location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    telemetryRelates to tracing and open-telemetry

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions