DataDog / datadogpy

The Datadog Python library
https://datadoghq.com/
Other
609 stars 302 forks source link

Add client side aggregation #844

Closed andrewqian2001datadog closed 3 weeks ago

andrewqian2001datadog commented 1 month ago

Requirements for Contributing to this repository

What does this PR do?

Project description This PR adds simple client side aggregation (aggregating metrics before they are received by the agent) for the python client. This PR combines two previous PRs together (1, 2)

Client side aggregation has already been implemented in Go, Java, and the C# dogstatsd clients

Description of the Change

Periodically aggregates metrics (Count, Gauge, Set) for a given statsd_aggregation_flush_interval and then sends the aggregated metrics to intake. A metric will be aggregated if statsd_disable_aggregating is False and there was another matching context sent within the same flush interval.

Verification Process

Unit tests that verify the aggregator.py class matches the existing behavior in the client side aggregator for the go client.

Unit tests that verify the new metric objects (merics.py) match the existing behavior in the client side aggregator for Go.

Local testing: Confluence doc More Docs

Bench Mark tests (TODO as a stretch goal)

Additional Notes

We currently do not allow buffering and aggregation at the same time, if both enabled, aggregation will occur instead of buffering.

Release Notes

Review checklist (to be filled by reviewers)

andrewqian2001datadog commented 3 weeks ago

/merge

dd-devflow[bot] commented 3 weeks ago

:steam_locomotive: MergeQueue: pull request added to the queue

The median merge time in master is 58m.

Use /merge -c to cancel this operation!

dd-devflow[bot] commented 3 weeks ago

:x: MergeQueue: The build pipeline has timeout

The merge request has been interrupted because the build took longer than expected. The current limit for the base branch 'master' is 120 minutes.

If you need support, contact us on Slack #devflow with those details!