diff --git a/.integrationTests/Oma.WndwCtrl.Core.IntegrationTests/Executors/Commands/CliCommandExecutorTests.cs b/.integrationTests/Oma.WndwCtrl.Core.IntegrationTests/Executors/Commands/CliCommandExecutorTests.cs index 0a1a8e1..4e2038e 100644 --- a/.integrationTests/Oma.WndwCtrl.Core.IntegrationTests/Executors/Commands/CliCommandExecutorTests.cs +++ b/.integrationTests/Oma.WndwCtrl.Core.IntegrationTests/Executors/Commands/CliCommandExecutorTests.cs @@ -1,6 +1,8 @@ using FluentAssertions; using FluentAssertions.Execution; using LanguageExt; +using Microsoft.Extensions.Logging; +using NSubstitute; using Oma.WndwCtrl.Abstractions.Errors; using Oma.WndwCtrl.Abstractions.Extensions; using Oma.WndwCtrl.Abstractions.Model; @@ -14,7 +16,9 @@ public sealed class CliCommandExecutorTests : IDisposable { private const string DEFAULT_OUTPUT_TEXT = "Hello World!"; - private readonly CliCommandExecutor _instance = new(); + private static readonly ILogger _logger = Substitute.For>(); + + private readonly CliCommandExecutor _instance = new(_logger); private readonly CancellationToken _xunitCancelToken = TestContext.Current.CancellationToken; private Either? _result; diff --git a/.integrationTests/Oma.WndwCtrl.Core.IntegrationTests/Oma.WndwCtrl.Core.IntegrationTests.csproj b/.integrationTests/Oma.WndwCtrl.Core.IntegrationTests/Oma.WndwCtrl.Core.IntegrationTests.csproj index 7180680..b825929 100644 --- a/.integrationTests/Oma.WndwCtrl.Core.IntegrationTests/Oma.WndwCtrl.Core.IntegrationTests.csproj +++ b/.integrationTests/Oma.WndwCtrl.Core.IntegrationTests/Oma.WndwCtrl.Core.IntegrationTests.csproj @@ -11,6 +11,7 @@ + diff --git a/Dashboards/Acaad.Monitoring.json b/Dashboards/Acaad.Monitoring.json index 1745673..0538b2c 100644 --- a/Dashboards/Acaad.Monitoring.json +++ b/Dashboards/Acaad.Monitoring.json @@ -1,4 +1,67 @@ { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + }, + { + "name": "DS_LOKI", + "label": "loki", + "description": "", + "type": "datasource", + "pluginId": "loki", + "pluginName": "Loki" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "11.4.0" + }, + { + "type": "datasource", + "id": "loki", + "name": "Loki", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], "annotations": { "list": [ { @@ -18,12 +81,11 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 1, - "id": 8, + "id": null, "links": [], - "liveNow": true, "panels": [ { - "collapsed": true, + "collapsed": false, "gridPos": { "h": 1, "w": 24, @@ -31,911 +93,975 @@ "y": 0 }, "id": 9, - "panels": [ + "panels": [], + "repeat": "instance", + "title": "Component Metrics: $instance", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic", + "seriesBy": "last" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 80, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 1 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "last", + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic", - "seriesBy": "last" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 80, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "s" - }, - "overrides": [] + "uid": "${DS_PROMETHEUS}" }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 1 + "disableTextWrap": false, + "editorMode": "code", + "expr": "rate(acaad_core_command_execution_duration_seconds_sum{job=\"$job\", instance=~\"$instance\"}[$__rate_interval]) / rate(acaad_core_command_execution_duration_seconds_count{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "{{component_name}}", + "range": true, + "refId": "Duration over Time", + "useBackend": false + } + ], + "title": "Avg. Command Duration by Component", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic", + "seriesBy": "last" }, - "id": 2, - "options": { - "legend": { - "calcs": [ - "last", - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 80, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" }, - "tooltip": { - "mode": "multi", - "sort": "none" + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "disableTextWrap": false, - "editorMode": "code", - "expr": "rate(acaad_core_command_execution_duration_seconds_sum{job=\"$job\", instance=~\"$instance\"}[$__rate_interval]) / rate(acaad_core_command_execution_duration_seconds_count{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])", - "fullMetaSearch": false, - "hide": false, - "includeNullMetadata": true, - "instant": false, - "legendFormat": "{{component_name}}", - "range": true, - "refId": "Duration over Time", - "useBackend": false - } + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 1 + }, + "id": 3, + "interval": "5s", + "options": { + "legend": { + "calcs": [ + "last", + "min", + "max", + "mean" ], - "title": "Avg. Command Duration by Component", - "type": "timeseries" + "displayMode": "table", + "placement": "right", + "showLegend": true }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic", - "seriesBy": "last" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 80, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 1 + "disableTextWrap": false, + "editorMode": "code", + "expr": "rate(acaad_core_transformation_execution_duration_seconds_sum{job=\"$job\", instance=~\"$instance\"}[$__rate_interval]) / rate(acaad_core_transformation_execution_duration_seconds_count{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "{{component_name}}", + "range": true, + "refId": "Duration over Time", + "useBackend": false + } + ], + "title": "Avg. Transformation Duration by Component", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd", + "seriesBy": "max" }, - "id": 3, - "interval": "5s", - "options": { - "legend": { - "calcs": [ - "last", - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 50, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "tooltip": { - "mode": "multi", - "sort": "none" + "thresholdsStyle": { + "mode": "line" } }, - "pluginVersion": "11.4.0", - "targets": [ + "mappings": [ { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" + "options": { + "match": "null+nan", + "result": { + "index": 0, + "text": "0 ms" + } }, - "disableTextWrap": false, - "editorMode": "code", - "expr": "rate(acaad_core_transformation_execution_duration_seconds_sum{job=\"$job\", instance=~\"$instance\"}[$__rate_interval]) / rate(acaad_core_transformation_execution_duration_seconds_count{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])", - "fullMetaSearch": false, - "hide": false, - "includeNullMetadata": true, - "instant": false, - "legendFormat": "{{component_name}}", - "range": true, - "refId": "Duration over Time", - "useBackend": false + "type": "special" } ], - "title": "Avg. Transformation Duration by Component", - "type": "timeseries" + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 1, + "options": { + "legend": { + "calcs": [ + "last", + "min", + "max" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd", - "seriesBy": "max" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 50, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "line" - } - }, - "mappings": [ - { - "options": { - "match": "null+nan", - "result": { - "index": 0, - "text": "0 ms" - } - }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "s" - }, - "overrides": [] + "uid": "${DS_PROMETHEUS}" }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 11 + "disableTextWrap": false, + "editorMode": "code", + "expr": "histogram_quantile(0.50, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "p50", + "range": true, + "refId": "p50", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" }, - "id": 1, + "editorMode": "code", + "expr": "histogram_quantile(0.75, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", + "hide": false, + "instant": false, + "legendFormat": "p75", + "range": true, + "refId": "p75" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "histogram_quantile(0.90, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", + "hide": false, + "instant": false, + "legendFormat": "p90", + "range": true, + "refId": "p90" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "histogram_quantile(0.95, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", + "hide": false, + "instant": false, + "legendFormat": "p95", + "range": true, + "refId": "p95" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "histogram_quantile(0.98, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", + "hide": false, + "instant": false, + "legendFormat": "p98", + "range": true, + "refId": "p98" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "histogram_quantile(0.99, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", + "hide": false, + "instant": false, + "legendFormat": "p99", + "range": true, + "refId": "p99" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "histogram_quantile(0.999, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", + "hide": false, + "instant": false, + "legendFormat": "p99.9", + "range": true, + "refId": "p99.9" + } + ], + "title": "Command Execution Duration", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 9, + "x": 12, + "y": 8 + }, + "id": 5, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Errors" + } + ] + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "topk(5, increase(acaad_processing_component_failed_total{job=\"$job\", instance=~\"$instance\"}[$__range]))", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "__auto", + "range": false, + "refId": "A" + } + ], + "title": "Failing Components", + "transformations": [ + { + "id": "organize", "options": { - "legend": { - "calcs": [ - "last", - "min", - "max" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true + "excludeByName": { + "Time": true, + "Value": false, + "instance": true, + "job": true, + "otel_scope_name": true }, - "tooltip": { - "mode": "multi", - "sort": "none" + "includeByName": {}, + "indexByName": {}, + "renameByName": { + "Value": "Errors", + "component_name": "Component Name", + "component_type": "Component Type" } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null }, - "disableTextWrap": false, - "editorMode": "code", - "expr": "histogram_quantile(0.50, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", - "fullMetaSearch": false, - "includeNullMetadata": true, - "instant": false, - "legendFormat": "p50", - "range": true, - "refId": "p50", - "useBackend": false - }, - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" + { + "color": "yellow", + "value": 90 }, - "editorMode": "code", - "expr": "histogram_quantile(0.75, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", - "hide": false, - "instant": false, - "legendFormat": "p75", - "range": true, - "refId": "p75" - }, - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" + { + "color": "orange", + "value": 100 }, - "editorMode": "code", - "expr": "histogram_quantile(0.90, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", - "hide": false, - "instant": false, - "legendFormat": "p90", - "range": true, - "refId": "p90" + { + "color": "red", + "value": 120 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 3, + "x": 21, + "y": 8 + }, + "id": 4, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^Scheduling Delay$/", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "acaad_processing_scheduling_delay_milliseconds_sum{job=\"$job\", instance=~\"$instance\"} / acaad_processing_scheduling_delay_milliseconds_count{job=\"$job\", instance=~\"$instance\"}", + "instant": false, + "legendFormat": "Scheduling Delay", + "range": true, + "refId": "A" + } + ], + "title": "Avg. Schedule to Execution Delay", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic", + "seriesBy": "last" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 80, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.95, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", - "hide": false, - "instant": false, - "legendFormat": "p95", - "range": true, - "refId": "p95" + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" }, - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.98, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", - "hide": false, - "instant": false, - "legendFormat": "p98", - "range": true, - "refId": "p98" + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" }, - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.99, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", - "hide": false, - "instant": false, - "legendFormat": "p99", - "range": true, - "refId": "p99" + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 14 + }, + "id": 7, + "interval": "5s", + "options": { + "legend": { + "calcs": [ + "last", + "min", + "max", + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "rate(acaad_processing_parser_parse_tree_generation_duration_milliseconds_sum{job=\"$job\", instance=~\"$instance\"}[$__rate_interval]) / rate(acaad_processing_parser_parse_tree_generation_duration_milliseconds_count{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "legendFormat": "{{transformation_hint}}", + "range": true, + "refId": "Duration over Time", + "useBackend": false + } + ], + "title": "Avg. Transformation TreeGen Duration", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.999, sum(rate(acaad_core_command_execution_duration_seconds_bucket{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])) by (le))", - "hide": false, - "instant": false, - "legendFormat": "p99.9", - "range": true, - "refId": "p99.9" + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } - ], - "title": "Command Execution Duration", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 9, - "x": 12, - "y": 11 - }, - "id": 5, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [ { - "desc": false, - "displayName": "Errors" + "color": "red", + "value": 80 } ] - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "editorMode": "code", - "exemplar": false, - "expr": "topk(5, increase(acaad_processing_component_failed_total{job=\"$job\", instance=~\"$instance\"}[$__range]))", - "format": "table", - "instant": true, - "interval": "", - "legendFormat": "__auto", - "range": false, - "refId": "A" - } - ], - "title": "Failing Components", - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "Value": false, - "instance": true, - "job": true, - "otel_scope_name": true - }, - "includeByName": {}, - "indexByName": {}, - "renameByName": { - "Value": "Errors", - "component_name": "Component Name", - "component_type": "Component Type" - } - } - } - ], - "type": "table" + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 12, + "y": 14 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "yellow", - "value": 90 - }, - { - "color": "orange", - "value": 100 - }, - { - "color": "red", - "value": 120 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 5, - "w": 3, - "x": 21, - "y": 11 + "uid": "${DS_PROMETHEUS}" }, - "id": 4, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "/^Scheduling Delay$/", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true + "editorMode": "code", + "expr": "sum(acaad_processing_parser_transformations_cached_total{job=\"$job\", instance=~\"$instance\"})", + "instant": false, + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Cached Parse Trees", + "type": "timeseries" + }, + { + "datasource": { + "type": "loki", + "uid": "${DS_LOKI}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "editorMode": "code", - "expr": "acaad_processing_scheduling_delay_milliseconds_sum{job=\"$job\", instance=~\"$instance\"} / acaad_processing_scheduling_delay_milliseconds_count{job=\"$job\", instance=~\"$instance\"}", - "instant": false, - "legendFormat": "Scheduling Delay", - "range": true, - "refId": "A" + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 3, + "x": 18, + "y": 14 + }, + "id": 15, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "sum" ], - "title": "Avg. Schedule to Execution Delay", - "type": "stat" + "fields": "", + "values": false }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ { "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "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": "yellow", - "value": 90 - }, - { - "color": "orange", - "value": 100 - }, - { - "color": "red", - "value": 120 - } - ] - }, - "unit": "ms" - }, - "overrides": [] + "type": "loki", + "uid": "${DS_LOKI}" }, - "gridPos": { - "h": 5, - "w": 3, - "x": 21, - "y": 16 + "editorMode": "code", + "expr": "count by(instance) (rate({level=\"ERROR\"} [$__auto]))", + "hide": false, + "legendFormat": "{{instance}}", + "queryType": "range", + "refId": "A" + } + ], + "title": "Errors By Host", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "id": 6, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "editorMode": "code", - "expr": "acaad_processing_scheduling_delay_milliseconds_sum{job=\"$job\", instance=~\"$instance\"} / acaad_processing_scheduling_delay_milliseconds_count{job=\"$job\", instance=~\"$instance\"}", - "instant": false, - "legendFormat": "Scheduling Delay", - "range": true, - "refId": "A" + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" } - ], - "title": "Avg. Schedule to Execution Delay", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic", - "seriesBy": "last" + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 80, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } + { + "color": "yellow", + "value": 90 }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] + { + "color": "orange", + "value": 100 }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 21 - }, - "id": 7, - "interval": "5s", - "options": { - "legend": { - "calcs": [ - "last", - "min", - "max", - "mean" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } + { + "color": "red", + "value": 120 + } + ] }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "disableTextWrap": false, - "editorMode": "code", - "expr": "rate(acaad_processing_parser_parse_tree_generation_duration_milliseconds_sum{job=\"$job\", instance=~\"$instance\"}[$__rate_interval]) / rate(acaad_processing_parser_parse_tree_generation_duration_milliseconds_count{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])", - "fullMetaSearch": false, - "hide": false, - "includeNullMetadata": true, - "instant": false, - "legendFormat": "{{transformation_hint}}", - "range": true, - "refId": "Duration over Time", - "useBackend": false - } - ], - "title": "Avg. Transformation TreeGen Duration", - "type": "timeseries" + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 3, + "x": 21, + "y": 14 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": false }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "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 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 6, - "x": 12, - "y": 21 - }, - "id": 8, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "uid": "${DS_PROMETHEUS}" }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "cea21220vylfke" - }, - "editorMode": "code", - "expr": "sum(acaad_processing_parser_transformations_cached_total{job=\"$job\", instance=~\"$instance\"})", - "instant": false, - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Cached Parse Trees", - "type": "timeseries" + "editorMode": "code", + "expr": "acaad_processing_scheduling_delay_milliseconds_sum{job=\"$job\", instance=~\"$instance\"} / acaad_processing_scheduling_delay_milliseconds_count{job=\"$job\", instance=~\"$instance\"}", + "instant": false, + "legendFormat": "Scheduling Delay", + "range": true, + "refId": "A" } ], - "repeat": "instance", - "title": "Component Metrics: $instance", - "type": "row" + "title": "Avg. Schedule to Execution Delay", + "type": "timeseries" }, { "collapsed": false, @@ -943,7 +1069,7 @@ "h": 1, "w": 24, "x": 0, - "y": 3 + "y": 20 }, "id": 10, "panels": [], @@ -954,7 +1080,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -1016,7 +1142,7 @@ "h": 8, "w": 6, "x": 0, - "y": 4 + "y": 21 }, "id": 11, "options": { @@ -1036,7 +1162,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "dotnet_gc_last_collection_heap_size_bytes{job=\"$job\",instance=~\"$instance\"}", @@ -1052,7 +1178,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -1114,7 +1240,7 @@ "h": 8, "w": 6, "x": 6, - "y": 4 + "y": 21 }, "id": 12, "options": { @@ -1134,7 +1260,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "dotnet_process_memory_working_set_bytes{job=\"$job\", instance=~\"$instance\"}", @@ -1146,7 +1272,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "dotnet_gc_last_collection_memory_committed_size_bytes{job=\"$job\", instance=~\"$instance\"}", @@ -1159,7 +1285,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "dotnet_jit_compiled_il_size_bytes_total{job=\"$job\", instance=~\"$instance\"}", @@ -1172,7 +1298,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "sum(dotnet_gc_last_collection_heap_size_bytes{job=\"$job\", instance=~\"$instance\"})", @@ -1189,7 +1315,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -1250,7 +1376,7 @@ "h": 8, "w": 6, "x": 12, - "y": 4 + "y": 21 }, "id": 13, "options": { @@ -1270,7 +1396,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "rate(dotnet_process_cpu_time_seconds_total{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])", @@ -1286,7 +1412,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "fieldConfig": { "defaults": { @@ -1347,7 +1473,7 @@ "h": 8, "w": 6, "x": 18, - "y": 4 + "y": 21 }, "id": 14, "options": { @@ -1367,7 +1493,7 @@ { "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", "expr": "rate(dotnet_gc_pause_time_seconds_total{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])", @@ -1381,19 +1507,15 @@ "type": "timeseries" } ], - "preload": true, "schemaVersion": 40, "tags": [], "templating": { "list": [ { - "current": { - "text": "acaad", - "value": "acaad" - }, + "current": {}, "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "definition": "label_values(http_server_active_requests,job)", "label": "Job", @@ -1410,21 +1532,10 @@ "type": "query" }, { - "current": { - "text": [ - "192.168.178.22:19090", - "192.168.178.50:19090", - "192.168.178.50:29090" - ], - "value": [ - "192.168.178.22:19090", - "192.168.178.50:19090", - "192.168.178.50:29090" - ] - }, + "current": {}, "datasource": { "type": "prometheus", - "uid": "cea21220vylfke" + "uid": "${DS_PROMETHEUS}" }, "definition": "label_values(http_server_active_requests{job=\"$job\"},instance)", "label": "Instance", @@ -1441,6 +1552,26 @@ "sort": 1, "type": "query" }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "definition": "label_values(acaad_target_info{job=\"$job\"},acaad_name)", + "hide": 2, + "label": "Server Name", + "name": "acaadName", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(acaad_target_info{job=\"$job\"},acaad_name)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "type": "query" + }, { "baseFilters": [], "datasource": { @@ -1461,6 +1592,6 @@ "timezone": "", "title": "ACaaD", "uid": "cea2zcpedauwwb", - "version": 79, + "version": 107, "weekStart": "" } \ No newline at end of file diff --git a/Dashboards/Host.Monitoring.json b/Dashboards/Host.Monitoring.json index 383e214..99a5623 100644 --- a/Dashboards/Host.Monitoring.json +++ b/Dashboards/Host.Monitoring.json @@ -93,7 +93,7 @@ "viz": false }, "insertNulls": false, - "lineInterpolation": "linear", + "lineInterpolation": "smooth", "lineStyle": { "fill": "solid" }, @@ -145,8 +145,8 @@ "showLegend": true }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, "pluginVersion": "11.4.0", @@ -234,7 +234,7 @@ "viz": false }, "insertNulls": false, - "lineInterpolation": "linear", + "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { @@ -283,8 +283,8 @@ "showLegend": true }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, "pluginVersion": "11.4.0", @@ -333,7 +333,7 @@ "viz": false }, "insertNulls": false, - "lineInterpolation": "linear", + "lineInterpolation": "smooth", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { @@ -382,8 +382,8 @@ "showLegend": true }, "tooltip": { - "mode": "single", - "sort": "none" + "mode": "multi", + "sort": "desc" } }, "pluginVersion": "11.4.0", @@ -460,6 +460,6 @@ "timezone": "browser", "title": "ACaaD Host", "uid": "febfw5vhep0cgb", - "version": 34, + "version": 40, "weekStart": "" } \ No newline at end of file diff --git a/Directory.Packages.props b/Directory.Packages.props index e058358..dce80f7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -15,6 +15,8 @@ + + diff --git a/Monitoring/Loki/loki-local-config.yaml b/Monitoring/Loki/loki-local-config.yaml new file mode 100644 index 0000000..ae0d1ee --- /dev/null +++ b/Monitoring/Loki/loki-local-config.yaml @@ -0,0 +1,64 @@ +auth_enabled: false + +server: + http_listen_port: 3100 + grpc_listen_port: 9096 + log_level: debug + grpc_server_max_concurrent_streams: 1000 + +common: + instance_addr: 127.0.0.1 + path_prefix: /tmp/loki + storage: + filesystem: + chunks_directory: /tmp/loki/chunks + rules_directory: /tmp/loki/rules + replication_factor: 1 + ring: + kvstore: + store: inmemory + +query_range: + results_cache: + cache: + embedded_cache: + enabled: true + max_size_mb: 100 + +limits_config: + metric_aggregation_enabled: true + allow_unstructured_metadata: true + +schema_config: + configs: + - from: 2020-10-24 + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + +pattern_ingester: + enabled: true + metric_aggregation: + loki_address: localhost:3100 + +ruler: + alertmanager_url: http://localhost:9093 + +frontend: + encoding: protobuf + +# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration +# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/ +# +# Statistics help us better understand how Loki is used, and they show us performance +# levels for most users. This helps us prioritize features and documentation. +# For more information on what's sent, look at +# https://github.com/grafana/loki/blob/main/pkg/analytics/stats.go +# Refer to the buildReport method to see what goes into a report. +# +# If you would like to disable reporting, uncomment the following lines: +analytics: + reporting_enabled: false \ No newline at end of file diff --git a/Monitoring/OpenTelemetry Collector/config.yaml b/Monitoring/OpenTelemetry Collector/config.yaml new file mode 100644 index 0000000..14f3f68 --- /dev/null +++ b/Monitoring/OpenTelemetry Collector/config.yaml @@ -0,0 +1,106 @@ +exporters: + prometheus: + endpoint: 0.0.0.0:8889 + loki: + endpoint: "http://nas:3100/loki/api/v1/push" + +receivers: + # otelcontribcol metrics + host metrics + prometheus/agent: + config: + scrape_configs: + - job_name: otel-collector + scrape_interval: 10s + static_configs: + - targets: [0.0.0.0:8888] + metric_relabel_configs: + - action: labeldrop + regex: "service_instance_id|service_name" + + hostmetrics/system: + collection_interval: 10s + scrapers: + cpu: + metrics: + system.cpu.time: + enabled: true + system.cpu.logical.count: + enabled: true + memory: + metrics: + system.memory.utilization: + enabled: true + load: + disk: + filesystem: + metrics: + system.filesystem.utilization: + enabled: true + network: + paging: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + +processors: + batch/agent: + filter/ottl: + error_mode: ignore + logs: + log_record: + - 'instrumentation_scope.name != "Microsoft.AspNetCore.Hosting.Diagnostics"' + - 'instrumentation_scope.name != "Microsoft.AspNetCore.Hosting.Diagnostics"' + - 'instrumentation_scope.name != "Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker"' + - 'instrumentation_scope.name != "Microsoft.Hosting.Lifetime"' + resource/agent: + attributes: + - action: upsert + key: service.namespace + value: agent + attributes/agent: + actions: + - key: service.namespace + action: upsert + value: agent + - key: service.name + action: upsert + value: otel-collector + resourcedetection/system: + detectors: ["system"] + system: + hostname_sources: ["os"] + transform: + metric_statements: + - context: datapoint + statements: + - set(attributes["host.name"], resource.attributes["host.name"]) + - set(attributes["process.command"], resource.attributes["process.command"]) + - set(attributes["process.command_line"], resource.attributes["process.command_line"]) + - set(attributes["process.executable.name"], resource.attributes["process.executable.name"]) + - set(attributes["process.executable.path"], resource.attributes["process.executable.path"]) + - set(attributes["process.owner"], resource.attributes["process.owner"]) + - set(attributes["process.parent_pid"], resource.attributes["process.parent_pid"]) + - set(attributes["process.pid"], resource.attributes["process.pid"]) + +extensions: + health_check: + endpoint: "0.0.0.0:13133" + +service: + extensions: [health_check] + telemetry: + logs: + level: info + metrics: + level: detailed + + pipelines: + metrics/agent: + receivers: [prometheus/agent, hostmetrics/system] + processors: [attributes/agent, resourcedetection/system, transform, batch/agent] + exporters: [prometheus] + logs: + receivers: [ otlp ] + processors: [ batch/agent ] + exporters: [ loki ] diff --git a/Oma.WndwCtrl.Api/CtrlApiService.config.development.json b/Oma.WndwCtrl.Api/CtrlApiService.config.development.json index 7749b0a..e074e3f 100644 --- a/Oma.WndwCtrl.Api/CtrlApiService.config.development.json +++ b/Oma.WndwCtrl.Api/CtrlApiService.config.development.json @@ -1,12 +1,7 @@ { - "Kestrel": { - "Endpoints": { - "Http1": { - "Url": "http://*:5000" - }, - "Http": { - "Url": "http://localhost:8000" - } + "Logging": { + "LogLevel": { + "Oma.WndwCtrl.Core": "Debug" } } } \ No newline at end of file diff --git a/Oma.WndwCtrl.Core/Executors/Commands/CliCommandExecutor.cs b/Oma.WndwCtrl.Core/Executors/Commands/CliCommandExecutor.cs index fa66d7b..03f3f27 100644 --- a/Oma.WndwCtrl.Core/Executors/Commands/CliCommandExecutor.cs +++ b/Oma.WndwCtrl.Core/Executors/Commands/CliCommandExecutor.cs @@ -2,8 +2,10 @@ using System.Diagnostics; using JetBrains.Annotations; using LanguageExt; +using Microsoft.Extensions.Logging; using Oma.WndwCtrl.Abstractions; using Oma.WndwCtrl.Abstractions.Errors; +using Oma.WndwCtrl.Abstractions.Extensions; using Oma.WndwCtrl.Abstractions.Model; using Oma.WndwCtrl.Core.Errors.Commands; using Oma.WndwCtrl.Core.Model.Commands; @@ -11,7 +13,7 @@ namespace Oma.WndwCtrl.Core.Executors.Commands; -public class CliCommandExecutor : ICommandExecutor +public partial class CliCommandExecutor(ILogger logger) : ICommandExecutor { [MustDisposeResource] public async Task> ExecuteAsync( @@ -21,6 +23,8 @@ public async Task> ExecuteAsync( { try { + Stopwatch swCliCommand = Stopwatch.StartNew(); + ProcessStartInfo processStartInfo = new() { FileName = command.FileName, @@ -58,10 +62,14 @@ public async Task> ExecuteAsync( ? allText : string.Join(Environment.NewLine, errorChunks); - return new CommandOutcome(outcome) + CommandOutcome result = new(outcome) { Success = process.ExitCode == 0 && errorChunks.IsEmpty, }; + + LogExecution(logger, swCliCommand.Measure(), result.Success, result); + + return result; } catch (OperationCanceledException ex) { @@ -74,4 +82,16 @@ public async Task> ExecuteAsync( ); } } + + [LoggerMessage( + Level = LogLevel.Trace, + Message = + "Finished executing cli command in {elapsed} (Success: {isSuccess}, Outcome={outcome})." + )] + public static partial void LogExecution( + ILogger logger, + TimeSpan elapsed, + bool isSuccess, + CommandOutcome outcome + ); } \ No newline at end of file diff --git a/Oma.WndwCtrl.Core/Executors/Commands/DelegatingCommandExecutor.cs b/Oma.WndwCtrl.Core/Executors/Commands/DelegatingCommandExecutor.cs index d06eb8d..5a85d7b 100644 --- a/Oma.WndwCtrl.Core/Executors/Commands/DelegatingCommandExecutor.cs +++ b/Oma.WndwCtrl.Core/Executors/Commands/DelegatingCommandExecutor.cs @@ -13,7 +13,7 @@ namespace Oma.WndwCtrl.Core.Executors.Commands; -public class DelegatingCommandExecutor : ICommandExecutor +public partial class DelegatingCommandExecutor : ICommandExecutor { private static readonly FlowT RecordExecutionDurationIO = ( @@ -128,15 +128,22 @@ public async Task> ExecuteAsync( Either outcome = await _transformerStack.Invoke(initialState, envIO); - _logger.LogDebug( - "Finished command in {elapsed} (Success={isSuccess})", - swExec.Measure(), - outcome.IsRight - ); + LogFinishedCommand(_logger, swExec.Measure(), outcome.IsRight); return outcome; } + [LoggerMessage( + Level = LogLevel.Debug, + Message = + "Finished command in {elapsed} (Success={isSuccess})" + )] + public static partial void LogFinishedCommand( + ILogger logger, + TimeSpan elapsed, + bool isSuccess + ); + private static FlowT ExecuteExecutorIO( ICommand cmd, ICommandExecutor executor diff --git a/Oma.WndwCtrl.Core/Executors/Transformers/DelegatingTransformer.cs b/Oma.WndwCtrl.Core/Executors/Transformers/DelegatingTransformer.cs index ad96923..af0292b 100644 --- a/Oma.WndwCtrl.Core/Executors/Transformers/DelegatingTransformer.cs +++ b/Oma.WndwCtrl.Core/Executors/Transformers/DelegatingTransformer.cs @@ -14,7 +14,7 @@ namespace Oma.WndwCtrl.Core.Executors.Transformers; -public class DelegatingTransformer : IRootTransformer +public partial class DelegatingTransformer : IRootTransformer { private static readonly FlowT RecordTransformationDurationIO = ( @@ -123,11 +123,22 @@ public async Task> TransformCommandOutc Either outcome = await _transformerStack.Invoke(initialConfiguration, envIO); - _logger.LogDebug("Finished command in {elapsed} (Success={isSuccess})", swExec.Measure(), outcome); + LogFinishedTransformation(_logger, swExec.Measure(), outcome); return outcome; } + [LoggerMessage( + Level = LogLevel.Debug, + Message = + "Finished transformations in {elapsed} (Outcome={outcome})" + )] + public static partial void LogFinishedTransformation( + ILogger logger, + TimeSpan elapsed, + Either outcome + ); + [ExcludeFromCodeCoverage] [PublicAPI] [SuppressMessage( diff --git a/Oma.WndwCtrl.Core/Extensions/IServiceCollectionExtensions.cs b/Oma.WndwCtrl.Core/Extensions/IServiceCollectionExtensions.cs index cf276fb..9e33868 100644 --- a/Oma.WndwCtrl.Core/Extensions/IServiceCollectionExtensions.cs +++ b/Oma.WndwCtrl.Core/Extensions/IServiceCollectionExtensions.cs @@ -38,7 +38,8 @@ IConfiguration configuration .AddSingleton() .Configure( coreConfig.GetSection(CliParserLoggerOptions.SectionName) - ); + ) + .Configure(coreConfig.GetSection(GeneralSettings.SectionName)); ExtensionSettings extensions = []; coreConfig.GetSection(ExtensionSettings.SectionName).Bind(extensions); diff --git a/Oma.WndwCtrl.Core/Model/Settings/GeneralSettings.cs b/Oma.WndwCtrl.Core/Model/Settings/GeneralSettings.cs new file mode 100644 index 0000000..4e6b286 --- /dev/null +++ b/Oma.WndwCtrl.Core/Model/Settings/GeneralSettings.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.Configuration; + +namespace Oma.WndwCtrl.Core.Model.Settings; + +public class GeneralSettings +{ + public const string SectionName = "ACaaD"; + + public string OS { get; init; } = "windows"; + public string Name { get; init; } = "not-configured (PLEASE FIX)"; + + public bool UseOtlp { get; init; } + + public static GeneralSettings FromRoot(IConfiguration rootConfiguration) => + rootConfiguration.GetSection(SectionName).Get() ?? new GeneralSettings(); +} \ No newline at end of file diff --git a/Oma.WndwCtrl.CoreAsp/BackgroundServiceWrapper.cs b/Oma.WndwCtrl.CoreAsp/BackgroundServiceWrapper.cs index 273d88c..293a125 100644 --- a/Oma.WndwCtrl.CoreAsp/BackgroundServiceWrapper.cs +++ b/Oma.WndwCtrl.CoreAsp/BackgroundServiceWrapper.cs @@ -1,12 +1,16 @@ using System.Diagnostics.CodeAnalysis; using JetBrains.Annotations; using Oma.WndwCtrl.Abstractions; +using OpenTelemetry.Logs; +using OpenTelemetry.Resources; namespace Oma.WndwCtrl.CoreAsp; public class BackgroundServiceWrapper(IConfiguration configuration) : IBackgroundService where TAssemblyDescriptor : class, IBackgroundService { + private static readonly string _serviceName = typeof(TAssemblyDescriptor).Name; + [SuppressMessage( "ReSharper", "StaticMemberInGenericType", @@ -14,7 +18,11 @@ public class BackgroundServiceWrapper(IConfiguration config )] private static IServiceProvider? _serviceProvider; + private readonly string AcaadName = + configuration.GetValue("ACaaD:Name") ?? Guid.NewGuid().ToString(); + protected readonly string RunningInOs = configuration.GetValue("ACaaD:OS") ?? "windows"; + private readonly bool UseOtlp = configuration.GetValue("ACaaD:UseOtlp"); private IConfiguration? _configuration; @@ -54,8 +62,32 @@ public async Task StartAsync(CancellationToken cancelToken = default, params str hostBuilder.ConfigureLogging( (_, logging) => { + logging.ClearProviders(); logging.SetMinimumLevel(LogLevel.Trace); - logging.AddConsole(); + + if (UseOtlp) + { + logging.AddOpenTelemetry( + otelOptions => + { + ResourceBuilder resourceBuilder = + ResourceBuilder.CreateDefault().AddService( + _serviceName, + "ACaaD", + serviceInstanceId: AcaadName + ) + .AddEnvironmentVariableDetector(); + + otelOptions.SetResourceBuilder(resourceBuilder); + + otelOptions.IncludeScopes = true; + otelOptions.IncludeFormattedMessage = true; + otelOptions.ParseStateValues = true; + + otelOptions.AddOtlpExporter(); + } + ); + } logging.AddConfiguration(configuration.GetSection("Logging")); } diff --git a/Oma.WndwCtrl.CoreAsp/Oma.WndwCtrl.CoreAsp.csproj b/Oma.WndwCtrl.CoreAsp/Oma.WndwCtrl.CoreAsp.csproj index 97e9306..11a1586 100644 --- a/Oma.WndwCtrl.CoreAsp/Oma.WndwCtrl.CoreAsp.csproj +++ b/Oma.WndwCtrl.CoreAsp/Oma.WndwCtrl.CoreAsp.csproj @@ -9,6 +9,9 @@ + + + diff --git a/Oma.WndwCtrl.CoreAsp/WebApplicationWrapper.cs b/Oma.WndwCtrl.CoreAsp/WebApplicationWrapper.cs index ca324fb..2ac246d 100644 --- a/Oma.WndwCtrl.CoreAsp/WebApplicationWrapper.cs +++ b/Oma.WndwCtrl.CoreAsp/WebApplicationWrapper.cs @@ -11,6 +11,8 @@ using Oma.WndwCtrl.CoreAsp.Conventions; using Oma.WndwCtrl.Messaging.Bus; using Oma.WndwCtrl.Messaging.Extensions; +using OpenTelemetry.Logs; +using OpenTelemetry.Resources; using Scalar.AspNetCore; namespace Oma.WndwCtrl.CoreAsp; @@ -30,6 +32,11 @@ public class WebApplicationWrapper( private static readonly string _serviceName = typeof(TAssemblyDescriptor).Name; + private readonly string AcaadName = + rootConfiguration?.GetValue("ACaaD:Name") ?? Guid.NewGuid().ToString(); + + private readonly bool UseOtlp = rootConfiguration?.GetValue("ACaaD:UseOtlp") ?? false; + private IConfiguration? _configuration; private IWebHostEnvironment? _environment; @@ -62,8 +69,10 @@ static IServiceProvider IService.ServiceProvider set => _serviceProvider = value; } - // TODO: Fix me - public bool Enabled => true; + public bool Enabled => !bool.TryParse( + rootConfiguration?.GetSection(_serviceName).GetValue("Enabled") ?? "true", + out bool enabled + ) || enabled; public async Task StartAsync(CancellationToken cancelToken = default, params string[] args) { @@ -128,17 +137,46 @@ public async Task StartAsync(CancellationToken cancelToken = default, params str builder.Services.AddLogging( lb => { - // TODO: Pass down logging configuration - lb.AddConsole(); + lb.ClearProviders(); + + if (UseOtlp) + { + lb.AddOpenTelemetry( + otelOptions => + { + ResourceBuilder resourceBuilder = + ResourceBuilder.CreateDefault().AddService( + _serviceName, + "ACaaD", + serviceInstanceId: AcaadName + ) + .AddEnvironmentVariableDetector(); + + otelOptions.SetResourceBuilder(resourceBuilder); + + otelOptions.IncludeScopes = true; + otelOptions.IncludeFormattedMessage = true; + otelOptions.ParseStateValues = true; + + otelOptions.AddOtlpExporter(); + } + ); + } + + if (rootConfiguration is not null) + { + lb.AddConfiguration(rootConfiguration.GetSection("Logging")); + } } ); ConfigureServices(builder.Services); - Application = PostAppBuild(builder.Build()); - + Application = builder.Build(); TAssemblyDescriptor.ServiceProvider = Application.Services; + Application = PostAppBuild(Application); + Application.MapControllers(); Application.MapOpenApi(); Application.MapScalarApiReference(); diff --git a/Oma.WndwCtrl.Messaging/ChannelWorker.cs b/Oma.WndwCtrl.Messaging/ChannelWorker.cs index 28de2a9..9abe6c9 100644 --- a/Oma.WndwCtrl.Messaging/ChannelWorker.cs +++ b/Oma.WndwCtrl.Messaging/ChannelWorker.cs @@ -38,8 +38,11 @@ public async Task ProcessUntilCompletedAsync(CancellationToken cancelToken = def { await OnStartAsync(cancelToken); + int concurrency = _settings?.Concurrency ?? 16; + logger.LogInformation("Starting channel worker with {concurrency} tasks.", concurrency); + await Task.WhenAll( - Enumerable.Range(start: 0, _settings?.Concurrency ?? 16) + Enumerable.Range(start: 0, concurrency) .Select(_ => ProcessMessagesAsync(_loopCts.Token)) ); } @@ -121,13 +124,23 @@ private async Task OnCancelledAsync(Exception? ex, CancellationToken cancelToken } } -internal sealed class ChannelWorker(ILogger logger, TConsumer consumer) +internal partial class ChannelWorker(ILogger logger, TConsumer consumer) : ChannelWorker(logger, consumer) where TConsumer : IMessageConsumer where TMessage : IMessage { + private readonly ILogger _logger = logger; private TConsumer _consumer = consumer; + private static string ExpectedMessageTypeName => typeof(TMessage).FullName ?? "unknown"; + + [LoggerMessage( + Level = LogLevel.Trace, + Message = + "Received a message expecting type {ExpectedTypeName}, but received: {Actual:Name}. Dropping message." + )] + public partial void LogDroppedMessage(string ExpectedTypeName, IMessage Actual); + protected async override Task ProcessMessagesAsync(CancellationToken cancelToken = default) { CancellationTokenSource iterationCts = CancellationTokenSource.CreateLinkedTokenSource(cancelToken); @@ -151,11 +164,7 @@ protected async override Task ProcessMessagesAsync(CancellationToken cancelToken if (message is not TMessage) { - logger.LogTrace( - "Received a message expecting type {expected}, but received: {actual}. Dropping message.", - typeof(TMessage), - message.GetType().FullName - ); + LogDroppedMessage(ExpectedMessageTypeName, message); continue; // Do not return here - that kills the worker (╯°□°)╯︵ ┻━┻ } diff --git a/Oma.WndwCtrl.MetricsApi/Metrics/MetadataMetrics.cs b/Oma.WndwCtrl.MetricsApi/Metrics/MetadataMetrics.cs new file mode 100644 index 0000000..4d5e899 --- /dev/null +++ b/Oma.WndwCtrl.MetricsApi/Metrics/MetadataMetrics.cs @@ -0,0 +1,31 @@ +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.Metrics; +using Oma.WndwCtrl.Core.Model.Settings; + +namespace Oma.WndwCtrl.MetricsApi.Metrics; + +public class MetadataMetrics +{ + private readonly Gauge _targetInfo; + + [SuppressMessage( + "Reliability", + "CA2000:Dispose objects before losing scope", + Justification = "Won't fix; Meter instances are not meant to be disposed." + )] + public MetadataMetrics(IMeterFactory meterFactory) + { + Meter meter = meterFactory.Create("ACaaD.Metadata"); + + _targetInfo = meter.CreateGauge("acaad.target.info", description: "Target Metadata"); + } + + public void PopulateMetadata(GeneralSettings settings) + { + TagList tags = default; + tags.Add("acaad.name", settings.Name); + + _targetInfo.Record(value: 1, tags); + } +} \ No newline at end of file diff --git a/Oma.WndwCtrl.MetricsApi/MetricsApiService.cs b/Oma.WndwCtrl.MetricsApi/MetricsApiService.cs index 6b57cb8..333f3d0 100644 --- a/Oma.WndwCtrl.MetricsApi/MetricsApiService.cs +++ b/Oma.WndwCtrl.MetricsApi/MetricsApiService.cs @@ -1,11 +1,13 @@ using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using Oma.WndwCtrl.Core.Model.Settings; using Oma.WndwCtrl.CoreAsp; using Oma.WndwCtrl.Messaging.Bus; +using Oma.WndwCtrl.MetricsApi.Metrics; using OpenTelemetry; using OpenTelemetry.Metrics; -using OpenTelemetry.Resources; namespace Oma.WndwCtrl.MetricsApi; @@ -14,20 +16,27 @@ public class MetricsApiService(MessageBusAccessor messageBusAccessor, IConfigura { protected override IServiceCollection ConfigureServices(IServiceCollection services) { - OpenTelemetryBuilder otel = base.ConfigureServices(services).AddMetrics().AddOpenTelemetry(); + services.AddSingleton() + .Configure(Configuration.GetSection(GeneralSettings.SectionName)); - otel.ConfigureResource(res => res.AddService("ACAAD")); + OpenTelemetryBuilder otel = base.ConfigureServices(services).AddMetrics().AddOpenTelemetry(); // Add Metrics for ASP.NET Core and our custom metrics and export to Prometheus otel.WithMetrics( metrics => metrics .AddAspNetCoreInstrumentation() + .AddMeter("ACaaD.Metadata") .AddMeter("ACaaD.Core") .AddMeter("ACaaD.Processing") .AddMeter("ACaaD.Processing.Parser") .AddMeter("Microsoft.AspNetCore.Hosting") + .AddMeter("Microsoft.AspNetCore.Routing") + .AddMeter("Microsoft.AspNetCore.Http.Connections") .AddMeter("Microsoft.AspNetCore.Server.Kestrel") + .AddMeter("Microsoft.AspNetCore.Diagnostics") .AddMeter("Microsoft.Extensions.Diagnostics.ResourceMonitoring") + .AddMeter("System.Net.Http") + .AddMeter("System.Net.NameResolution") .AddMeter("System.Runtime") .AddPrometheusExporter() ); @@ -40,4 +49,14 @@ protected override WebApplication PreAppRun(WebApplication app) app.MapPrometheusScrapingEndpoint(); return base.PreAppRun(app); } + + protected override WebApplication PostAppRun(WebApplication app, CancellationToken cancelToken = default) + { + MetadataMetrics metrics = ServiceProvider.GetRequiredService(); + IOptions settingOpts = ServiceProvider.GetRequiredService>(); + + metrics.PopulateMetadata(settingOpts.Value); + + return base.PostAppRun(app, cancelToken); + } } \ No newline at end of file diff --git a/Oma.WndwCtrl.MgmtApi/MgmtApiService.config.development.json b/Oma.WndwCtrl.MgmtApi/MgmtApiService.config.development.json index 884a904..a2298bb 100644 --- a/Oma.WndwCtrl.MgmtApi/MgmtApiService.config.development.json +++ b/Oma.WndwCtrl.MgmtApi/MgmtApiService.config.development.json @@ -1,21 +1,12 @@ { "Logging": { "LogLevel": { - "Oma.WndwCtrl.Core": "Information", - "Oma.WndwCtrl.Core.Executors": "Information", - "Oma.WndwCtrl.Scheduling": "Information" + "Default": "Trace" } }, "Core": { "CliParser": { "Silent": true } - }, - "Kestrel": { - "Endpoints": { - "ManagementApi": { - "Url": "http://localhost:8443" - } - } } } \ No newline at end of file diff --git a/Oma.WndwCtrl.MgmtApi/MgmtApiService.config.json b/Oma.WndwCtrl.MgmtApi/MgmtApiService.config.json index e0b5558..40a07df 100644 --- a/Oma.WndwCtrl.MgmtApi/MgmtApiService.config.json +++ b/Oma.WndwCtrl.MgmtApi/MgmtApiService.config.json @@ -1,6 +1,8 @@ { "ACaaD": { - "OS": "windows" + "OS": "windows", + "Name": "oma-development", + "UseOtlp": true }, "Logging": { "LogLevel": { @@ -43,6 +45,7 @@ } }, "MetricsApiService": { + "Enabled": true, "Kestrel": { "Endpoints": { "Http": { diff --git a/Oma.WndwCtrl.sln b/Oma.WndwCtrl.sln index 5f4d5c3..e164ff5 100644 --- a/Oma.WndwCtrl.sln +++ b/Oma.WndwCtrl.sln @@ -59,6 +59,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dashboards", "Dashboards", "{C0FC9E76-5113-4E14-8061-4A9EE8CA1507}" ProjectSection(SolutionItems) = preProject Dashboards\Acaad.Monitoring.json = Dashboards\Acaad.Monitoring.json + Dashboards\Host.Monitoring.json = Dashboards\Host.Monitoring.json EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Installation", "Installation", "{41D1E3C4-0AC3-4245-BB9C-68F8D13481ED}" @@ -81,6 +82,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Actions", "GitHub Ac .github\workflows\dotnet.yml = .github\workflows\dotnet.yml EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Monitoring", "Monitoring", "{A9B442DC-7D2D-4C08-87DB-365B66A631F7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenTelemetry Collector", "OpenTelemetry Collector", "{DB6F3E0B-F6D0-4AF5-A8AE-5C9FC5AB4150}" + ProjectSection(SolutionItems) = preProject + Monitoring\OpenTelemetry Collector\config.yaml = Monitoring\OpenTelemetry Collector\config.yaml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -184,5 +192,7 @@ Global {05B8421B-071F-4C9E-96DC-9978F0AE59F7} = {307F90ED-24AD-4725-960B-0A7AAFFE8C6D} {BECCCB65-C4D8-4AD1-B156-A745370BE36A} = {CB01FB73-6F61-43AA-81EB-C3A19BA74122} {E66E5673-DF95-4D11-8FF9-3E814BD40B4B} = {FC063003-91F3-415C-AB68-D1C08337FAC2} + {A9B442DC-7D2D-4C08-87DB-365B66A631F7} = {FC063003-91F3-415C-AB68-D1C08337FAC2} + {DB6F3E0B-F6D0-4AF5-A8AE-5C9FC5AB4150} = {A9B442DC-7D2D-4C08-87DB-365B66A631F7} EndGlobalSection EndGlobal