Monitoring Dashboards API

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Operations for version Current of Genesys Multicloud CX Private Edition.


Learn about Cloud Monitoring API used to create dashboards, update existing dashboards or delete dashboards.

The Cloud Monitoring API provides a resource called projects.dashboards which offers a familiar set of methods: create, delete, get, list, and patch.

Create  

POST https://monitoring.googleapis.com/v1/{parent}/dashboards

Delete

DELETE https://monitoring.googleapis.com/v1/{name}

GET

GET https://monitoring.googleapis.com/v1/{name}

List

GET https://monitoring.googleapis.com/v1/{parent}/dashboards

Patch

PATCH https://monitoring.googleapis.com/v1/{dashboard.name}

Here is an example:

https://content-monitoring.googleapis.com/v1/projects/<cluster>/dashboards

Errors in Logs Dashboard: Using this example, you can find errors in logs.
{
  "category": "CUSTOM",
  "displayName": "Errors in Logs Dashboard",
  "mosaicLayout": {
    "columns": 12,
    "tiles": [
      {
        "height": 4,
        "widget": {
          "alertChart": {
            "name": "projects/<cluster>/alertPolicies/1502724684856373513"
          }
        },
        "width": 6,
        "xPos": 0,
        "yPos": 0
      },
      {
        "height": 4,
        "widget": {
          "title": "logging/user/Kubernetes-container-error-logs [SUM]",
          "xyChart": {
            "chartOptions": {
              "mode": "COLOR"
            },
            "dataSets": [
              {
                "minAlignmentPeriod": "60s",
                "plotType": "STACKED_BAR",
                "targetAxis": "Y1",
                "timeSeriesQuery": {
                  "apiSource": "DEFAULT_CLOUD",
                  "timeSeriesFilter": {
                    "aggregation": {
                      "alignmentPeriod": "60s",
                      "crossSeriesReducer": "REDUCE_NONE",
                      "perSeriesAligner": "ALIGN_RATE"
                    },
                    "filter": "metric.type=\"logging.googleapis.com/user/Kubernetes-container-error-logs\" resource.type=\"k8s_container\"",
                    "secondaryAggregation": {
                      "alignmentPeriod": "60s",
                      "crossSeriesReducer": "REDUCE_SUM",
                      "groupByFields": [
                        "resource.label.\"pod_name\""
                      ],
                      "perSeriesAligner": "ALIGN_NONE"
                    }
                  }
                }
              }
            ],
            "timeshiftDuration": "0s",
            "yAxis": {
              "label": "y1Axis",
              "scale": "LINEAR"
            }
          }
        },
        "width": 6,
        "xPos": 6,
        "yPos": 0
      },
      {
        "height": 4,
        "widget": {
          "timeSeriesTable": {
            "dataSets": [
              {
                "minAlignmentPeriod": "60s",
                "tableDisplayOptions": {},
                "timeSeriesQuery": {
                  "timeSeriesFilter": {
                    "aggregation": {
                      "alignmentPeriod": "60s",
                      "crossSeriesReducer": "REDUCE_NONE",
                      "perSeriesAligner": "ALIGN_RATE"
                    },
                    "filter": "metric.type=\"logging.googleapis.com/user/Kubernetes-container-error-logs\" resource.type=\"k8s_container\" resource.label.\"namespace_name\"!=\"kube-system\"",
                    "secondaryAggregation": {
                      "alignmentPeriod": "60s",
                      "crossSeriesReducer": "REDUCE_MAX",
                      "groupByFields": [
                        "resource.label.\"pod_name\""
                      ],
                      "perSeriesAligner": "ALIGN_MAX"
                    }
                  }
                }
              }
            ]
          },
          "title": "logging/user/Kubernetes-container-error-logs (filtered) [99TH PERCENTILE]"
        },
        "width": 6,
        "xPos": 0,
        "yPos": 4
      }
    ]
  }
}