datadog-actions-metrics icon indicating copy to clipboard operation
datadog-actions-metrics copied to clipboard

Option to only include specific metrics/tags

Open mlahargou opened this issue 10 months ago • 2 comments

We'd like to have the option to only send specific metrics with specific tags. Ideally, we could configure this in the yml.

Our DataDog bill has been increasing lately, and part of the reason is we are sending too many metrics/tags from this app. We do, however, need specific metrics sent.

Something like this maybe?

         - name: Send metrics to Datadog
           uses: int128/datadog-actions-metrics@v1
           with:
              ...
              collect-job-metrics: true
              collect-step-metrics: true
              metrics:
                 - github.actions.workflow_run.conclusion.failure_total
                 - github.actions.workflow_run.duration_second.distribution
                 - github.actions.job.conclusion.success_total
                 - github.actions.job.conclusion.failure_total
                 - github.actions.job.queued_duration_second.distribution
                 - github.actions.job.duration_second.distribution
                 - github.actions.step.conclusion.failure_total
                 - github.actions.step.duration_second.distribution

As for limiting the number of tags, maybe we could key off of each metric in the sequence above and specify the tags we want sent with each?

Ref: https://github.com/int128/datadog-actions-metrics/issues/1021

mlahargou avatar Apr 04 '24 21:04 mlahargou

I added prefer-distribution- options for cost control. https://github.com/int128/datadog-actions-metrics/releases/tag/v1.86.0

Does it solve the cost issue? I think it is still nice to provide some option to filter the metrics.

int128 avatar Apr 21 '24 02:04 int128

I added prefer-distribution- options for cost control.

Yes, that's great.

I think it is still nice to provide some option to filter the metrics.

Yeah, I have a PR out if you want to take a look at it. Let me know what you think. https://github.com/int128/datadog-actions-metrics/pull/1082

mlahargou avatar Apr 21 '24 23:04 mlahargou