Summary
Add observability to the installation-token acquisition code path in src/github/installation_token.rs using the tracing crate, which is already a project dependency.
Motivation
The installation-token acquisition code lacks logging at critical operational boundaries. Without instrumentation, diagnosing production failures (e.g. buffer rejections, API errors) requires code-level investigation rather than log inspection.
Proposed change
- Add
#[instrument] to installation_token_with_buffer and installation_token_with_factory (and installation_token_with_client_and_time if appropriate).
- Emit
tracing::info! on successful token acquisition (including expiry timestamp, excluding token secret).
- Emit
tracing::warn! when a token is rejected due to the expiry buffer.
- Emit
tracing::error! on acquisition failure, including the mapped GitHubError variant.
- Document the expected operational signals (log levels, fields) in
docs/developers-guide.md.
Acceptance criteria
- All async entry points carry
#[instrument] (with skip for sensitive fields as appropriate).
- At minimum, info/warn/error events are emitted at the three points listed above.
- Developer documentation is updated.
make check-fmt, make lint, and make test all pass.
Background
Identified during review of PR #77 (requested by @leynos).
Summary
Add observability to the installation-token acquisition code path in
src/github/installation_token.rsusing thetracingcrate, which is already a project dependency.Motivation
The installation-token acquisition code lacks logging at critical operational boundaries. Without instrumentation, diagnosing production failures (e.g. buffer rejections, API errors) requires code-level investigation rather than log inspection.
Proposed change
#[instrument]toinstallation_token_with_bufferandinstallation_token_with_factory(andinstallation_token_with_client_and_timeif appropriate).tracing::info!on successful token acquisition (including expiry timestamp, excluding token secret).tracing::warn!when a token is rejected due to the expiry buffer.tracing::error!on acquisition failure, including the mappedGitHubErrorvariant.docs/developers-guide.md.Acceptance criteria
#[instrument](withskipfor sensitive fields as appropriate).make check-fmt,make lint, andmake testall pass.Background
Identified during review of PR #77 (requested by @leynos).