Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Push StasD counters as gauges (#6580)
Browse files Browse the repository at this point in the history
JIRA issues: DCOS-42671
  • Loading branch information
Ivan Chernetsky authored and Tim Harper committed Oct 2, 2018
1 parent 2e412f6 commit da9365d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion docs/docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ The StatsD reporter can be enabled with `--metrics_statsd` command-line
flag. It sends metrics over UDP to the host and port specified with
`--metrics_statsd_host` and `--metrics_statsd_port` respectively.

Counters are forwarded as gauges.

## DataDog reporter

The DataDog reporter can be enabled with `--metrics_datadog`
Expand All @@ -84,7 +86,8 @@ the DataDog cloud over HTTP. It is specified using
and `api`. If `api` is chosen, your DataDog API key can be supplied with
`--metrics_datadog_api_key`.

Dashes in metric names are replaced with underscores.
Dashes in metric names are replaced with underscores. Counters are
forwarded as gauges.

## Important metrics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class DataDogAPIReporter(metricsConf: MetricsConf, registry: MetricRegistry) ext
}

private def reportCounter(buffer: StringBuilder, name: String, counter: Counter, timestamp: Long): Unit =
reportMetric(buffer, name, counter.getCount.toString, timestamp, "count")
reportMetric(buffer, name, counter.getCount.toString, timestamp, "gauge")

private val histogramSnapshotSuffixes =
Seq("min", "average", "median", "75percentile", "95percentile", "98percentile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class DataDogUDPReporter(metricsConf: MetricsConf, registry: MetricRegistry) ext
}

private def reportCounter(socket: ActorRef, name: String, counter: Counter): Unit =
maybeSendAndAppend(socket, s"$name:${counter.getCount}|c\n")
maybeSendAndAppend(socket, s"$name:${counter.getCount}|g\n")

private val histogramSnapshotSuffixes =
Seq("min", "average", "median", "75percentile", "95percentile", "98percentile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class StatsDReporter(metricsConf: MetricsConf, registry: MetricRegistry) extends
}

private def reportCounter(socket: ActorRef, name: String, counter: Counter): Unit =
maybeSendAndAppend(socket, s"$name:${counter.getCount}|c\n")
maybeSendAndAppend(socket, s"$name:${counter.getCount}|g\n")

private val histogramSnapshotSuffixes =
Seq("min", "mean", "p50", "p75", "p95", "p98", "p99", "p999", "max", "stddev")
Expand Down

0 comments on commit da9365d

Please sign in to comment.