Table
Use Table Panel
Using Links
The PromQL panel supports the configuration of dynamic links. You can generate an external or internal URL using the label values returned by the PromQL query.
To add a link, open the Links tab and enter:
- the URL template. In the URL you can reference a label value with
{{label_name}}
. - the link title.
If your URL contains the {
and }
character, escape it with \
.
Use Cases
Build an Aggregate View of Your Workloads Per Cluster and Namespace
This example shows how to build a Form table panel to view a concatenated list of workloads per cluster and namespace.
When configuring the panel options, choose:
- Segmentation:
kube_cluster_name
andkube_namespace_name
- Metrics/Labels:
kube_workload_name
- Time aggregation:
Concat
You can then export the results as CSV for further exploration.
View Resource Utilization of Your Kubernetes Workload Using a PromQL Table Panel
This example shows how to build a PromQL table panel to view resource utilization of your Kubernetes workload.
For demonstration, CPU and memory utilization is evaluated against the given quota in each workload, cluster, and namespace. The query displays top 10 segments that consume highest number of CPU cores and highest amount of memory.
CPU Used Percent
topk(10,avg(avg_over_time(sysdig_container_cpu_used_percent{$__scope}[$__interval])) by (kube_cluster_name, kube_namespace_name, kube_workload_name))
CPU Quota
topk(10,avg(avg_over_time(sysdig_container_cpu_cores_quota_limit{$__scope}[$__interval])) by (kube_cluster_name, kube_namespace_name, kube_workload_name))
Memory Used Percent
topk(10,avg(avg_over_time(sysdig_container_memory_used_percent{$__scope}[$__interval])) by (kube_cluster_name, kube_namespace_name, kube_workload_name))
Memory Quota
topk(10,avg(avg_over_time(sysdig_container_memory_limit_bytes{$__scope}[$__interval])) by (kube_cluster_name, kube_namespace_name, kube_workload_name))
Select an appropriate unit of value for each query to return meaningful result. For example, use number for CPU quota, data for memory quota, and percent resource utilization metrics.
To scope down your selection, use the scope variable in combination with Team scope.
In this example, the panel scope is limited to two clusters (netsec-load-data
, test-k8s-data
), one namespace (kube-system
), and one workload (coredns
).
Explore Kubernetes Objects from a PromQL Table
This example shows how to configure the table links to explore a Kubernetes object on Metrics Explorer:
- Use the URL that gives the Metrics Explorer default All Workloads:
#/explore/metrics?last=3600&scope=kubernetes.cluster.name%20%3D%20%3F%20and%20kubernetes.namespace.name%20%3D%20%3F%20and%20kubernetes.workload.name%20%3D%20%3F%20and%20kubernetes.pod.name%20%3D%20%3F
- Apply the labels to the URL:
Show cluster in Metrics Explorer:
#/explore/metrics?last=3600&scope=kubernetes.cluster.name+%3D+"{{kube_cluster_name}}"+and+kubernetes.namespace.name+%3D+%3F+and+kubernetes.workload.name+%3D+%3F+and+kubernetes.pod.name+%3D+%3F
Show namespace in Metrics Explorer:
#/explore/metrics?last=3600&scope=kubernetes.cluster.name+%3D+"{{kube_cluster_name}}"+and+kubernetes.namespace.name+%3D+"{{kube_namespace_name}}"+and+kubernetes.workload.name+%3D+%3F+and+kubernetes.pod.name+%3D+%3F
Show workload in Metrics Explorer:
#/explore/metrics?last=3600&scope=kubernetes.cluster.name+%3D+"{{kube_cluster_name}}"+and+kubernetes.namespace.name+%3D+"{{kube_namespace_name}}"+and+kubernetes.workload.name+%3D+"{{kube_workload_name}}"+and+kubernetes.pod.name+%3D+%3F
Show Host Logs on Mezmo
This example shows how to configure the table links to show the host logs on Mezmo:
Use the default URL of the company named Mezmo, where
w52qwe12vv
is the account id:https://app.mezmo.com/w52qwe12vv/logs/view
Apply the host label:
https://app.mezmo.com/w52qwe12vv/logs/view?hosts={{host_hostname}}
Known Limitations
The PromQL panel column order doesn’t honor the query segmentation order
Features in Technical Preview
The PromQL panel show a maximum of 250 rows. This limit can be changed with a beta flag in the User settings page:
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.