Closed genieai-vikas closed 3 years ago
Can you be a little more specific about where you are not seeing the container names?
Which dashboard, what specific graph? Including a screenshot would help.
Regarding your second point you can pull data from all sorts of different places if you're talking about data specific to MongoDB you'll need to add an exporter that can talk to MongoDB and pull out stats that you want to report on, if you're talking basic stats regarding the container as opposed to MongoDB at an application level you can do that out-of-the-box.
Notifications need to be setup per the documentation.
@nightah Thank you I followed the documentation and was able to fix my issue. I am not able to find any metric which I can use to trigger alerts when the container restarts.
container_last_seen
don't have container_label_restartcount
. So I can't use the below alert. Also, This is for docker-compose so I can't use kube* metrics. Any help how can I create an alert for container restarts
- alert: Container (Compose) Too Many Restarts
expr: count by (instance, name) (count_over_time(container_last_seen{name!="", container_label_restartcount!=""}[15m])) - 1 >= 5
for: 5m
annotations:
summary: "Too many restarts ({{ $value }}) for container \"{{ $labels.name }}\""
There is no explicit metric for containers to determine if they are up or down which is why we look at memory usage for said container name in our examples:
I am running 12 services(containers) using docker-compose. Using dockprom, I deployed the stack but when I am checking the Grafana dashboard, there is no containers name.