【发布时间】:2021-12-07 14:11:33
【问题描述】:
我正在使用 prometheus-fastapi-instrumentator 包来公开我的自定义指标,但它们似乎没有被 DataDog 拾取。
让 DataDog 抓取我的 Counter 指标时遇到了很多麻烦。此外,Histogram 存储桶似乎没有作为分布指标。
有人知道问题可能是什么吗?
这是我的 monitoring.py 文件:https://github.com/rileyhun/fastapi-ml-example/blob/main/app/core/monitoring.py
可重现的例子:
git clone https://github.com/rileyhun/fastapi-ml-example.git
docker build -t ${IMAGE_NAME}:${IMAGE_TAG} -f Dockerfile .
docker tag ${IMAGE_NAME}:${IMAGE_TAG} rhun/${IMAGE_NAME}:${IMAGE_TAG}
docker push rhun/${IMAGE_NAME}:${IMAGE_TAG}
minikube start --driver=docker --memory 4g --nodes 2
kubectl create namespace monitoring
helm install prometheus-stack prometheus-community/kube-prometheus-stack -n monitoring
kubectl apply -f deployment/wine-model-local.yaml
kubectl port-forward svc/wine-model-service 8080:80
python api_call.py
【问题讨论】:
标签: python prometheus metrics fastapi datadog