fix(prometheus_services.py): add better import error statement
This commit is contained in:
parent
71580c1245
commit
67d0d5e356
@ -24,7 +24,12 @@ class PrometheusServicesLogger:
|
||||
**kwargs,
|
||||
):
|
||||
try:
|
||||
from prometheus_client import Counter, Histogram, REGISTRY
|
||||
try:
|
||||
from prometheus_client import Counter, Histogram, REGISTRY
|
||||
except ImportError:
|
||||
raise Exception(
|
||||
"Missing prometheus_client. Run `pip install prometheus-client`"
|
||||
)
|
||||
|
||||
self.Histogram = Histogram
|
||||
self.Counter = Counter
|
||||
|
||||
Loading…
Reference in New Issue
Block a user