Skip to content

Add observability to RouteCacheKey::for_route_request #352

@coderabbitai

Description

@coderabbitai

Background

Introduced in PR #346, RouteCacheKey::for_route_request derives canonical cache keys from route request payloads. The implementation has no logging, tracing spans, or metrics.

Problem

Operators cannot:

  • Diagnose derivation failures in production
  • Measure derivation latency or detect regressions
  • Monitor error rates for RouteCacheKeyDerivationError

Required work

  1. Add a tracing::debug_span (or #[tracing::instrument]) at the for_route_request entry point recording input size and outcome.
  2. Emit a tracing::warn! log when RouteCacheKeyDerivationError is returned, including a stable contextual message.
  3. Enrich RouteCacheKeyDerivationError variants with contextual display messages suitable for log output.
  4. Add a metrics counter (using the existing Prometheus infrastructure) for derivation errors and a histogram for derivation latency.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions