Skip to content

Commit

Permalink
🐛 use meter for counts instead of Counter
Browse files Browse the repository at this point in the history
dropwizard metrics Meter is mapped to statsd's Counter.
IF we use dropwizard Counter then the metric will endup as a gauge in Datadog.
Reference coursera/metrics-datadog#45

The referenced issue also mentioned a version downgrade for metrics-datadog. I tried it locally and the version didn't seem to make a difference.
  • Loading branch information
ThuTrinh committed Nov 4, 2019
1 parent 6177452 commit af92ee2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void markCompleted() {
messageLatencyTimer.update(Math.max(0L, age - 500L), TimeUnit.MILLISECONDS);

if (age > config.metricsAgeSlo) {
messageLatencySloViolationCount.inc();
messageLatencySloViolationCount.mark();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public abstract class AbstractProducer {
protected final Meter failedMessageMeter;
protected final Timer messagePublishTimer;
protected final Timer messageLatencyTimer;
protected final Counter messageLatencySloViolationCount;
protected final Meter messageLatencySloViolationCount;

public AbstractProducer(MaxwellContext context) {
this.context = context;
Expand All @@ -34,7 +34,7 @@ public AbstractProducer(MaxwellContext context) {
this.failedMessageMeter = metricRegistry.meter(metrics.metricName("messages", "failed", "meter"));
this.messagePublishTimer = metricRegistry.timer(metrics.metricName("message", "publish", "time"));
this.messageLatencyTimer = metricRegistry.timer(metrics.metricName("message", "publish", "age"));
this.messageLatencySloViolationCount = metricRegistry.counter(metrics.metricName("message", "publish", "age", "slo_violation"));
this.messageLatencySloViolationCount = metricRegistry.meter(metrics.metricName("message", "publish", "age", "slo_violation", "meter"));
}

abstract public void push(RowMap r) throws Exception;
Expand Down

0 comments on commit af92ee2

Please sign in to comment.