Skip to content

Commit

Permalink
Merge branch 'master' into fix/buffer-unit-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
patkivikram authored Feb 23, 2022
2 parents 7735a3f + ea8be8c commit 379aaaf
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions faust/sensors/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,9 @@ def setup_prometheus_sensors(
"prometheus_client requires `pip install prometheus_client`."
)
if name_prefix is None:
app_conf_name = app.conf.name
app.logger.info(
"Name prefix is not supplied. Using the name %s from App config.",
app_conf_name,
)
if "-" in app_conf_name:
name_prefix = app_conf_name.replace("-", "_")
app.logger.warning(
"App config name %s does not conform to"
" Prometheus naming conventions."
" Using %s as a name_prefix.",
app_conf_name,
name_prefix,
)
name_prefix = app.conf.name

name_prefix = name_prefix.replace("-", "_").replace(".", "_")

faust_metrics = FaustMetrics.create(registry, name_prefix)
app.monitor = PrometheusMonitor(metrics=faust_metrics)
Expand Down

0 comments on commit 379aaaf

Please sign in to comment.