Skip to content

Conversation

@bradhe
Copy link
Contributor

@bradhe bradhe commented Jun 6, 2025

  • Fix a few latent bugs in telemetry

@bradhe bradhe requested a review from Copilot June 6, 2025 01:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates telemetry logging macros to use a named ctx: parameter and refactors the Context::from_runid constructor to accept &str instead of String.

  • Switch info, warn, and error macros to pass context as ctx: $ctx
  • Change Context::from_runid signature from String to &str and call .to_string()

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
crates/tower-telemetry/src/logging.rs Updated macro invocations to use named ctx: argument
crates/tower-telemetry/src/context.rs Changed from_runid to take &str and call .to_string()
Comments suppressed due to low confidence (2)

crates/tower-telemetry/src/context.rs:8

  • Changing this public API from String to &str is a breaking change; consider using a generic parameter like S: Into<String> so callers can pass either a String or &str without modification.
pub fn from_runid(runid: &str) -> Self {

crates/tower-telemetry/src/logging.rs:42

  • The debug macro still uses positional context parameters; for consistency with info/warn/error, update its event_with_level! invocations to use the named ctx: argument.
macro_rules! debug {

@bradhe bradhe merged commit 277a9b8 into main Jun 6, 2025
20 checks passed
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.

2 participants