From 84ec188cb2260f2ac46c3e7d7a5c77ce9d8134ba Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Wed, 2 Oct 2024 16:05:06 -0300 Subject: [PATCH 01/11] Add opensource manifest --- .../amg_grafana-amp-datasource.yaml | 22 ++++++ .../opensource/amg_grafana-dashboards.yaml | 71 +++++++++++++++++++ .../eks/opensource/amg_grafana-identity.yaml | 13 ++++ .../eks/opensource/kustomization.yaml | 6 ++ 4 files changed, 112 insertions(+) create mode 100644 artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-amp-datasource.yaml create mode 100644 artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-dashboards.yaml create mode 100644 artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-identity.yaml create mode 100644 artifacts/grafana-operator-manifests/eks/opensource/kustomization.yaml diff --git a/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-amp-datasource.yaml b/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-amp-datasource.yaml new file mode 100644 index 0000000..86def3c --- /dev/null +++ b/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-amp-datasource.yaml @@ -0,0 +1,22 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDatasource +metadata: + name: grafanadatasource-amp + namespace: grafana-operator +spec: + instanceSelector: + matchLabels: + dashboards: "external-grafana" + datasource: + name: aws-observability-accelerator + type: prometheus + access: proxy + url: ${AMP_ENDPOINT_URL} + isDefault: true + jsonData: + 'tlsSkipVerify': false + 'timeInterval': "5s" + 'sigV4Auth': true + 'sigV4AuthType': "ec2_iam_role" + 'sigV4Region': ${AMG_AWS_REGION} + editable: true diff --git a/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-dashboards.yaml b/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-dashboards.yaml new file mode 100644 index 0000000..3a8f152 --- /dev/null +++ b/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-dashboards.yaml @@ -0,0 +1,71 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: cluster-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: ${GRAFANA_CLUSTER_DASH_URL} +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: kubelet-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: ${GRAFANA_KUBELET_DASH_URL} +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: namespace-workloads-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: ${GRAFANA_NSWRKLDS_DASH_URL} +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: node-exporter-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: ${GRAFANA_NODEEXP_DASH_URL} +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: nodes-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: ${GRAFANA_NODES_DASH_URL} +--- +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: workloads-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: ${GRAFANA_WORKLOADS_DASH_URL} diff --git a/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-identity.yaml b/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-identity.yaml new file mode 100644 index 0000000..8500e76 --- /dev/null +++ b/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-identity.yaml @@ -0,0 +1,13 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: Grafana +metadata: + name: external-grafana + namespace: grafana-operator + labels: + dashboards: "external-grafana" +spec: + external: + url: ${AMG_ENDPOINT_URL} + apiKey: + name: grafana-admin-credentials + key: GF_SECURITY_ADMIN_APIKEY diff --git a/artifacts/grafana-operator-manifests/eks/opensource/kustomization.yaml b/artifacts/grafana-operator-manifests/eks/opensource/kustomization.yaml new file mode 100644 index 0000000..a97da5a --- /dev/null +++ b/artifacts/grafana-operator-manifests/eks/opensource/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - amg_grafana-identity.yaml + - amg_grafana-amp-datasource.yaml + - amg_grafana-dashboards.yaml From bf509c1d1893f67eb47d2071096ed1580ac3212f Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 19 Nov 2024 09:43:18 -0300 Subject: [PATCH 02/11] Filter dashboards to OpenSearch only --- .../opensearch/amg_grafana-dashboards.yaml | 12 ++++ .../kustomization.yaml | 2 - .../amg_grafana-amp-datasource.yaml | 22 ------ .../opensource/amg_grafana-dashboards.yaml | 71 ------------------- .../eks/opensource/amg_grafana-identity.yaml | 13 ---- 5 files changed, 12 insertions(+), 108 deletions(-) create mode 100644 artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-dashboards.yaml rename artifacts/grafana-operator-manifests/eks/{opensource => opensearch}/kustomization.yaml (61%) delete mode 100644 artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-amp-datasource.yaml delete mode 100644 artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-dashboards.yaml delete mode 100644 artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-identity.yaml diff --git a/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-dashboards.yaml b/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-dashboards.yaml new file mode 100644 index 0000000..4d1373a --- /dev/null +++ b/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-dashboards.yaml @@ -0,0 +1,12 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDashboard +metadata: + name: opensearch-logs-grafanadashboard + namespace: grafana-operator +spec: + folder: "Observability Accelerator Dashboards" + instanceSelector: + matchLabels: + dashboards: "external-grafana" + url: ${GRAFANA_OPENSEARCH_LOGS_DASH_URL} + diff --git a/artifacts/grafana-operator-manifests/eks/opensource/kustomization.yaml b/artifacts/grafana-operator-manifests/eks/opensearch/kustomization.yaml similarity index 61% rename from artifacts/grafana-operator-manifests/eks/opensource/kustomization.yaml rename to artifacts/grafana-operator-manifests/eks/opensearch/kustomization.yaml index a97da5a..85a7882 100644 --- a/artifacts/grafana-operator-manifests/eks/opensource/kustomization.yaml +++ b/artifacts/grafana-operator-manifests/eks/opensearch/kustomization.yaml @@ -1,6 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - amg_grafana-identity.yaml - - amg_grafana-amp-datasource.yaml - amg_grafana-dashboards.yaml diff --git a/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-amp-datasource.yaml b/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-amp-datasource.yaml deleted file mode 100644 index 86def3c..0000000 --- a/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-amp-datasource.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDatasource -metadata: - name: grafanadatasource-amp - namespace: grafana-operator -spec: - instanceSelector: - matchLabels: - dashboards: "external-grafana" - datasource: - name: aws-observability-accelerator - type: prometheus - access: proxy - url: ${AMP_ENDPOINT_URL} - isDefault: true - jsonData: - 'tlsSkipVerify': false - 'timeInterval': "5s" - 'sigV4Auth': true - 'sigV4AuthType': "ec2_iam_role" - 'sigV4Region': ${AMG_AWS_REGION} - editable: true diff --git a/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-dashboards.yaml b/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-dashboards.yaml deleted file mode 100644 index 3a8f152..0000000 --- a/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-dashboards.yaml +++ /dev/null @@ -1,71 +0,0 @@ -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDashboard -metadata: - name: cluster-grafanadashboard - namespace: grafana-operator -spec: - folder: "Observability Accelerator Dashboards" - instanceSelector: - matchLabels: - dashboards: "external-grafana" - url: ${GRAFANA_CLUSTER_DASH_URL} ---- -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDashboard -metadata: - name: kubelet-grafanadashboard - namespace: grafana-operator -spec: - folder: "Observability Accelerator Dashboards" - instanceSelector: - matchLabels: - dashboards: "external-grafana" - url: ${GRAFANA_KUBELET_DASH_URL} ---- -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDashboard -metadata: - name: namespace-workloads-grafanadashboard - namespace: grafana-operator -spec: - folder: "Observability Accelerator Dashboards" - instanceSelector: - matchLabels: - dashboards: "external-grafana" - url: ${GRAFANA_NSWRKLDS_DASH_URL} ---- -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDashboard -metadata: - name: node-exporter-grafanadashboard - namespace: grafana-operator -spec: - folder: "Observability Accelerator Dashboards" - instanceSelector: - matchLabels: - dashboards: "external-grafana" - url: ${GRAFANA_NODEEXP_DASH_URL} ---- -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDashboard -metadata: - name: nodes-grafanadashboard - namespace: grafana-operator -spec: - folder: "Observability Accelerator Dashboards" - instanceSelector: - matchLabels: - dashboards: "external-grafana" - url: ${GRAFANA_NODES_DASH_URL} ---- -apiVersion: grafana.integreatly.org/v1beta1 -kind: GrafanaDashboard -metadata: - name: workloads-grafanadashboard - namespace: grafana-operator -spec: - folder: "Observability Accelerator Dashboards" - instanceSelector: - matchLabels: - dashboards: "external-grafana" - url: ${GRAFANA_WORKLOADS_DASH_URL} diff --git a/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-identity.yaml b/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-identity.yaml deleted file mode 100644 index 8500e76..0000000 --- a/artifacts/grafana-operator-manifests/eks/opensource/amg_grafana-identity.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: grafana.integreatly.org/v1beta1 -kind: Grafana -metadata: - name: external-grafana - namespace: grafana-operator - labels: - dashboards: "external-grafana" -spec: - external: - url: ${AMG_ENDPOINT_URL} - apiKey: - name: grafana-admin-credentials - key: GF_SECURITY_ADMIN_APIKEY From a207f6a2074d580dc709d5842ec72d2bea1ce808 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 19 Nov 2024 10:21:10 -0300 Subject: [PATCH 03/11] Add OpenSearch Logs dashboard --- .../eks/opensearch/opensearch-logs.json | 1163 +++++++++++++++++ 1 file changed, 1163 insertions(+) create mode 100644 artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json diff --git a/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json b/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json new file mode 100644 index 0000000..e516345 --- /dev/null +++ b/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json @@ -0,0 +1,1163 @@ +{ + "__inputs": [ + { + "name": "DS_AMAZON_OPENSEARCH", + "label": "Amazon OpenSearch", + "description": "", + "type": "datasource", + "pluginId": "grafana-opensearch-datasource", + "pluginName": "OpenSearch" + }, + { + "name": "DS_AMP", + "label": "AMP", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.4.1" + }, + { + "type": "datasource", + "id": "grafana-opensearch-datasource", + "name": "OpenSearch", + "version": "2.19.1" + }, + { + "type": "panel", + "id": "logs", + "name": "Logs", + "version": "" + }, + { + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 1, + "id": null, + "links": [], + "panels": [ + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 12, + "title": "summary", + "type": "row" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 0, + "y": 1 + }, + "id": 10, + "options": { + "legend": { + "displayMode": "list", + "placement": "right", + "showLegend": false, + "values": [ + "value" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "sum" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "resource.attributes.k8s@namespace@name.keyword", + "id": "3", + "settings": { + "min_doc_count": "1", + "order": "desc", + "orderBy": "_term", + "size": "10" + }, + "type": "terms" + }, + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "format": "table", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "body:[* TO *]", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Log Count per Namespace", + "type": "piechart" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "log": 2, + "type": "log" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 8, + "x": 4, + "y": 1 + }, + "id": 5, + "maxDataPoints": 100, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "resource.attributes.k8s@namespace@name.keyword", + "id": "3", + "settings": { + "min_doc_count": "1", + "order": "desc", + "orderBy": "_term", + "size": "10" + }, + "type": "terms" + }, + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "format": "table", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "body:[* TO *]", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Log Count per Namespace", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 48, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 12, + "y": 1 + }, + "id": 8, + "maxDataPoints": 100, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "resource.attributes.k8s@pod@name.keyword", + "id": "3", + "settings": { + "min_doc_count": "1", + "order": "desc", + "orderBy": "_term", + "size": "10" + }, + "type": "terms" + }, + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "format": "table", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "resource.attributes.k8s@namespace@name:\"$namespace\"\nAND body:[* TO *]", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Log Count per Pod", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 6, + "x": 18, + "y": 1 + }, + "id": 9, + "maxDataPoints": 100, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "resource.attributes.k8s@container@name.keyword", + "id": "3", + "settings": { + "min_doc_count": "1", + "order": "desc", + "orderBy": "_term", + "size": "10" + }, + "type": "terms" + }, + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "format": "table", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "resource.attributes.k8s@namespace@name:\"$namespace\" AND resource.attributes.k8s@pod@name:\"$pod\"\nAND body:[* TO *]", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Log Count per Container", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 6 + }, + "id": 6, + "panels": [], + "title": "$namespace / $pod / $container", + "type": "row" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 7 + }, + "id": 4, + "options": { + "dedupStrategy": "numbers", + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": false, + "showLabels": false, + "showTime": false, + "sortOrder": "Descending", + "wrapLogMessage": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "format": "table", + "metrics": [ + { + "id": "1", + "type": "logs" + } + ], + "query": "resource.attributes.k8s@namespace@name:\"$namespace\"\nAND resource.attributes.k8s@pod@name:\"$pod\"\nAND resource.attributes.k8s@container@name:\"$container\"\nAND body:[* TO *]", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Logs", + "type": "logs" + }, + { + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "Count" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Count" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 7 + }, + "id": 11, + "maxDataPoints": 100, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "field": "@timestamp", + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "grafana-opensearch-datasource", + "uid": "${DS_AMAZON_OPENSEARCH}" + }, + "format": "table", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "resource.attributes.k8s@namespace@name:\"$namespace\"\nAND resource.attributes.k8s@pod@name:\"$pod\"\nAND resource.attributes.k8s@container@name:\"$container\"\nAND body:[* TO *]", + "queryType": "lucene", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Log Count", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_AMP}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "CPU usage" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 12, + "y": 13 + }, + "id": 1, + "maxDataPoints": 100, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_AMP}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(rate(container_cpu_usage_seconds_total{namespace=\"$namespace\", pod=\"$pod\", container=\"$container\"}[5m])) by (container)", + "format": "table", + "instant": false, + "legendFormat": "{{container}}", + "range": true, + "refId": "A" + } + ], + "title": "CPU Usage", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_AMP}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Memory Usage" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "sum(container_memory_usage_bytes{namespace=\"default\", pod=\"my-otel-demo-productcatalogservice-7c476d6cfc-w8qrs\", container=\"productcatalogservice\"})" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 18, + "y": 13 + }, + "id": 2, + "maxDataPoints": 100, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_AMP}" + }, + "disableTextWrap": false, + "editorMode": "builder", + "expr": "sum by(container) (container_memory_usage_bytes{namespace=\"$namespace\", pod=\"$pod\", container=\"$container\"})", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "{{container}}", + "range": true, + "refId": "A", + "useBackend": false + } + ], + "title": "Memory Usage", + "type": "timeseries" + } + ], + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": "AMP", + "value": "fdu7xex1t85q8c" + }, + "hide": 0, + "includeAll": false, + "label": "AMP", + "multi": false, + "name": "amp_datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "selected": true, + "text": "Amazon OpenSearch", + "value": "bdu7z6cnnfitcf" + }, + "hide": 0, + "includeAll": false, + "label": "OpenSearch", + "multi": false, + "name": "opensearch_datasource", + "options": [], + "query": "grafana-opensearch-datasource", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_AMP}" + }, + "definition": "label_values(namespace)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "namespace", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(namespace)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_AMP}" + }, + "definition": "label_values({namespace=~\"$namespace\"},pod)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "pod", + "options": [], + "query": { + "qryType": 1, + "query": "label_values({namespace=~\"$namespace\"},pod)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_AMP}" + }, + "definition": "label_values({namespace=~\"$namespace\", pod=~\"$pod\"},container)", + "hide": 0, + "includeAll": false, + "multi": false, + "name": "container", + "options": [], + "query": { + "qryType": 1, + "query": "label_values({namespace=~\"$namespace\", pod=~\"$pod\"},container)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Kubernetes / Logs and Metrics", + "uid": "ae4f3fayxjvnkf", + "version": 6, + "weekStart": "" +} \ No newline at end of file From 1cb3a686f3fb573b3c07fbc69814f782a5fb06e7 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 19 Nov 2024 10:23:40 -0300 Subject: [PATCH 04/11] Remove additional configuration from OpenSearch dashboard --- .../eks/opensearch/opensearch-logs.json | 57 ------------------- 1 file changed, 57 deletions(-) diff --git a/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json b/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json index e516345..d1ccdd1 100644 --- a/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json +++ b/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json @@ -1,61 +1,4 @@ { - "__inputs": [ - { - "name": "DS_AMAZON_OPENSEARCH", - "label": "Amazon OpenSearch", - "description": "", - "type": "datasource", - "pluginId": "grafana-opensearch-datasource", - "pluginName": "OpenSearch" - }, - { - "name": "DS_AMP", - "label": "AMP", - "description": "", - "type": "datasource", - "pluginId": "prometheus", - "pluginName": "Prometheus" - } - ], - "__elements": {}, - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "10.4.1" - }, - { - "type": "datasource", - "id": "grafana-opensearch-datasource", - "name": "OpenSearch", - "version": "2.19.1" - }, - { - "type": "panel", - "id": "logs", - "name": "Logs", - "version": "" - }, - { - "type": "panel", - "id": "piechart", - "name": "Pie chart", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "timeseries", - "name": "Time series", - "version": "" - } - ], "annotations": { "list": [ { From c7920b22cec04ae5775f5af3a3415e35f86bdae2 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 19 Nov 2024 19:49:03 -0300 Subject: [PATCH 05/11] Fix opensearch dashboard variables --- .../eks/opensearch/opensearch-logs.json | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json b/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json index d1ccdd1..8a7de21 100644 --- a/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json +++ b/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json @@ -35,7 +35,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "fieldConfig": { "defaults": { @@ -108,7 +108,7 @@ ], "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "format": "table", "metrics": [ @@ -129,7 +129,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "fieldConfig": { "defaults": { @@ -232,7 +232,7 @@ ], "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "format": "table", "metrics": [ @@ -253,7 +253,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "fieldConfig": { "defaults": { @@ -355,7 +355,7 @@ ], "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "format": "table", "metrics": [ @@ -376,7 +376,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "fieldConfig": { "defaults": { @@ -478,7 +478,7 @@ ], "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "format": "table", "metrics": [ @@ -512,7 +512,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "gridPos": { "h": 12, @@ -547,7 +547,7 @@ ], "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "format": "table", "metrics": [ @@ -568,7 +568,7 @@ { "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "fieldConfig": { "defaults": { @@ -699,7 +699,7 @@ ], "datasource": { "type": "grafana-opensearch-datasource", - "uid": "${DS_AMAZON_OPENSEARCH}" + "uid": "${opensearch_datasource}" }, "format": "table", "metrics": [ @@ -720,7 +720,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_AMP}" + "uid": "${amp_datasource}" }, "fieldConfig": { "defaults": { @@ -832,7 +832,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_AMP}" + "uid": "${amp_datasource}" }, "editorMode": "code", "exemplar": false, @@ -850,7 +850,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_AMP}" + "uid": "${amp_datasource}" }, "fieldConfig": { "defaults": { @@ -962,7 +962,7 @@ { "datasource": { "type": "prometheus", - "uid": "${DS_AMP}" + "uid": "${amp_datasource}" }, "disableTextWrap": false, "editorMode": "builder", @@ -986,9 +986,7 @@ "list": [ { "current": { - "selected": true, - "text": "AMP", - "value": "fdu7xex1t85q8c" + "selected": false }, "hide": 0, "includeAll": false, @@ -1005,7 +1003,7 @@ }, { "current": { - "selected": true, + "selected": false, "text": "Amazon OpenSearch", "value": "bdu7z6cnnfitcf" }, @@ -1026,7 +1024,7 @@ "current": {}, "datasource": { "type": "prometheus", - "uid": "${DS_AMP}" + "uid": "${amp_datasource}" }, "definition": "label_values(namespace)", "hide": 0, @@ -1049,7 +1047,7 @@ "current": {}, "datasource": { "type": "prometheus", - "uid": "${DS_AMP}" + "uid": "${amp_datasource}" }, "definition": "label_values({namespace=~\"$namespace\"},pod)", "hide": 0, @@ -1072,7 +1070,7 @@ "current": {}, "datasource": { "type": "prometheus", - "uid": "${DS_AMP}" + "uid": "${amp_datasource}" }, "definition": "label_values({namespace=~\"$namespace\", pod=~\"$pod\"},container)", "hide": 0, From 0dbfe77df3c644e9846633734dcb0001f0e06a8e Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 19 Nov 2024 20:19:06 -0300 Subject: [PATCH 06/11] Review annotation configuration --- .../eks/opensearch/opensearch-logs.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json b/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json index 8a7de21..c0ce32f 100644 --- a/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json +++ b/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json @@ -3,14 +3,17 @@ "list": [ { "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, + "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, "type": "dashboard" } ] From ba5f1e12d8a17de7b89d615229faa3b4376b5701 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 19 Nov 2024 21:59:58 -0300 Subject: [PATCH 07/11] Add OpenSearch datasource --- .../amg_grafana-opensearch-datasource.yaml | 29 +++++++++++++++++++ .../eks/opensearch/kustomization.yaml | 1 + 2 files changed, 30 insertions(+) create mode 100644 artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml diff --git a/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml b/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml new file mode 100644 index 0000000..9988e49 --- /dev/null +++ b/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml @@ -0,0 +1,29 @@ +apiVersion: grafana.integreatly.org/v1beta1 +kind: GrafanaDatasource +metadata: + name: grafanadatasource-opensearch + namespace: grafana-operator +spec: + instanceSelector: + matchLabels: + dashboards: "external-grafana" + datasource: + name: aws-observability-accelerator-opensearch + type: opensearch + access: proxy + url: ${OPENSEARCH_DOMAIN_URL} + isDefault: false + jsonData: + 'flavor': "opensearch" + 'logLevelField': "severityText" + 'logMessageField': "body" + 'maxConcurrentShardRequests': "20" + 'pplEnabled': true + 'serverless': false + 'sigV4Auth': true + 'sigV4AuthType': "ec2_iam_role" + 'sigV4Region': ${AMG_AWS_REGION} + 'timeField': "@timestamp" + 'version': "2.15.0" + 'versionLabel': "OpenSearch 2.15.0" + editable: true diff --git a/artifacts/grafana-operator-manifests/eks/opensearch/kustomization.yaml b/artifacts/grafana-operator-manifests/eks/opensearch/kustomization.yaml index 85a7882..0d22ede 100644 --- a/artifacts/grafana-operator-manifests/eks/opensearch/kustomization.yaml +++ b/artifacts/grafana-operator-manifests/eks/opensearch/kustomization.yaml @@ -1,4 +1,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: + - amg_grafana-opensearch-datasource.yaml - amg_grafana-dashboards.yaml From b9b5d36fbcdb4cd1069c6fcca0e905dda4286906 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 19 Nov 2024 22:13:57 -0300 Subject: [PATCH 08/11] Fix os datasource type --- .../eks/opensearch/amg_grafana-opensearch-datasource.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml b/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml index 9988e49..05f49ef 100644 --- a/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml +++ b/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml @@ -9,7 +9,8 @@ spec: dashboards: "external-grafana" datasource: name: aws-observability-accelerator-opensearch - type: opensearch + type: grafana-opensearch-datasource + typeName: OpenSearch access: proxy url: ${OPENSEARCH_DOMAIN_URL} isDefault: false From 57442943abdd72cc00573ad4676242215acdfafe Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 19 Nov 2024 22:33:45 -0300 Subject: [PATCH 09/11] Remove os ds typeName field --- .../eks/opensearch/amg_grafana-opensearch-datasource.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml b/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml index 05f49ef..ceaab84 100644 --- a/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml +++ b/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml @@ -10,7 +10,6 @@ spec: datasource: name: aws-observability-accelerator-opensearch type: grafana-opensearch-datasource - typeName: OpenSearch access: proxy url: ${OPENSEARCH_DOMAIN_URL} isDefault: false From 38947dd72e69abb7027052b9bfbe96a494190387 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 19 Nov 2024 23:10:32 -0300 Subject: [PATCH 10/11] Adapt queries to FluentBit field names --- .../eks/opensearch/opensearch-logs.json | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json b/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json index c0ce32f..bed8370 100644 --- a/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json +++ b/artifacts/grafana-dashboards/eks/opensearch/opensearch-logs.json @@ -90,7 +90,7 @@ "alias": "", "bucketAggs": [ { - "field": "resource.attributes.k8s@namespace@name.keyword", + "field": "kubernetes.namespace_name.keyword", "id": "3", "settings": { "min_doc_count": "1", @@ -120,7 +120,7 @@ "type": "count" } ], - "query": "body:[* TO *]", + "query": "", "queryType": "lucene", "refId": "A", "timeField": "@timestamp" @@ -214,7 +214,7 @@ "alias": "", "bucketAggs": [ { - "field": "resource.attributes.k8s@namespace@name.keyword", + "field": "kubernetes.namespace_name.keyword", "id": "3", "settings": { "min_doc_count": "1", @@ -244,7 +244,7 @@ "type": "count" } ], - "query": "body:[* TO *]", + "query": "", "queryType": "lucene", "refId": "A", "timeField": "@timestamp" @@ -337,7 +337,7 @@ "alias": "", "bucketAggs": [ { - "field": "resource.attributes.k8s@pod@name.keyword", + "field": "kubernetes.pod_name.keyword", "id": "3", "settings": { "min_doc_count": "1", @@ -367,7 +367,7 @@ "type": "count" } ], - "query": "resource.attributes.k8s@namespace@name:\"$namespace\"\nAND body:[* TO *]", + "query": "kubernetes.namespace_name:\"$namespace\"", "queryType": "lucene", "refId": "A", "timeField": "@timestamp" @@ -460,7 +460,7 @@ "alias": "", "bucketAggs": [ { - "field": "resource.attributes.k8s@container@name.keyword", + "field": "kubernetes.container_name.keyword", "id": "3", "settings": { "min_doc_count": "1", @@ -490,7 +490,7 @@ "type": "count" } ], - "query": "resource.attributes.k8s@namespace@name:\"$namespace\" AND resource.attributes.k8s@pod@name:\"$pod\"\nAND body:[* TO *]", + "query": "kubernetes.namespace_name:\"$namespace\" AND kubernetes.pod_name:\"$pod\"", "queryType": "lucene", "refId": "A", "timeField": "@timestamp" @@ -559,7 +559,7 @@ "type": "logs" } ], - "query": "resource.attributes.k8s@namespace@name:\"$namespace\"\nAND resource.attributes.k8s@pod@name:\"$pod\"\nAND resource.attributes.k8s@container@name:\"$container\"\nAND body:[* TO *]", + "query": "kubernetes.namespace_name:\"$namespace\"\nAND kubernetes.pod_name:\"$pod\"\nAND kubernetes.container_name:\"$container\"", "queryType": "lucene", "refId": "A", "timeField": "@timestamp" @@ -711,7 +711,7 @@ "type": "count" } ], - "query": "resource.attributes.k8s@namespace@name:\"$namespace\"\nAND resource.attributes.k8s@pod@name:\"$pod\"\nAND resource.attributes.k8s@container@name:\"$container\"\nAND body:[* TO *]", + "query": "kubernetes.namespace_name:\"$namespace\"\nAND kubernetes.pod_name:\"$pod\"\nAND kubernetes.container_name:\"$container\"", "queryType": "lucene", "refId": "A", "timeField": "@timestamp" From c3dfc080a018c735d1e7f5edd7328d6d7da68cec Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Tue, 19 Nov 2024 23:20:18 -0300 Subject: [PATCH 11/11] Fix os ds log message field --- .../eks/opensearch/amg_grafana-opensearch-datasource.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml b/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml index ceaab84..2e07c52 100644 --- a/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml +++ b/artifacts/grafana-operator-manifests/eks/opensearch/amg_grafana-opensearch-datasource.yaml @@ -16,7 +16,7 @@ spec: jsonData: 'flavor': "opensearch" 'logLevelField': "severityText" - 'logMessageField': "body" + 'logMessageField': "log" 'maxConcurrentShardRequests': "20" 'pplEnabled': true 'serverless': false