datadog-scala icon indicating copy to clipboard operation
datadog-scala copied to clipboard

Metric Aggregation and counter metric type

Open slydon-apixio opened this issue 10 years ago • 2 comments

I am having an issue where I am emitting "counter" type metrics which I expect would apply as new counter = original counter +/- the metric value. This doesn't appear to be the case when I look at metrics explorer, the values are always 1.

I think I saw in other datadog clients there is metrics aggregation. Is it the case here that metrics aggregation is needed, but not provided by this client?

slydon-apixio avatar Jul 28 '15 20:07 slydon-apixio

Could you show me code that represents what you are doing?

This library isn't really meant for sending metrics. This is more for accessing the Datadog API…

gphat avatar Jul 29 '15 13:07 gphat

What I'm doing looks something like this

while (true) {
  if (somethingWrong(service)) {
    val r = client.addMetrics(List(Metric("app.somethingWrong",List((System.currentTimeMillis/1000,1)),Some("counter"),Some(List(s"${service}")),Some(s"${someHost}"))))
    r onSuccess { case x => println(s"Successfully made the request: ${x.statusCode}: ${x.body}") }
    r onFailure { case x => println(x) }
  }
}

slydon-apixio avatar Jul 29 '15 17:07 slydon-apixio