cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to container restarts for a CONTAINER_GROUP_INSTANCE?

crabbylou
Helper

I can grab a bunch of container statistics for CONTAINER_GROUP_INSTANCES easily, but I am trying to get container restarts for a container group instance in a given namespace. 

Is there any way to do this? Am I mixing apples and oranges here?

Any advice appreciated.

Lou

5 REPLIES 5

radek_jasinski
DynaMight Guru
DynaMight Guru

Do you want to perform a reboot or display information about restarts on your environments?

Have a nice day!

Display the number of restarts per time interval.

There is a metric to report the number of container restarts: builtin:kubernetes.container.restarts

Zrzut ekranu 2023-11-3 o 19.19.11.png

Have a nice day!

Hi Radek, I cannot get this to pull for a CONTAINER_GROUP_INSTANCE. Is there a trick to this?

I can pull for a Kubernetes Namespace.

All my other CGI stats are being queried by CGI. 

Lou

Hi,

For the builtin:kubernetes.container.restarts metric, you do not have the CONTAINER_GROUP_INSTANCE dimension available. This is a different entityType. It is only present for metrics:

  • builtin:containers.cpu.*
  • builtin:containers.memory.*

The metric that tells us about pod restarts on Kubernetes is builtin:kubernetes.container.restarts and below you have the dimensions you can use:

Kubernetes workload (dt.entity.cloud_application), Kubernetes pod (dt.entity.cloud_application_instance), Kubernetes namespace (dt.entity.cloud_application_namespace), Kubernetes cluster (dt.entity.kubernetes_cluster), Kubernetes node (dt. entity.kubernetes_node), dt.kubernetes.node.system_uuid, k8s.cluster.name, k8s.container.name, k8s.cronjob.name, k8s.deployment.name, k8s.namespace.name, k8s.node.name, k8s.pod.name, k8s.pod.uid, k8s.workload.kind, k8s.workload.name.

In this case, I would recommend using Kubernetes namespace.

Some docs for you: 

https://docs.dynatrace.com/docs/dynatrace-api/environment-api/entity-v2/get-all-entity-types

https://docs.dynatrace.com/docs/dynatrace-api/environment-api/entity-v2/entity-selector

Hope this help.

Radek

Have a nice day!

Featured Posts