Permalink
Browse files

Improve observability on metric creation

Signed-off-by: Adrien Gentil <a.gentil@criteo.com>
  • Loading branch information...
adriengentil committed Oct 10, 2018
1 parent 44e68cc commit 2c2a0d401170bd833d65a7416415e41634f40ab1
Showing with 13 additions and 3 deletions.
  1. +4 −1 CHANGELOG.md
  2. +9 −2 biggraphite/plugins/carbon.py
View
@@ -6,8 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Breaking changes
- the previous metric `bg_creates` becomes `bg_creates_enqueued` for Cassandra driver
### Improved
-
- improved observability on metric creation
### Fixed
-
@@ -56,7 +56,13 @@
"bg_exists_latency_seconds", "create latency in seconds"
)
CREATES = prometheus_client.Counter("bg_creates", "metric creations")
CREATES_ENQUEUED = prometheus_client.Counter(
"bg_creates_enqueued", "metrics scheduled for creation"
)
CREATES_DEQUEUED = prometheus_client.Counter(
"bg_creates_dequeued", "metrics created in database"
)
class BigGraphiteDatabase(database.TimeSeriesDatabase):
@@ -271,6 +277,7 @@ def _createAsync(self, metric, metric_name):
metric_name: the original, un-encoded metric name
"""
self._metricsToCreate.put((metric, metric_name))
CREATES_ENQUEUED.inc()
def _createMetrics(self):
# We create metrics in a separate thread because this is potentially
@@ -315,7 +322,7 @@ def _createOneMetric(self):
self.cache.create_metric(metric)
self.tag(metric_name)
CREATES.inc()
CREATES_DEQUEUED.inc()
class MultiDatabase(database.TimeSeriesDatabase):

0 comments on commit 2c2a0d4

Please sign in to comment.