Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grafana dashboard #27

Open
danielmotaleite opened this issue Mar 9, 2020 · 3 comments
Open

grafana dashboard #27

danielmotaleite opened this issue Mar 9, 2020 · 3 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@danielmotaleite
Copy link

/kind feature

You probably already have some grafana dashboard and it would be helpful to have some starting point... So can you add a example grafana dashboard (or upload to grafana site and link to in in the documentation)?

@caicloud-bot caicloud-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 9, 2020
@haarchri
Copy link

any progress here ?

@lichuan0620
Copy link
Contributor

We are not planning on releasing a Grafana dashboard for the current release. Internally, we use the event metrics for a few graphs embedded in other dashboards (we find a dedicated event dashboard not so useful).

We may release a Grafana dashboard for learning and demonstration proposes, but only for the next major version (see #37).

We plan to start working on #37 in early October and release the first alpha within the same month. I'm sorry we cannot get to it sooner but our team is currently fully committed to another project (hopefully we can share something about that later, but for now it stays internal).

@danielmotaleite
Copy link
Author

I end building one that is useful to debug what is happening in k8s, not exactly for being a pretty wall dashboard.
You may need some small finetune, we use kcluster to identify multiple k8s clusters, you can probably remove that if you only have one. We do not use cluster, for consistency and avoid collisions with any other cluster.

You can include this if you want as a example dashboard

{
  "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": 464,
  "iteration": 1632517643134,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": null,
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 10,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "avg": false,
        "current": false,
        "hideZero": true,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "percentage": false,
      "pluginVersion": "7.1.3",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "pods number",
          "yaxis": 2
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "expr": "sum(kubernetes_events{kcluster=~\"$kcluster\",event_kind=~\"$event_kind\",event_namespace=~\"$event_namespace\",event_name=~\"$event_name\",event_reason=~\"$event_reason\",event_source=~\"$event_source\",event_type=~\"$event_type\"}) by ($group,$group2)",
          "format": "time_series",
          "hide": false,
          "intervalFactor": 1,
          "legendFormat": "{{ $group }} {{ $group2 }}",
          "refId": "A"
        },
        {
          "expr": "count(kubernetes_pod_container_cpu_usage_nanocores{kcluster=\"$kcluster\",namespace=~\"$event_namespace\",node_name=~\"$node\"})",
          "format": "time_series",
          "hide": false,
          "interval": "",
          "intervalFactor": 1,
          "legendFormat": "pods number",
          "refId": "B"
        },
        {
          "expr": "kubernetes_pod_container_cpu_usage_nanocores{kcluster=\"$kcluster\",namespace=~\"$event_namespace\",node_name=~\"$node\"}",
          "format": "time_series",
          "hide": true,
          "intervalFactor": 1,
          "legendFormat": "",
          "refId": "C"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "K8s events",
      "tooltip": {
        "shared": true,
        "sort": 2,
        "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
      }
    }
  ],
  "refresh": false,
  "schemaVersion": 26,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "event_kind",
          "value": "event_kind"
        },
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "group",
        "options": [
          {
            "selected": false,
            "text": "environment",
            "value": "environment"
          },
          {
            "selected": true,
            "text": "event_kind",
            "value": "event_kind"
          },
          {
            "selected": false,
            "text": "event_namespace",
            "value": "event_namespace"
          },
          {
            "selected": false,
            "text": "event_name",
            "value": "event_name"
          },
          {
            "selected": false,
            "text": "event_reason",
            "value": "event_reason"
          },
          {
            "selected": false,
            "text": "event_source",
            "value": "event_source"
          },
          {
            "selected": false,
            "text": "event_type",
            "value": "event_type"
          }
        ],
        "query": "environment,event_kind,event_namespace,event_name,event_reason,event_source,event_type",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": null,
        "current": {
          "selected": true,
          "text": "event_reason",
          "value": "event_reason"
        },
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "group2",
        "options": [
          {
            "selected": false,
            "text": "environment",
            "value": "environment"
          },
          {
            "selected": false,
            "text": "event_kind",
            "value": "event_kind"
          },
          {
            "selected": false,
            "text": "event_namespace",
            "value": "event_namespace"
          },
          {
            "selected": false,
            "text": "event_name",
            "value": "event_name"
          },
          {
            "selected": true,
            "text": "event_reason",
            "value": "event_reason"
          },
          {
            "selected": false,
            "text": "event_source",
            "value": "event_source"
          },
          {
            "selected": false,
            "text": "event_type",
            "value": "event_type"
          }
        ],
        "query": "environment,event_kind,event_namespace,event_name,event_reason,event_source,event_type",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": null,
        "current": {
          "isNone": true,
          "selected": false,
          "text": "None",
          "value": ""
        },
        "datasource": "Prometheus",
        "definition": "label_values(kubernetes_events,kcluster)",
        "hide": 0,
        "includeAll": false,
        "label": null,
        "multi": false,
        "name": "kcluster",
        "options": [],
        "query": "label_values(kubernetes_events,kcluster)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": "Prometheus",
        "definition": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_namespace)",
        "hide": 0,
        "includeAll": true,
        "label": "namespace",
        "multi": true,
        "name": "event_namespace",
        "options": [],
        "query": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_namespace)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": "Prometheus",
        "definition": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_kind)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "event_kind",
        "options": [],
        "query": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_kind)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": "Prometheus",
        "definition": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_name)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "event_name",
        "options": [],
        "query": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_name)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": "Prometheus",
        "definition": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_reason)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "event_reason",
        "options": [],
        "query": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_reason)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {
          "selected": true,
          "text": "All",
          "value": [
            "$__all"
          ]
        },
        "datasource": "Prometheus",
        "definition": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_source)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "event_source",
        "options": [],
        "query": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_source)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": "Prometheus",
        "definition": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_type)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "event_type",
        "options": [],
        "query": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_type)",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": ".*",
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": "Prometheus",
        "definition": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_source)",
        "hide": 0,
        "includeAll": true,
        "label": null,
        "multi": true,
        "name": "node",
        "options": [],
        "query": "label_values(kubernetes_events{kcluster=\"$kcluster\"},event_source)",
        "refresh": 1,
        "regex": "(.*)/.*",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-3h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "Kubernetes events",
  "uid": "FphTvZuZz",
  "version": 7
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants