diff --git a/README.md b/README.md index ca2b9ac..2b27d1b 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ Track [Docker Events](https://docs.docker.com/engine/reference/commandline/event Head on over to the [Install](https://philosowaffle.github.io/docgraf/) page to get started! +![DocGraf Demo](/images/docgraf_demo.gif?raw=true "DocGraf Demo") + ## Contributors Special thanks to all the [contributors](https://github.com/philosowaffle/docgraf/graphs/contributors) who have helped improve this project! diff --git a/configuration.example.json b/configuration.example.json index 074b40c..e6cef88 100644 --- a/configuration.example.json +++ b/configuration.example.json @@ -7,7 +7,7 @@ }, "Grafana": { - "ApiKey": "", + "ApiKey": "", "Uri": "http://grafana:3000" }, diff --git a/dev/docker-compose.yaml b/dev/docker-compose.yaml deleted file mode 100644 index 0a1ef28..0000000 --- a/dev/docker-compose.yaml +++ /dev/null @@ -1,13 +0,0 @@ -version: "3.9" - -services: - newapp: - container_name: newapp - build: ../docker/Dockerfile - ports: - - 4000:4000 # metrics - environment: - - TZ=America/Chicago - - VERSION=1.0.0 - volumes: - - ./src/Console/configuration.local.json:/app/configuration.local.json \ No newline at end of file diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 5439ffb..4951cd6 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -284,4 +284,4 @@ DEPENDENCIES tzinfo-data BUNDLED WITH - 2.2.29 + 2.3.22 diff --git a/docs/_config.yml b/docs/_config.yml index 960c26e..d3dd458 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,5 +1,5 @@ title: DocGraf -description: Publish annotations to Grafana based on Docker Events. +description: Track Docker Events as Annotations on https://grafana.com/grafana/. repository: philosowaffle/docgraf locale: en_US diff --git a/docs/configuration/index.md b/docs/configuration/index.md index a869d28..564f9b3 100644 --- a/docs/configuration/index.md +++ b/docs/configuration/index.md @@ -1,58 +1,14 @@ --- layout: default title: Configuration -nav_order: 3 +nav_order: 2 has_children: true --- # Configuration -DocGraf supports configuration via [command line arguments]({{ site.baseurl }}{% link configuration/command-line.md %}), [environment variables]({{ site.baseurl }}{% link configuration/environment-variables.md %}), and [json config file]({{ site.baseurl }}{% link configuration/json.md %}). By default, DocGraf looks for a file named `configuration.local.json` in the same directory where it is run. This is the preferred way to provide configuration details to DocGraf. +DocGraf supports configuration via [command line arguments]({{ site.baseurl }}{% link configuration/command-line.md %}), [environment variables]({{ site.baseurl }}{% link configuration/environment-variables.md %}), and [json config file]({{ site.baseurl }}{% link configuration/json.md %}). By default, DocGraf looks for a file named `configuration.local.json` in the same directory where it is run. -## Example Config - -```json -{ - "Docker": { - "Uri": "http://docker-proxy:2375", - "ContainerEvents": [ "start", "stop", "restart" ] - }, - - "Grafana": { - "ApiKey": "", - "Uri": "http://grafana:3000" - }, - - "Observability": { - - "Prometheus": { - "Enabled": false, - "Port": 4000 - }, - - "Tracing": { - "Enabled": true, - "Url": "http://localhost:4317" - }, - - "Serilog": { - "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ], - "MinimumLevel": "Information", - "WriteTo": [ - { "Name": "Console" }, - { - "Name": "File", - "Args": { - "path": "./output/log.txt", - "rollingInterval": "Day", - "retainedFileCountLimit": 7 - } - } - ] - } - } -} -``` ## Config Precedence @@ -62,8 +18,8 @@ The following defines the precedence in which config definitions are honored. Wi 1. Environment Variables 1. Config File -For example, if you defined your Peloton credentials ONLY in the Config file, then the Config file credentials will be used. +For example, if you defined a setting ONLY in the Config file, then the Config file setting will be used. -If you defined your credentials in both the Config file AND the Environment variables, then the Environment variable credentials will be used. +If you defined a setting in both the Config file AND the Environment variables, then the Environment variable setting will be used. -If you defined credentials using all 3 methods (config file, env, and command line), then the credentials provided via the command line will be used. \ No newline at end of file +If you defined a setting using all 3 methods (config file, env, and command line), then the setting provided via the command line will be used. diff --git a/docs/configuration/json.md b/docs/configuration/json.md index 453148a..074a426 100644 --- a/docs/configuration/json.md +++ b/docs/configuration/json.md @@ -7,23 +7,17 @@ nav_order: 0 # Json Config File -This is the preferred way to provide configuration details to DocGraf. By default, DocGraf looks for a file named `configuration.local.json` in the same directory where the program is run. - -The config file is written in JSON and supports hot-reload for all fields except the following: - -1. `Observability` Section - The config file is organized into the below sections. | Section | Description | |:-------------|:------------------| -| [Docker Config](#format-config) | This section provides settings related to Docker. | -| [Grafana Config](#peloton-config) | This section provides settings related to Grafana. | +| [Docker Config](#docker-config) | This section provides settings related to Docker. | +| [Grafana Config](#grafana-config) | This section provides settings related to Grafana. | | [Observability Config](#observability-config) | This section provides settings related to Metrics, Logs, and Traces for monitoring purposes. | ## Docker Config -This section provides settings related to connecting to the Docker daemon and which events should be acted on. +This section provides settings related to connecting to the Docker daemon and which events should be published as Annotations to Grafana. ```json "Docker": { @@ -55,11 +49,11 @@ This section provides settings related to connecting to the Docker daemon and wh ## Grafana Config -This section provides settings related to connecting and publishing annotations to Grafana. +This section provides settings related to connecting to Grafana. ```json "Grafana": { - "ApiKey": "yourApiKey==", + "ApiKey": "yourApiKey==", "Uri": "http://grafana:3000" }, ``` @@ -71,7 +65,7 @@ This section provides settings related to connecting and publishing annotations ## Observability Config -DocGraf supports publishing OpenTelemetry Metrics, Logs, and Trace. This section provides settings related to those pillars. +DocGraf supports publishing OpenTelemetry Metrics, Logs, and Traces. This section provides settings related to those pillars. The Observability config section contains three main sub-sections: @@ -133,8 +127,6 @@ If you are using Docker, ensure you have exposed the port from your container. scrape_interval: 60s static_configs: - targets: [:] - tls_config: - insecure_skip_verify: true ``` ### Tracing Config @@ -156,7 +148,13 @@ If you are using Docker, ensure you have exposed the port from your container. ```json "Serilog": { "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File", "Serilog.Sinks.Grafana.Loki" ], - "MinimumLevel": "Debug", + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Error", + "System": "Error" + } + }, "WriteTo": [ { "Name": "Console" }, { diff --git a/docs/features/annotations.md b/docs/features/annotations.md new file mode 100644 index 0000000..fe98297 --- /dev/null +++ b/docs/features/annotations.md @@ -0,0 +1,27 @@ +--- +layout: default +title: Grafana Annotations +parent: Features +nav_order: 0 +--- + +# Grafana Annotations + +DocGraf can be [configured]({{ site.baseurl }}{% link configuration/index.md %}#docker-config) to publish [Grafana Annotations](https://grafana.com/docs/grafana/v9.0/dashboards/annotations/) for specific [Docker Events](https://docs.docker.com/engine/reference/commandline/events/). When a configured event occurrs, DocGraf will publish that event as an Annotation to Grafana with the following information: + +* *Text*: ` ` +* *Timestamp* of the event +* Tags: + * Event Type + * Event + * Container + * Image + * Image Tag + +These annotations can be visualized in several ways on Grafana such as a list of recent events: + +![Grafana Annotations List](https://github.com/philosowaffle/docgrag/raw/main/images/annotations_list.png?raw=true "Grafana Annotations List") + +Or overlayed on top of other charts to correlate container events with out system metrics: + +![Annotation Overlay Demo](https://github.com/philosowaffle/docgrag/raw/main/images/annotation_overlay_demo.png?raw=true "Annotation Overlay Demo") \ No newline at end of file diff --git a/docs/features/index.md b/docs/features/index.md new file mode 100644 index 0000000..d77a8b0 --- /dev/null +++ b/docs/features/index.md @@ -0,0 +1,10 @@ +--- +layout: default +title: Features +nav_order: 3 +has_children: true +--- + +# Features + +In the DocGraf repo there is a [sample Grafana Dashboard](https://github.com/philosowaffle/docgraf/tree/main/grafana/grafana_dashboard.json) that demonstrates several different ways to use these features. diff --git a/docs/features/metrics.md b/docs/features/metrics.md new file mode 100644 index 0000000..9cfb536 --- /dev/null +++ b/docs/features/metrics.md @@ -0,0 +1,25 @@ +--- +layout: default +title: Prometheus Metrics +parent: Features +nav_order: 1 +--- + +# Prometheus Metrics + +DocGraf can be [configured]({{ site.baseurl }}{% link configuration/index.md %}#metrics-config) to expose [Prometheus Metrics](https://prometheus.io/). The metrics exposed are grouped into two categories: + +1. `docgraf_docker_events_recv` + 1. This metric will always capture all received events from the Docker daemon +1. `docgraf_docker_events_recorded` + 1. This metric will be a subset of `docgraf_docker_events_recv`, it is only the events that were recorded as Annotations + +Both metrics expose the following labels: + +1. Event Type +1. Event +1. Container +1. Image +1. Image Tag + +![Grafana Metrics Example](https://github.com/philosowaffle/docgrag/raw/main/images/metrics_example.png?raw=true "Grafana Metrics Example") \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 50cea52..fb390f4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,19 +6,20 @@ nav_order: 0 # Home -Publish annotations to Grafana based on Docker Events. +Track [Docker Events](https://docs.docker.com/engine/reference/commandline/events/) as [Annotations](https://grafana.com/docs/grafana/v9.0/dashboards/annotations/) on [Grafana](https://grafana.com/grafana/). -* Configure which events should create an Annotation -* Events are tagged with Container, Event, and Type for easy filtering +* Configure which Docker Events to monitor +* Expose Prometheus metrics for Docker Events +* Events are tagged with the following for robust filtering and querying + * Docker Event Type + * Docker Event + * Container + * Image + * Tag Head on over to the [Install]({{ site.baseurl }}{% link install/index.md %}) page to get started! -## Supported Platforms - -* Windows -* Mac -* Linux -* Docker +![Docgraf Demo](https://github.com/philosowaffle/docgrag/raw/main/images/docgraf_demo.gif?raw=true "DocGraf Demo") ## Contributors diff --git a/docs/install/docker.md b/docs/install/docker.md index 6512c4c..486eddd 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -7,63 +7,48 @@ nav_order: 0 # Docker -The recommended and easiest way to get started is with Docker. To learn more about Docker head on over to their [website](https://www.docker.com/). +The recommended and easiest way to get started is with [Docker](https://www.docker.com/). ## docker-compose -A sample [docker-compose.yaml](https://github.com/philosowaffle/docgraf/blob/master/docker-compose.yaml) file and [configuration.local.json](https://github.com/philosowaffle/docgraf/blob/master/configuration.example.json) can be found in the project repo. - -The Docker container expects a valid `configuration.local.json` file is mounted into the container. You can learn more about the configuration file over in the [Configuration Section](/{{ site.baseurl }}{% link configuration/index.md %}). - -```yaml -version: "3.9" -services: - docgraf: - image: philosowaffle/docgraf - container_name: docgraf - restart: unless-stopped - environment: - - TZ=America/Chicago - volumes: - - ./configuration.local.json:/app/configuration.local.json - - docker-proxy: - image: tecnativa/docker-socket-proxy - container_name: docker-proxy - restart: unless-stopped - environment: - - TZ=America/Chicago - volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro -``` +*Pre-requisite:* You have either `docker-compose` or `Docker Desktop` installed + +1. Create a directory `docgraf` + 1. Inside this folder create a [docker-compose.yaml](https://github.com/philosowaffle/docgraf/blob/main/docker/docker-compose.yaml) file in the directory + 1. Also create a [configuration.local.json](https://github.com/philosowaffle/docgraf/blob/main/configuration.example.json) file in the directory. +1. Edit the config file to set your Grafana host and Service Account token +1. Open a terminal in this folder +1. Run: `docker-compose pull && docker-compose up -d` + +You can learn more about customizing your configuration over in the [Configuration Section]({{ site.baseurl }}{% link configuration/index.md %}). ### Docker Daemon -It is recommened to run DocGraf against a docker proxy like `tecnativa/docker-socket-proxy`. - -### Prometheus - -If you configure DocGraf to serve Prometheus metrics then you will also need to map the corresponding port for your docker container. By default, Prometheus metrics will be served on port `4000`. You can learn more about DocGraf and Prometheus in the [Observability Configuration]({{ site.baseurl }}{% link configuration/index.md %}) section. - -```yaml -version: "3.9" -services: - docgraf: - image: philosowaffle/docgraf - container_name: docgraf - restart: unless-stopped - environment: - - TZ=America/Chicago - ports: - - 4000:4000 - volumes: - - ./configuration.local.json:/app/configuration.local.json +It is recommened to run DocGraf against a docker proxy like the provided `tecnativa/docker-socket-proxy`. + +## Repositories + +### [DockerHub](https://hub.docker.com/r/philosowaffle/docgraf) + +```bash +docker run -v /full/path/to/configuration.local.json:/app/configuration.local.json -v /full/path/to/output:/app/output philosowaffle/docgraf:stable ``` -## Docker Tags +### [GitHub Package](https://github.com/philosowaffle/docgraf/pkgs/container/docgraf) -The DocGraf docker image is available on [DockerHub](https://hub.docker.com/r/philosowaffle/docgraf). The following tags are provided: +```bash +docker run -v /full/path/to/configuration.local.json:/app/configuration.local.json -v /full/path/to/output:/app/output ghcr.io/philosowaffle/docgraf:stable +``` + +## Tags 1. `stable` - Always points to the latest release -1. `latest` - The bleeding edge of the master branch -1. `vX.Y.Z` - For using a specific released version \ No newline at end of file +1. `latest` - The bleeding edge of the master branch, breaking changes may happen +1. `X.Y.Z` - For using a specific released version + +## Docker User + +The images run the process under the user and group `docgraf:docgraf` with uid and gid `1019:1019`. To access files created by `docgraf`: + +1. Create a group on the local machine `docgraf` with group id `1019` +1. Add your user on the local machine to the `docgraf` group \ No newline at end of file diff --git a/docs/install/index.md b/docs/install/index.md index 71e25fc..796947f 100644 --- a/docs/install/index.md +++ b/docs/install/index.md @@ -1,10 +1,18 @@ --- layout: default title: Install -nav_order: 2 +nav_order: 1 has_children: true --- # Install -DocGraf can be run on all major operating systems. The recommended and easiest way to get started is with [Docker]({{ site.baseurl }}{% link install/docker.md %}). \ No newline at end of file +DocGraf can be run on all major operating systems. The recommended and easiest way to get started is with [Docker]({{ site.baseurl }}{% link install/docker.md %}). + +1. [Create a service account](https://grafana.com/docs/grafana/latest/administration/service-accounts/#create-a-service-account-in-grafana) in Grafana for DocGraf + 1. Role: Editor +1. [Add a token to the service account](https://grafana.com/docs/grafana/latest/administration/service-accounts/#add-a-token-to-a-service-account-in-grafana) + 1. Make note of this token +1. Run DocGraf + 1. [Docker]({{ site.baseurl }}{% link install/docker.md %}) + 1. [Build from Source]({{ site.baseurl }}{% link install/source.md %}) \ No newline at end of file diff --git a/docs/install/source.md b/docs/install/source.md index 767603b..fb702dd 100644 --- a/docs/install/source.md +++ b/docs/install/source.md @@ -7,18 +7,35 @@ nav_order: 1 # Build from Source -To compile and run DocGraf on your machine, follow the below steps: +To compile and run the server on your machine, follow the below steps. -1. Install the [dotnet 6.0 sdk](https://dotnet.microsoft.com/download/dotnet/6.0) -1. Clone this repository locally +## dotnet 6.0 + +1. Install the latest [dotnet 6.0 SDK](https://dotnet.microsoft.com/download/dotnet/6.0) +1. Clone the GitHub repository locally 1. In the local repo, find the file named `configuration.example.json`. Make a copy of it and name it `configuration.local.json`. 1. Move `configuration.local.json` into the `src/Console` directory -1. Open `configuration.local.json` in a text editor of your choice and configure your settings. -1. Open a terminal and run the below: +1. Open a terminal and run the below one-time setup steps: ```bash -> cd docgraf +> cd src/Console > dotnet restore > dotnet build +``` + +## To run + +```bash +> dotnet run --project ./src/Console/Console.csproj +``` + +## Updating + +```bash +> git fetch +> git pull +> cd `docgraf` +> dotnet restore ./src/Console/Console.csproj +> dotnet build ./src/Console/Console.csproj > dotnet run --project ./src/Console/Console.csproj ``` \ No newline at end of file diff --git a/grafana/grafana_dashboard.json b/grafana/grafana_dashboard.json new file mode 100644 index 0000000..41d9985 --- /dev/null +++ b/grafana/grafana_dashboard.json @@ -0,0 +1,2116 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + }, + { + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "iconColor": "blue", + "name": "Docker Container Events", + "target": { + "limit": 300, + "matchAny": false, + "tags": [ + "docker_container_event", + "docgraf" + ], + "type": "tags" + } + } + ] + }, + "description": "A starter Grafana dashboard for monitoring Docker Events", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 77, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [], + "targetBlank": true, + "title": "GitHub", + "tooltip": "Got to GitHub", + "type": "link", + "url": "https://github.com/philosowaffle/docgraf" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [], + "targetBlank": true, + "title": "Docs", + "tooltip": "Docs site", + "type": "link", + "url": "https://philosowaffle.github.io/docgraf/" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [], + "targetBlank": true, + "title": "Forum", + "tooltip": "Forum", + "type": "link", + "url": "https://github.com/philosowaffle/docgraf/discussions" + }, + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": false, + "tags": [], + "targetBlank": true, + "title": "Donate", + "tooltip": "Buy me a coffee", + "type": "link", + "url": "https://www.buymeacoffee.com/philosowaffle" + } + ], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 50, + "panels": [], + "title": "README", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "BDhSj5Xnk" + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 1 + }, + "id": 52, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# DocGraf Example Dashboard\n\n## Filters\n\nFilters can be applied to view different subsets of the data.\n\n* MetricSource - Your metrics Datasource\n* LogSrouce - Your logs Datasource\n* ContainerName - Filter for events for a given container\n* EventType - Filter by a specific EventType\n* Event - Filter by a specific Event\n* Image - Filter for events for a given image\n\n## Container Events Annotations\n\nA toggle is provided for displaying docker container events as annotations.", + "mode": "markdown" + }, + "pluginVersion": "9.2.0", + "type": "text" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 13 + }, + "id": 30, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": 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" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 0, + "y": 14 + }, + "id": 32, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "sum(irate(docgraf_docker_events_recv{event_type=~\"$EventType\", event=~\"$Event\", image=~\"$Image\", container=~\"$ContainerName\"}[$__rate_interval]))", + "interval": "", + "legendFormat": "Events Recv", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "sum(irate(docgraf_docker_events_recorded{event_type=~\"$EventType\", event=~\"$Event\", image=~\"$Image\", container=~\"$ContainerName\"}[$__rate_interval]))", + "hide": false, + "interval": "", + "legendFormat": "Events Recorded", + "range": true, + "refId": "B" + } + ], + "title": "All Events", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": 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" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 12, + "x": 12, + "y": 14 + }, + "id": 34, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "sum by(container) (irate(docgraf_docker_events_recv{event_type=~\"$EventType\", event=~\"$Event\", image=~\"$Image\", container=~\"$ContainerName\"}[$__rate_interval]))", + "interval": "", + "legendFormat": "{{ container }}", + "range": true, + "refId": "A" + } + ], + "title": "All Events by Container", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": 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" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 23 + }, + "id": 36, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(irate(docgraf_docker_events_recv{event_type=~\"$EventType\", event=~\"$Event\", image=~\"$Image\", container=~\"$ContainerName\"}[$__rate_interval])) by (event_type)", + "interval": "", + "legendFormat": "{{ event_type}}", + "range": true, + "refId": "A" + } + ], + "title": "All Events by Event Type", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "BDhSj5Xnk" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": 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" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 23 + }, + "id": 38, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "BDhSj5Xnk" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum(irate(docgraf_docker_events_recv{event_type=~\"$EventType\", event=~\"$Event\", image=~\"$Image\", container=~\"$ContainerName\"}[$__rate_interval])) by (event)", + "interval": "", + "legendFormat": "{{ event}}", + "range": true, + "refId": "A" + } + ], + "title": "All Events by Event", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "decimals": 2, + "mappings": [], + "max": 100, + "min": 0, + "noValue": "0", + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Events Received" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Events Recorded" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 0, + "y": 33 + }, + "id": 40, + "interval": "10m", + "options": { + "displayLabels": [ + "percent", + "name" + ], + "legend": { + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(sum_over_time(docgraf_docker_events_recorded{event_type=~\"$EventType\", event=~\"$Event\", image=~\"$Image\", container=~\"$ContainerName\"}[$__interval]))", + "format": "time_series", + "instant": false, + "interval": "", + "legendFormat": "Events Recorded", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "sum(sum_over_time(docgraf_docker_events_recv{event_type=~\"$EventType\", event=~\"$Event\", image=~\"$Image\", container=~\"$ContainerName\"}[$__interval])) \r\n- \r\nsum(sum_over_time(docgraf_docker_events_recorded{event_type=~\"$EventType\", event=~\"$Event\", image=~\"$Image\", container=~\"$ContainerName\"}[$__interval]))", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "Events Received", + "range": true, + "refId": "B" + } + ], + "transparent": true, + "type": "piechart" + } + ], + "title": "Events", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 14 + }, + "id": 4, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "bDGhbf8Gk" + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 2, + "options": { + "limit": 100, + "navigateAfter": "10m", + "navigateBefore": "10m", + "navigateToPanel": false, + "onlyFromThisDashboard": false, + "onlyInTimeRange": false, + "showTags": true, + "showTime": true, + "showUser": false, + "tags": [] + }, + "title": "Events", + "type": "annolist" + } + ], + "title": "Event Annotations", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 6, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "BDhSj5Xnk" + }, + "gridPos": { + "h": 4, + "w": 18, + "x": 0, + "y": 16 + }, + "id": 8, + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "# DocGraf Service Monitoring\n", + "mode": "markdown" + }, + "pluginVersion": "9.2.0", + "type": "text" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(67, 113, 150)", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 3, + "x": 18, + "y": 16 + }, + "id": 44, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^version$/", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "exemplar": false, + "expr": "docgraf_build_info{}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Version", + "transparent": true, + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(67, 113, 150)", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 3, + "x": 21, + "y": 16 + }, + "id": 48, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^dotnet_runtime$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "exemplar": false, + "expr": "docgraf_build_info{}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "DotNet Runtime", + "transparent": true, + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(67, 113, 150)", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 3, + "x": 18, + "y": 18 + }, + "id": 46, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "/^os_version$/", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "exemplar": false, + "expr": "docgraf_build_info{}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "OS Version", + "transparent": true, + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(67, 113, 150)", + "mode": "thresholds" + }, + "mappings": [], + "noValue": "Down", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(144, 20, 20, 1)" + }, + { + "color": "rgb(67, 113, 150)", + "value": 1 + } + ] + }, + "unit": "dtdurations" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 3, + "x": 21, + "y": 18 + }, + "id": 42, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "value" + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "exemplar": false, + "expr": "time() - process_start_time_seconds{job=\"docgraf\"}", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "Uptime", + "transparent": true, + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "${LogsSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 100, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(67, 113, 150)" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "debug" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "error" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "info" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "rgb(67, 113, 150)", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "warning" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "critical" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "trace" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 4, + "w": 10, + "x": 0, + "y": 20 + }, + "id": 12, + "interval": "1m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.0.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "${LogsSource}" + }, + "editorMode": "code", + "expr": "sum by(level) (rate({container_name=\"docgraf\"} | json | __error__ != `JSONParserErr` [1m]))", + "legendFormat": "{{level}}", + "queryType": "range", + "refId": "A" + } + ], + "title": "Logs", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 88, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": 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" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "CPU Process Secodns" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "rgb(67, 113, 150)", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 14, + "x": 10, + "y": 20 + }, + "id": 16, + "interval": "2m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "rate(process_cpu_seconds_total{job=\"docgraf\"}[$__interval])", + "hide": false, + "interval": "", + "legendFormat": "{{instance}} CPU Process Seconds", + "range": true, + "refId": "B" + } + ], + "title": "CPU", + "type": "timeseries" + }, + { + "datasource": { + "type": "loki", + "uid": "${LogsSource}" + }, + "gridPos": { + "h": 16, + "w": 10, + "x": 0, + "y": 24 + }, + "id": 14, + "links": [], + "options": { + "dedupStrategy": "none", + "enableLogDetails": true, + "prettifyLogMessage": false, + "showCommonLabels": false, + "showLabels": false, + "showTime": true, + "sortOrder": "Descending", + "wrapLogMessage": true + }, + "pluginVersion": "7.5.1", + "targets": [ + { + "alias": "", + "bucketAggs": [ + { + "id": "2", + "settings": { + "interval": "auto" + }, + "type": "date_histogram" + } + ], + "datasource": { + "type": "loki", + "uid": "${LogsSource}" + }, + "editorMode": "builder", + "expr": "{container_name=\"docgraf\"}", + "metrics": [ + { + "id": "1", + "type": "count" + } + ], + "query": "", + "queryType": "range", + "refId": "A", + "timeField": "@timestamp" + } + ], + "title": "Logs", + "transparent": true, + "type": "logs" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 89, + "gradientMode": "hue", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "log": 2, + "type": "log" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Process Virtual Memory Bytes" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "rgb(67, 113, 150)", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Process Private Memory Bytes" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 14, + "x": 10, + "y": 27 + }, + "id": 18, + "interval": "2m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "dotnet_total_memory_bytes{job=\"docgraf\"}", + "hide": false, + "interval": "", + "legendFormat": "DotNet Total Memory Bytes", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "process_working_set_bytes{job=\"docgraf\"}", + "hide": false, + "interval": "", + "legendFormat": "Process Working Set (RAM)", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "process_private_memory_bytes{job=\"docgraf\"}", + "hide": false, + "interval": "", + "legendFormat": "Process Private Memory Bytes", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "process_virtual_memory_bytes{job=\"docgraf\"}", + "hide": false, + "interval": "", + "legendFormat": "Process Virtual Memory Bytes", + "range": true, + "refId": "E" + } + ], + "title": "Memory", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "{instance=\"192.168.1.94:4051\", job=\"p2g\"}" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "rgb(67, 113, 150)", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 6, + "w": 14, + "x": 10, + "y": 34 + }, + "id": 20, + "interval": "2m", + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "8.0.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "increase(process_num_threads{job=\"docgraf\"}[$__interval])", + "hide": false, + "interval": "", + "legendFormat": "", + "range": true, + "refId": "B" + } + ], + "title": "Num Threads", + "type": "timeseries" + } + ], + "title": "DocGraf Service Monitoring", + "type": "row" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 22, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "color": "red", + "index": 0, + "text": "Down" + }, + "1": { + "color": "rgb(67, 113, 150)", + "index": 1, + "text": "Up" + } + }, + "type": "value" + } + ], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(67, 113, 150)" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 3, + "x": 0, + "y": 17 + }, + "id": 24, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": false, + "text": {} + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "up{job=\"docgraf\"}", + "interval": "", + "legendFormat": "", + "range": true, + "refId": "A" + } + ], + "type": "gauge" + }, + { + "datasource": {}, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(67, 113, 150)" + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 5, + "w": 4, + "x": 3, + "y": 17 + }, + "id": 26, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "scrape_samples_scraped{job=\"docgraf\"}", + "interval": "", + "legendFormat": "", + "range": true, + "refId": "A" + } + ], + "title": "Samples Scraped", + "type": "stat" + }, + { + "datasource": {}, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": 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" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "{instance=\"192.168.1.94:4051\", job=\"p2g\"}" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "rgb(67, 113, 150)", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 5, + "w": 17, + "x": 7, + "y": 17 + }, + "id": 28, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${Datasource}" + }, + "editorMode": "builder", + "exemplar": true, + "expr": "irate(scrape_duration_seconds{job=\"docgraf\"}[$__rate_interval])", + "interval": "", + "legendFormat": "", + "range": true, + "refId": "A" + } + ], + "title": "Scrape Duration Seconds", + "type": "timeseries" + } + ], + "title": "Scrape Metrics", + "type": "row" + } + ], + "refresh": "30s", + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": [ + "Mimir" + ], + "value": [ + "Mimir" + ] + }, + "hide": 0, + "includeAll": false, + "multi": true, + "name": "MetricSource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "selected": true, + "text": [ + "Loki" + ], + "value": [ + "Loki" + ] + }, + "hide": 0, + "includeAll": false, + "multi": true, + "name": "LogsSource", + "options": [], + "query": "loki", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "allValue": ".+", + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "definition": "label_values(docgraf_docker_events_recv, container)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "ContainerName", + "options": [], + "query": { + "query": "label_values(docgraf_docker_events_recv, container)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": ".+", + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "definition": "label_values(docgraf_docker_events_recv, event_type)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "EventType", + "options": [], + "query": { + "query": "label_values(docgraf_docker_events_recv, event_type)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": ".+", + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "definition": "label_values(docgraf_docker_events_recv, event)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "Event", + "options": [], + "query": { + "query": "label_values(docgraf_docker_events_recv, event)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "allValue": ".+", + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "${MetricSource}" + }, + "definition": "label_values(docgraf_docker_events_recv, image)", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "Image", + "options": [], + "query": { + "query": "label_values(docgraf_docker_events_recv, image)", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "DocGraf", + "uid": "3mkyPBNVz", + "version": 22, + "weekStart": "" + } \ No newline at end of file diff --git a/images/annotation_list.png b/images/annotation_list.png new file mode 100644 index 0000000..5e8cf5b Binary files /dev/null and b/images/annotation_list.png differ diff --git a/images/annotation_overlay_demo.gif b/images/annotation_overlay_demo.gif new file mode 100644 index 0000000..de696e3 Binary files /dev/null and b/images/annotation_overlay_demo.gif differ diff --git a/images/docgraf_demo.gif b/images/docgraf_demo.gif new file mode 100644 index 0000000..74dee28 Binary files /dev/null and b/images/docgraf_demo.gif differ diff --git a/images/metrics_example.png b/images/metrics_example.png new file mode 100644 index 0000000..baeee8c Binary files /dev/null and b/images/metrics_example.png differ diff --git a/vNextReleaseNotes.md b/vNextReleaseNotes.md index 4224704..be3c048 100644 --- a/vNextReleaseNotes.md +++ b/vNextReleaseNotes.md @@ -4,13 +4,15 @@ ## Features * Check for new version on startup +* Sample Grafana Dashboard provided in Repo ## Fixes -* Memory Link from Tempo traces +* Memory leak from Tempo traces ## Changes * Refactor * Version bumps -* Config: `Prometheus` section renamed to `Metrics` \ No newline at end of file +* Config: `Prometheus` section renamed to `Metrics` +* Updates to docs site \ No newline at end of file