Skip to content

Make bridgestrap export metrics

If we end up using statsd/graphite to keep track of rdsys metrics, it's trivial to add bridgestrap metrics too. All we have to do is to use the statsd-client library and log whatever we want to add to statsd's time series. Things that come to mind:

  • Number of failed/successful tests.
  • Execution time of Tor tests.
  • Execution time of Web/API requests.
  • Number of cache hits/misses.

Adding metrics is very easy, e.g.:

metrics.Inc("bridgestrap.tor.num_dysfunctional_bridges", 1)

This line increments the counter for bridgestrap/tor/num_dysfunctional_bridges.