Skip to content

Conversation

@sammuti
Copy link
Contributor

@sammuti sammuti commented Feb 3, 2026

Add runner-id to telemetry as a mandatory part of telemetry context to understand issues

@sammuti sammuti requested review from bradhe and Copilot February 3, 2026 19:38
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 adds a mandatory runner_id field to the telemetry context to help identify and diagnose issues by tracking which runner instance is executing a run.

Changes:

  • Modified the telemetry Context struct to require a runner_id parameter
  • Updated the logging macro to include runner_id in all telemetry events
  • Refactored the Context API with a builder pattern (new()with_runid())

Reviewed changes

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

Show a summary per file
File Description
crates/tower-telemetry/src/context.rs Added mandatory runner_id field and refactored API to use builder pattern
crates/tower-telemetry/src/logging.rs Updated logging macro to emit runner_id in all telemetry events
crates/tower-cmd/src/run.rs Updated CLI to use new Context API with "local-runner" identifier
crates/tower-runtime/tests/subprocess_test.rs Updated test to provide required runner_id parameter
crates/tower-runtime/tests/local_test.rs Updated all test cases to provide required runner_id parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ExecutionSpec {
id,
telemetry_ctx: tower_telemetry::Context::new(),
telemetry_ctx: tower_telemetry::Context::new("runner-id".to_string()),
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The hardcoded test value 'runner-id' is ambiguous. Consider using a more descriptive identifier like 'test-subprocess-runner' to clearly indicate this is a test context.

Suggested change
telemetry_ctx: tower_telemetry::Context::new("runner-id".to_string()),
telemetry_ctx: tower_telemetry::Context::new("test-subprocess-runner".to_string()),

Copilot uses AI. Check for mistakes.
// We need to create the package, which will load the app
let opts = StartOptions {
ctx: tower_telemetry::Context::new(),
ctx: tower_telemetry::Context::new("runner-id".to_string()),
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The hardcoded test value 'runner-id' is ambiguous and repeated across multiple tests. Consider using a more descriptive identifier like 'test-local-runner' or defining a test constant to maintain consistency.

Copilot uses AI. Check for mistakes.
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