Skip to content

fix: telemetry recording on corrupt entries and exception log level#28

Open
emiliano-go wants to merge 1 commit into
redis:mainfrom
emiliano-go:fix/telemetry-data-integrity
Open

fix: telemetry recording on corrupt entries and exception log level#28
emiliano-go wants to merge 1 commit into
redis:mainfrom
emiliano-go:fix/telemetry-data-integrity

Conversation

@emiliano-go

Copy link
Copy Markdown

Changes

Bug: Corrupt cache entry records double telemetry (hit + miss)

record_cache_request(result="hit") and the span cache.hit attribute were
emitted before deserializing the cached response. When the entry had
corrupt JSON, the exception was caught, execution fell through to the MISS
path, and a second metric was recorded.

Fix: Deserialize first, then emit telemetry only on success. If
deserialization fails only a single "miss" metric is recorded.

Bug: Swallowed telemetry exceptions logged at DEBUG level

OpenTelemetry metric helpers (record_cache_request, record_cache_eviction,
record_cache_write, record_cache_latency) swallowed all exceptions at
logger.debug(...), making OTel errors invisible in production without
debug logging enabled.

Fix: Changed all four handlers to logger.warning(...).

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.

1 participant