Skip to content

[Feature] Support replacing rather than summing gauges #65

@Sinjo

Description

@Sinjo

Hey 👋🏻

I've been looking at this project as one option for situations where scraping metrics is awkward (short-lived cron jobs in particular), but ran into one snag that's documented right at the top of the README:

Gauges are also added up (but this may not make any sense)

In many situations, summing up gauges doesn't make sense. The one I'm specifically running into is use of gauges to record the last time a job ran. In that situation, the behaviour I'd like is last-write-wins (i.e. whatever is currently in the gauge gets overwritten by a push to the same grouping key).

I was looking at the code, and it looks like it'd be fairly simple to make this behaviour conditional.

I'd be happy to send over a PR to do that. What I want to check is 1) whether you'd accept a PR that added a CLI flag to toggle the behaviour and 2) whether you have any preferences on implementation (e.g. should it be a global setting for all gauges in a given instance of the aggregation gateway).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions