gphat / datadog-scala

Datadog library for Scala
MIT License
24 stars 18 forks source link

Metric Aggregation and counter metric type #5

Open slydon-apixio opened 9 years ago

slydon-apixio commented 9 years ago

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?

gphat commented 9 years ago

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…

slydon-apixio commented 9 years ago

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) }
  }
}