Skip to content

Instantly share code, notes, and snippets.

@arajkumar
Created February 10, 2022 16:41
Show Gist options
  • Save arajkumar/3cebf091fefdb5fbc9ea68952768a081 to your computer and use it in GitHub Desktop.
Save arajkumar/3cebf091fefdb5fbc9ea68952768a081 to your computer and use it in GitHub Desktop.
grafana-query-variable
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 1,
"iteration": 1644511210482,
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fieldConfig": {
"defaults": {},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.5.11",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Panel Title",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"schemaVersion": 27,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": false,
"text": "prometheus-example-app-d748cfb54-hvhr8",
"value": "prometheus-example-app-d748cfb54-hvhr8"
},
"datasource": null,
"definition": "label_values(container_blkio_device_usage_total{ namespace=\"ns1\"}, pod)",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": "label_values1",
"multi": false,
"name": "label_values1",
"options": [
{
"selected": true,
"text": "prometheus-example-app-d748cfb54-hvhr8",
"value": "prometheus-example-app-d748cfb54-hvhr8"
}
],
"query": {
"query": "label_values(container_blkio_device_usage_total{ namespace=\"ns1\"}, pod)",
"refId": "StandardVariableQuery"
},
"refresh": 0,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"selected": false,
"text": "up{endpoint=\"web\",instance=\"10.128.2.9:8080\",job=\"prometheus-example-app\",namespace=\"ns1\",pod=\"prometheus-example-app-d748cfb54-pmxgb\",prometheus=\"openshift-user-workload-monitoring/user-workload\",service=\"prometheus-example-app\"} 1 1644511040000",
"value": "up{endpoint=\"web\",instance=\"10.128.2.9:8080\",job=\"prometheus-example-app\",namespace=\"ns1\",pod=\"prometheus-example-app-d748cfb54-pmxgb\",prometheus=\"openshift-user-workload-monitoring/user-workload\",service=\"prometheus-example-app\"} 1 1644511040000"
},
"datasource": null,
"definition": "query_result(up)",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "query0",
"options": [
{
"selected": true,
"text": "up{endpoint=\"web\",instance=\"10.128.2.9:8080\",job=\"prometheus-example-app\",namespace=\"ns1\",pod=\"prometheus-example-app-d748cfb54-pmxgb\",prometheus=\"openshift-user-workload-monitoring/user-workload\",service=\"prometheus-example-app\"} 1 1644511040000",
"value": "up{endpoint=\"web\",instance=\"10.128.2.9:8080\",job=\"prometheus-example-app\",namespace=\"ns1\",pod=\"prometheus-example-app-d748cfb54-pmxgb\",prometheus=\"openshift-user-workload-monitoring/user-workload\",service=\"prometheus-example-app\"} 1 1644511040000"
},
{
"selected": false,
"text": "up{endpoint=\"web\",instance=\"10.131.0.12:8080\",job=\"prometheus-example-app\",namespace=\"ns1\",pod=\"prometheus-example-app-d748cfb54-hvhr8\",prometheus=\"openshift-user-workload-monitoring/user-workload\",service=\"prometheus-example-app\"} 1 1644511040000",
"value": "up{endpoint=\"web\",instance=\"10.131.0.12:8080\",job=\"prometheus-example-app\",namespace=\"ns1\",pod=\"prometheus-example-app-d748cfb54-hvhr8\",prometheus=\"openshift-user-workload-monitoring/user-workload\",service=\"prometheus-example-app\"} 1 1644511040000"
}
],
"query": {
"query": "query_result(up)",
"refId": "StandardVariableQuery"
},
"refresh": 0,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"selected": false,
"text": "container_blkio_device_usage_total",
"value": "container_blkio_device_usage_total"
},
"datasource": null,
"definition": "label_values(__name__)",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "label_values0",
"options": [
{
"selected": true,
"text": "container_blkio_device_usage_total",
"value": "container_blkio_device_usage_total"
},
{
"selected": false,
"text": "container_cpu_system_seconds_total",
"value": "container_cpu_system_seconds_total"
},
{
"selected": false,
"text": "container_cpu_usage_seconds_total",
"value": "container_cpu_usage_seconds_total"
},
{
"selected": false,
"text": "container_cpu_user_seconds_total",
"value": "container_cpu_user_seconds_total"
},
{
"selected": false,
"text": "container_file_descriptors",
"value": "container_file_descriptors"
},
{
"selected": false,
"text": "container_fs_reads_bytes_total",
"value": "container_fs_reads_bytes_total"
},
{
"selected": false,
"text": "container_fs_reads_total",
"value": "container_fs_reads_total"
},
{
"selected": false,
"text": "container_fs_usage_bytes",
"value": "container_fs_usage_bytes"
},
{
"selected": false,
"text": "container_fs_writes_bytes_total",
"value": "container_fs_writes_bytes_total"
},
{
"selected": false,
"text": "container_fs_writes_total",
"value": "container_fs_writes_total"
},
{
"selected": false,
"text": "container_last_seen",
"value": "container_last_seen"
},
{
"selected": false,
"text": "container_memory_cache",
"value": "container_memory_cache"
},
{
"selected": false,
"text": "container_memory_failcnt",
"value": "container_memory_failcnt"
},
{
"selected": false,
"text": "container_memory_mapped_file",
"value": "container_memory_mapped_file"
},
{
"selected": false,
"text": "container_memory_max_usage_bytes",
"value": "container_memory_max_usage_bytes"
},
{
"selected": false,
"text": "container_memory_rss",
"value": "container_memory_rss"
},
{
"selected": false,
"text": "container_memory_swap",
"value": "container_memory_swap"
},
{
"selected": false,
"text": "container_memory_usage_bytes",
"value": "container_memory_usage_bytes"
},
{
"selected": false,
"text": "container_memory_working_set_bytes",
"value": "container_memory_working_set_bytes"
},
{
"selected": false,
"text": "container_network_receive_bytes_total",
"value": "container_network_receive_bytes_total"
},
{
"selected": false,
"text": "container_network_receive_errors_total",
"value": "container_network_receive_errors_total"
},
{
"selected": false,
"text": "container_network_receive_packets_dropped_total",
"value": "container_network_receive_packets_dropped_total"
},
{
"selected": false,
"text": "container_network_receive_packets_total",
"value": "container_network_receive_packets_total"
},
{
"selected": false,
"text": "container_network_transmit_bytes_total",
"value": "container_network_transmit_bytes_total"
},
{
"selected": false,
"text": "container_network_transmit_errors_total",
"value": "container_network_transmit_errors_total"
},
{
"selected": false,
"text": "container_network_transmit_packets_dropped_total",
"value": "container_network_transmit_packets_dropped_total"
},
{
"selected": false,
"text": "container_network_transmit_packets_total",
"value": "container_network_transmit_packets_total"
},
{
"selected": false,
"text": "container_processes",
"value": "container_processes"
},
{
"selected": false,
"text": "container_sockets",
"value": "container_sockets"
},
{
"selected": false,
"text": "container_spec_cpu_period",
"value": "container_spec_cpu_period"
},
{
"selected": false,
"text": "container_spec_cpu_shares",
"value": "container_spec_cpu_shares"
},
{
"selected": false,
"text": "container_spec_memory_limit_bytes",
"value": "container_spec_memory_limit_bytes"
},
{
"selected": false,
"text": "container_spec_memory_reservation_limit_bytes",
"value": "container_spec_memory_reservation_limit_bytes"
},
{
"selected": false,
"text": "container_spec_memory_swap_limit_bytes",
"value": "container_spec_memory_swap_limit_bytes"
},
{
"selected": false,
"text": "container_start_time_seconds",
"value": "container_start_time_seconds"
},
{
"selected": false,
"text": "container_threads",
"value": "container_threads"
},
{
"selected": false,
"text": "container_threads_max",
"value": "container_threads_max"
},
{
"selected": false,
"text": "container_ulimits_soft",
"value": "container_ulimits_soft"
},
{
"selected": false,
"text": "kube_configmap_info",
"value": "kube_configmap_info"
},
{
"selected": false,
"text": "kube_deployment_labels",
"value": "kube_deployment_labels"
},
{
"selected": false,
"text": "kube_deployment_metadata_generation",
"value": "kube_deployment_metadata_generation"
},
{
"selected": false,
"text": "kube_deployment_spec_paused",
"value": "kube_deployment_spec_paused"
},
{
"selected": false,
"text": "kube_deployment_spec_replicas",
"value": "kube_deployment_spec_replicas"
},
{
"selected": false,
"text": "kube_deployment_spec_strategy_rollingupdate_max_surge",
"value": "kube_deployment_spec_strategy_rollingupdate_max_surge"
},
{
"selected": false,
"text": "kube_deployment_spec_strategy_rollingupdate_max_unavailable",
"value": "kube_deployment_spec_strategy_rollingupdate_max_unavailable"
},
{
"selected": false,
"text": "kube_deployment_status_condition",
"value": "kube_deployment_status_condition"
},
{
"selected": false,
"text": "kube_deployment_status_observed_generation",
"value": "kube_deployment_status_observed_generation"
},
{
"selected": false,
"text": "kube_deployment_status_replicas",
"value": "kube_deployment_status_replicas"
},
{
"selected": false,
"text": "kube_deployment_status_replicas_available",
"value": "kube_deployment_status_replicas_available"
},
{
"selected": false,
"text": "kube_deployment_status_replicas_unavailable",
"value": "kube_deployment_status_replicas_unavailable"
},
{
"selected": false,
"text": "kube_deployment_status_replicas_updated",
"value": "kube_deployment_status_replicas_updated"
},
{
"selected": false,
"text": "kube_endpoint_address_available",
"value": "kube_endpoint_address_available"
},
{
"selected": false,
"text": "kube_endpoint_address_not_ready",
"value": "kube_endpoint_address_not_ready"
},
{
"selected": false,
"text": "kube_endpoint_info",
"value": "kube_endpoint_info"
},
{
"selected": false,
"text": "kube_endpoint_labels",
"value": "kube_endpoint_labels"
},
{
"selected": false,
"text": "kube_namespace_labels",
"value": "kube_namespace_labels"
},
{
"selected": false,
"text": "kube_namespace_status_phase",
"value": "kube_namespace_status_phase"
},
{
"selected": false,
"text": "kube_pod_container_info",
"value": "kube_pod_container_info"
},
{
"selected": false,
"text": "kube_pod_container_state_started",
"value": "kube_pod_container_state_started"
},
{
"selected": false,
"text": "kube_pod_container_status_ready",
"value": "kube_pod_container_status_ready"
},
{
"selected": false,
"text": "kube_pod_container_status_restarts_total",
"value": "kube_pod_container_status_restarts_total"
},
{
"selected": false,
"text": "kube_pod_container_status_waiting",
"value": "kube_pod_container_status_waiting"
},
{
"selected": false,
"text": "kube_pod_info",
"value": "kube_pod_info"
},
{
"selected": false,
"text": "kube_pod_labels",
"value": "kube_pod_labels"
},
{
"selected": false,
"text": "kube_pod_owner",
"value": "kube_pod_owner"
},
{
"selected": false,
"text": "kube_pod_start_time",
"value": "kube_pod_start_time"
},
{
"selected": false,
"text": "kube_pod_status_phase",
"value": "kube_pod_status_phase"
},
{
"selected": false,
"text": "kube_pod_status_ready",
"value": "kube_pod_status_ready"
},
{
"selected": false,
"text": "kube_pod_status_reason",
"value": "kube_pod_status_reason"
},
{
"selected": false,
"text": "kube_replicaset_labels",
"value": "kube_replicaset_labels"
},
{
"selected": false,
"text": "kube_replicaset_owner",
"value": "kube_replicaset_owner"
},
{
"selected": false,
"text": "kube_replicaset_spec_replicas",
"value": "kube_replicaset_spec_replicas"
},
{
"selected": false,
"text": "kube_replicaset_status_fully_labeled_replicas",
"value": "kube_replicaset_status_fully_labeled_replicas"
},
{
"selected": false,
"text": "kube_replicaset_status_ready_replicas",
"value": "kube_replicaset_status_ready_replicas"
},
{
"selected": false,
"text": "kube_replicaset_status_replicas",
"value": "kube_replicaset_status_replicas"
},
{
"selected": false,
"text": "kube_running_pod_ready",
"value": "kube_running_pod_ready"
},
{
"selected": false,
"text": "kube_secret_info",
"value": "kube_secret_info"
},
{
"selected": false,
"text": "kube_secret_type",
"value": "kube_secret_type"
},
{
"selected": false,
"text": "kube_service_info",
"value": "kube_service_info"
},
{
"selected": false,
"text": "kube_service_labels",
"value": "kube_service_labels"
},
{
"selected": false,
"text": "kube_service_spec_type",
"value": "kube_service_spec_type"
},
{
"selected": false,
"text": "kubelet_container_log_filesystem_used_bytes",
"value": "kubelet_container_log_filesystem_used_bytes"
},
{
"selected": false,
"text": "namespace:container_cpu_usage:sum",
"value": "namespace:container_cpu_usage:sum"
},
{
"selected": false,
"text": "namespace:container_memory_usage_bytes:sum",
"value": "namespace:container_memory_usage_bytes:sum"
},
{
"selected": false,
"text": "namespace_workload_pod:kube_pod_owner:relabel",
"value": "namespace_workload_pod:kube_pod_owner:relabel"
},
{
"selected": false,
"text": "node_namespace_pod:kube_pod_info:",
"value": "node_namespace_pod:kube_pod_info:"
},
{
"selected": false,
"text": "node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate",
"value": "node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate"
},
{
"selected": false,
"text": "node_namespace_pod_container:container_memory_cache",
"value": "node_namespace_pod_container:container_memory_cache"
},
{
"selected": false,
"text": "node_namespace_pod_container:container_memory_rss",
"value": "node_namespace_pod_container:container_memory_rss"
},
{
"selected": false,
"text": "node_namespace_pod_container:container_memory_swap",
"value": "node_namespace_pod_container:container_memory_swap"
},
{
"selected": false,
"text": "node_namespace_pod_container:container_memory_working_set_bytes",
"value": "node_namespace_pod_container:container_memory_working_set_bytes"
},
{
"selected": false,
"text": "pod:container_cpu_usage:sum",
"value": "pod:container_cpu_usage:sum"
},
{
"selected": false,
"text": "pod:container_fs_usage_bytes:sum",
"value": "pod:container_fs_usage_bytes:sum"
},
{
"selected": false,
"text": "pod_network_name_info",
"value": "pod_network_name_info"
},
{
"selected": false,
"text": "scrape_duration_seconds",
"value": "scrape_duration_seconds"
},
{
"selected": false,
"text": "scrape_samples_post_metric_relabeling",
"value": "scrape_samples_post_metric_relabeling"
},
{
"selected": false,
"text": "scrape_samples_scraped",
"value": "scrape_samples_scraped"
},
{
"selected": false,
"text": "scrape_series_added",
"value": "scrape_series_added"
},
{
"selected": false,
"text": "up",
"value": "up"
},
{
"selected": false,
"text": "version",
"value": "version"
}
],
"query": {
"query": "label_values(__name__)",
"refId": "StandardVariableQuery"
},
"refresh": 0,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"selected": true,
"text": "__name__",
"value": "__name__"
},
"datasource": null,
"definition": "label_names()",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "label_name",
"options": [
{
"selected": true,
"text": "__name__",
"value": "__name__"
},
{
"selected": false,
"text": "cluster_ip",
"value": "cluster_ip"
},
{
"selected": false,
"text": "condition",
"value": "condition"
},
{
"selected": false,
"text": "configmap",
"value": "configmap"
},
{
"selected": false,
"text": "container",
"value": "container"
},
{
"selected": false,
"text": "container_id",
"value": "container_id"
},
{
"selected": false,
"text": "cpu",
"value": "cpu"
},
{
"selected": false,
"text": "created_by_kind",
"value": "created_by_kind"
},
{
"selected": false,
"text": "created_by_name",
"value": "created_by_name"
},
{
"selected": false,
"text": "deployment",
"value": "deployment"
},
{
"selected": false,
"text": "device",
"value": "device"
},
{
"selected": false,
"text": "endpoint",
"value": "endpoint"
},
{
"selected": false,
"text": "host_ip",
"value": "host_ip"
},
{
"selected": false,
"text": "host_network",
"value": "host_network"
},
{
"selected": false,
"text": "id",
"value": "id"
},
{
"selected": false,
"text": "image",
"value": "image"
},
{
"selected": false,
"text": "image_id",
"value": "image_id"
},
{
"selected": false,
"text": "instance",
"value": "instance"
},
{
"selected": false,
"text": "interface",
"value": "interface"
},
{
"selected": false,
"text": "job",
"value": "job"
},
{
"selected": false,
"text": "label_app",
"value": "label_app"
},
{
"selected": false,
"text": "label_kubernetes_io_metadata_name",
"value": "label_kubernetes_io_metadata_name"
},
{
"selected": false,
"text": "label_pod_template_hash",
"value": "label_pod_template_hash"
},
{
"selected": false,
"text": "major",
"value": "major"
},
{
"selected": false,
"text": "metrics_path",
"value": "metrics_path"
},
{
"selected": false,
"text": "minor",
"value": "minor"
},
{
"selected": false,
"text": "name",
"value": "name"
},
{
"selected": false,
"text": "namespace",
"value": "namespace"
},
{
"selected": false,
"text": "network_name",
"value": "network_name"
},
{
"selected": false,
"text": "node",
"value": "node"
},
{
"selected": false,
"text": "operation",
"value": "operation"
},
{
"selected": false,
"text": "owner_is_controller",
"value": "owner_is_controller"
},
{
"selected": false,
"text": "owner_kind",
"value": "owner_kind"
},
{
"selected": false,
"text": "owner_name",
"value": "owner_name"
},
{
"selected": false,
"text": "phase",
"value": "phase"
},
{
"selected": false,
"text": "pod",
"value": "pod"
},
{
"selected": false,
"text": "pod_ip",
"value": "pod_ip"
},
{
"selected": false,
"text": "prometheus",
"value": "prometheus"
},
{
"selected": false,
"text": "prometheus_replica",
"value": "prometheus_replica"
},
{
"selected": false,
"text": "reason",
"value": "reason"
},
{
"selected": false,
"text": "replicaset",
"value": "replicaset"
},
{
"selected": false,
"text": "secret",
"value": "secret"
},
{
"selected": false,
"text": "service",
"value": "service"
},
{
"selected": false,
"text": "status",
"value": "status"
},
{
"selected": false,
"text": "type",
"value": "type"
},
{
"selected": false,
"text": "uid",
"value": "uid"
},
{
"selected": false,
"text": "ulimit",
"value": "ulimit"
},
{
"selected": false,
"text": "version",
"value": "version"
},
{
"selected": false,
"text": "workload",
"value": "workload"
},
{
"selected": false,
"text": "workload_type",
"value": "workload_type"
}
],
"query": {
"query": "label_names()",
"refId": "StandardVariableQuery"
},
"refresh": 0,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {
"selected": false,
"text": "kube_deployment_spec_strategy_rollingupdate_max_surge",
"value": "kube_deployment_spec_strategy_rollingupdate_max_surge"
},
"datasource": null,
"definition": "metrics(up)",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "metrics",
"options": [
{
"selected": true,
"text": "kube_deployment_spec_strategy_rollingupdate_max_surge",
"value": "kube_deployment_spec_strategy_rollingupdate_max_surge"
},
{
"selected": false,
"text": "kube_deployment_spec_strategy_rollingupdate_max_unavailable",
"value": "kube_deployment_spec_strategy_rollingupdate_max_unavailable"
},
{
"selected": false,
"text": "kube_deployment_status_replicas_updated",
"value": "kube_deployment_status_replicas_updated"
},
{
"selected": false,
"text": "up",
"value": "up"
}
],
"query": {
"query": "metrics(up)",
"refId": "StandardVariableQuery"
},
"refresh": 0,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "New dashboard Copy",
"uid": "DFS8_B-7z",
"version": 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment