Skip to content

feat(metrics): emit a webhook-dedup hit counter from the Redis delivery cache #2075

Description

@JSONbored

checkAndMarkDelivery (src/selfhost/redis-cache.ts:30) short-circuits duplicate GitHub webhook redeliveries but records no metric on the dedup path, so operators can't quantify how many redeliveries Redis is absorbing (server.ts:722 has gittensory_webhook_dedup_total only for the in-process transient cache, not this Redis path). Add a gittensory_webhook_dedup_total{backend="redis"} increment when a delivery is already-seen.

Deliverables

  • Import incr from ./metrics into src/selfhost/redis-cache.ts
  • Increment gittensory_webhook_dedup_total{backend="redis"} inside checkAndMarkDelivery when seen is truthy (before returning true)
  • Do not increment on the swallowed-Redis-error path (returns false)
  • Unit tests: already-seen increments once, first-time does not increment, Redis-error path does not increment

References

  • src/selfhost/redis-cache.ts:30
  • src/server.ts:722
  • src/selfhost/metrics.ts:48

size: XS · gittensor:bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions