fix(prometheus_services.py): add better import error statement

This commit is contained in:
Krrish Dholakia
2024-04-13 19:03:32 -07:00
parent 71580c1245
commit 67d0d5e356
+6 -1
View File
@@ -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