dbader / dbader/node-datadog-metrics

Flushing the same metric multiple times in the same second overwrites previous values

Open
#53 3 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
JavaScript
Stars
147
Forks
60
PR merge metrics
No merged PRs in 30d

Description

If you increment a counter, flush the message, and then before the UTC timestamp has rolled into the next second, increment the same counter with the same tags (and flush again), only one of your two increments will show up in datadog. I think Datadog has some de-duplication / unique indexing that only tracks a unique metric per second. I think this library would need to keep in-memory up to 1 second of messages, to be able to track and send the right stats.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how counters are incremented and flushed through the DataDog HTTP API, focusing on the UTC-second timestamp and identical tags. Reproduce two same-second flushes for one counter, then define the fix by verifying that both increments are represented rather than overwritten by Datadog.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.