Skip to content

Instrument src/github/installation_token.rs with tracing #93

Description

@coderabbitai

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).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions