Skip to content

Add option to choose which statsd timing fields to compute #19655

Description

@a-moussaoui

Use Case

Hello,

In statsd input plugin, for all timing input metics, there is some fields that are computed regardless we need it or not.

			fields[prefix+"mean"] = stats.mean()
			fields[prefix+"median"] = stats.median()
			fields[prefix+"stddev"] = stats.stddev()
			fields[prefix+"sum"] = stats.sum()
			fields[prefix+"upper"] = stats.upper()
			fields[prefix+"lower"] = stats.lower()

Due to this computations, the CPU consuption is very high in my use case, even higher than statsd javasript.

Is it possible to give an option to specify with fields we want it to be computed, like:

calculated_timing_metrics: ["count", "stddev", "mean", "sum"]

impacted file: plugins/inputs/statsd/statsd.go link

Thank you

Expected behavior

For timing metrics, only the specified fields are computed, that should result into optimization of CPU consuption

Actual behavior

All timing fields are computed, except for percentile that we can deactivate if we dont need them.

Additional info

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequests for new plugin and for new features to existing plugins

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions