apiVersion: v1 kind: ConfigMap metadata: name: grafana-datasources labels: app: grafana-stack data: prometheus.yaml: | apiVersion: 1 datasources: - name: Prometheus type: prometheus url: http://localhost:9009/prometheus --- apiVersion: v1 kind: ConfigMap metadata: name: mimir-config labels: app: grafana-stack data: mimir-local-config.yaml: | # Do not use this configuration in production. # It is for demonstration purposes only. multitenancy_enabled: false blocks_storage: backend: filesystem bucket_store: sync_dir: /tmp/mimir/tsdb-sync filesystem: dir: /tmp/mimir/data/tsdb tsdb: dir: /tmp/mimir/tsdb compactor: data_dir: /tmp/mimir/compactor sharding_ring: kvstore: store: memberlist distributor: ring: instance_addr: 127.0.0.1 kvstore: store: memberlist ingester: ring: instance_addr: 127.0.0.1 kvstore: store: memberlist replication_factor: 1 ruler_storage: backend: filesystem filesystem: dir: /tmp/mimir/rules server: http_listen_port: 9009 log_level: error store_gateway: sharding_ring: replication_factor: 1 --- apiVersion: v1 kind: ConfigMap metadata: name: otel-collector-config labels: app: grafana-stack data: config.yaml: | receivers: otlp: protocols: grpc: exporters: prometheusremotewrite: endpoint: http://127.0.0.1:9009/api/v1/push service: pipelines: metrics: receivers: [otlp] exporters: [prometheusremotewrite] --- apiVersion: v1 kind: ConfigMap metadata: name: grafana-datasources namespace: monitoring data: prometheus.yaml: |- { "apiVersion": 1, "datasources": [ { "access":"proxy", "editable": true, "name": "prometheus", "orgId": 1, "type": "prometheus", "url": "http://localhost:9009/prometheus", "version": 1 } ] } --- apiVersion: v1 kind: ConfigMap metadata: name: grafana-dashboards namespace: monitoring data: dashboard.yaml: |- { "apiVersion": 1, "providers": [ { "name":"eBPF Subsystem Metrics", "type":"file", "options": { "path": "/etc/grafana/provisioning/dashboards/ebpf-subsystem-metrics.json" } } ] } --- apiVersion: v1 kind: ConfigMap metadata: name: ebpf-subsystem-metrics-dashboard namespace: monitoring data: ebpf-subsystem-metrics.json: |- { "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": 0, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", "options": "bpf_programs {__name__=\"bpf_programs\", job=\"bpf-metrics-exporter\"}" }, "properties": [ { "id": "displayName", "value": "Programs" } ] }, { "matcher": { "id": "byName", "options": "{__name__=\"bpf_maps\", job=\"bpf-metrics-exporter\"}" }, "properties": [ { "id": "displayName", "value": "Maps" } ] }, { "matcher": { "id": "byName", "options": "{__name__=\"bpf_links\", job=\"bpf-metrics-exporter\"}" }, "properties": [ { "id": "displayName", "value": "Links" } ] } ] }, "gridPos": { "h": 8, "w": 24, "x": 0, "y": 0 }, "id": 1, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.2.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "disableTextWrap": false, "editorMode": "builder", "expr": "sum(bpf_program_info)", "fullMetaSearch": false, "includeNullMetadata": true, "instant": false, "legendFormat": "Programs", "range": true, "refId": "A", "useBackend": false }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "disableTextWrap": false, "editorMode": "builder", "expr": "sum(bpf_map_info)", "fullMetaSearch": false, "hide": false, "includeNullMetadata": true, "instant": false, "legendFormat": "Maps", "range": true, "refId": "B", "useBackend": false }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "disableTextWrap": false, "editorMode": "builder", "expr": "sum(bpf_link_info)", "fullMetaSearch": false, "hide": false, "includeNullMetadata": true, "instant": false, "legendFormat": "Links", "range": true, "refId": "C", "useBackend": false } ], "title": "Subsystem Entities", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "purple", "mode": "palette-classic" }, "custom": { "align": "auto", "cellOptions": { "mode": "gradient", "type": "color-background" }, "filterable": false, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 24, "x": 0, "y": 8 }, "id": 2, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 3, "showHeader": true, "sortBy": [] }, "pluginVersion": "10.2.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "disableTextWrap": false, "editorMode": "builder", "exemplar": false, "expr": "bpf_program_info", "fullMetaSearch": false, "includeNullMetadata": true, "instant": true, "legendFormat": "__auto", "range": false, "refId": "A", "useBackend": false } ], "title": "Loaded Program Info", "transformations": [ { "id": "reduce", "options": { "includeTimeField": true, "mode": "reduceFields", "reducers": [ "last" ] } }, { "id": "labelsToFields", "options": { "keepLabels": [ "gpl_compatible", "job", "load_time", "tag", "type", "name", "map_ids", "id" ], "mode": "columns" } }, { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true, "bpf_programs": true, "job": true }, "indexByName": { "Time": 0, "bpf_programs": 1, "gpl_compatible": 9, "id": 4, "job": 6, "load_time": 5, "map_ids": 7, "name": 2, "tag": 8, "type": 3 }, "renameByName": {} } }, { "id": "reduce", "options": { "includeTimeField": false, "mode": "reduceFields", "reducers": [] } } ], "transparent": true, "type": "table" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "purple", "mode": "palette-classic" }, "custom": { "align": "auto", "cellOptions": { "mode": "gradient", "type": "color-background" }, "filterable": false, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 24, "x": 0, "y": 14 }, "id": 6, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 3, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "load_time" } ] }, "pluginVersion": "10.2.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "disableTextWrap": false, "editorMode": "builder", "exemplar": false, "expr": "bpf_map_info", "fullMetaSearch": false, "includeNullMetadata": true, "instant": true, "legendFormat": "__auto", "range": false, "refId": "A", "useBackend": false } ], "title": "Loaded Map Info", "transformations": [ { "id": "reduce", "options": { "includeTimeField": true, "mode": "reduceFields", "reducers": [ "last" ] } }, { "id": "labelsToFields", "options": { "keepLabels": [ "flags", "id", "key_size", "max_entries", "name", "type", "value_size" ], "mode": "columns" } }, { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true, "bpf_maps": true, "bpf_programs": true, "job": true }, "indexByName": { "Time": 0, "bpf_maps": 4, "flags": 8, "id": 1, "key_size": 5, "max_entries": 7, "name": 2, "type": 3, "value_size": 6 }, "renameByName": {} } }, { "id": "reduce", "options": { "includeTimeField": false, "mode": "reduceFields", "reducers": [] } } ], "transparent": true, "type": "table" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "purple", "mode": "palette-classic" }, "custom": { "align": "auto", "cellOptions": { "mode": "gradient", "type": "color-background" }, "filterable": false, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 5, "w": 24, "x": 0, "y": 20 }, "id": 7, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 3, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "load_time" } ] }, "pluginVersion": "10.2.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "disableTextWrap": false, "editorMode": "builder", "exemplar": false, "expr": "bpf_link_info", "fullMetaSearch": false, "includeNullMetadata": true, "instant": true, "legendFormat": "__auto", "range": false, "refId": "A", "useBackend": false } ], "title": "Loaded Link Info", "transformations": [ { "id": "reduce", "options": { "includeTimeField": true, "mode": "reduceFields", "reducers": [ "last" ] } }, { "id": "labelsToFields", "options": { "keepLabels": [ "flags", "id", "key_size", "max_entries", "name", "type", "value_size", "prog_id" ], "mode": "columns" } }, { "id": "merge", "options": {} }, { "id": "organize", "options": { "excludeByName": { "Time": true, "bpf_links": true, "bpf_maps": true, "bpf_programs": true, "job": true }, "indexByName": { "Time": 0, "bpf_links": 4, "id": 2, "prog_id": 1, "type": 3 }, "renameByName": {} } }, { "id": "reduce", "options": { "includeTimeField": false, "mode": "reduceFields", "reducers": [] } } ], "transparent": true, "type": "table" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "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": "bytes" }, "overrides": [] }, "gridPos": { "h": 7, "w": 8, "x": 0, "y": 25 }, "id": 4, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "disableTextWrap": false, "editorMode": "builder", "expr": "sum by() (bpf_program_verified_instructions_total)", "fullMetaSearch": false, "includeNullMetadata": true, "instant": false, "legendFormat": "__auto", "range": true, "refId": "A", "useBackend": false } ], "title": "Verified Instructions Total", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "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": "bytes" }, "overrides": [] }, "gridPos": { "h": 7, "w": 8, "x": 8, "y": 25 }, "id": 5, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "disableTextWrap": false, "editorMode": "builder", "expr": "sum(bpf_program_size_translated_bytes_total)", "fullMetaSearch": false, "includeNullMetadata": true, "instant": false, "legendFormat": "__auto", "range": true, "refId": "A", "useBackend": false } ], "title": "Translated Bytes Total", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 4, "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": "bytes" }, "overrides": [] }, "gridPos": { "h": 7, "w": 8, "x": 16, "y": 25 }, "id": 3, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "P1809F7CD0C75ACF3" }, "disableTextWrap": false, "editorMode": "builder", "expr": "sum(bpf_program_mem_bytes_total)", "fullMetaSearch": false, "includeNullMetadata": false, "instant": false, "legendFormat": "__auto", "range": true, "refId": "A", "useBackend": false } ], "title": "Total Memory Locked by Bpf Programs", "type": "timeseries" } ], "refresh": "", "schemaVersion": 38, "tags": [], "templating": { "list": [] }, "time": { "from": "now-15m", "to": "now" }, "timepicker": {}, "timezone": "", "title": "eBPF Subsystem Metrics", "uid": "ce0664f5-8526-430a-aa32-832686caa496", "version": 1, "weekStart": "" } --- apiVersion: apps/v1 kind: Deployment metadata: name: grafana-stack labels: app: grafana-stack spec: replicas: 1 selector: matchLabels: app: grafana-stack template: metadata: labels: app: grafana-stack spec: containers: - name: otel-collector image: docker.io/otel/opentelemetry-collector-contrib:0.89.0 ports: - containerPort: 4317 hostPort: 4317 protocol: TCP volumeMounts: - mountPath: /etc/otelcol-contrib name: otel-collector-config readOnly: true - name: grafana image: docker.io/grafana/grafana:latest ports: - containerPort: 3000 hostPort: 3000 protocol: TCP volumeMounts: - mountPath: /var/lib/grafana name: grafana-data - mountPath: /etc/grafana/provisioning/datasources name: grafana-datasources readOnly: true - mountPath: /etc/grafana/provisioning/dashboards name: grafana-dashboards - mountPath: /etc/grafana/provisioning/dashboards/ebpf-subsystem-metrics.json name: ebpf-subsystem-metrics-dashboard subPath: ebpf-subsystem-metrics.json - name: mimir image: docker.io/grafana/mimir:latest args: - --config.file=/mnt/config/mimir-local-config.yaml ports: - containerPort: 9009 hostPort: 9009 protocol: TCP - containerPort: 9095 hostPort: 9095 protocol: TCP volumeMounts: - mountPath: /tmp/mimir name: mimir-data - mountPath: /mnt/config name: mimir-config readOnly: true volumes: - name: grafana-data emptyDir: {} - name: grafana-datasources configMap: name: grafana-datasources - name: grafana-dashboards configMap: name: grafana-dashboards - name: ebpf-subsystem-metrics-dashboard configMap: name: ebpf-subsystem-metrics-dashboard - name: mimir-data emptyDir: {} - name: mimir-config configMap: name: mimir-config - name: otel-collector-config configMap: name: otel-collector-config