{"id":15481874,"url":"https://github.com/zosmac/gomon-datasource","last_synced_at":"2025-09-01T20:33:43.770Z","repository":{"id":53516876,"uuid":"430904172","full_name":"zosmac/gomon-datasource","owner":"zosmac","description":"Grafana Data Source Plugin and Nodegraph Panel Dashboard for Identifying and Displaying Inter-process Connections.","archived":false,"fork":false,"pushed_at":"2024-04-07T23:55:56.000Z","size":12874,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-19T05:19:12.962Z","etag":null,"topics":["golang","grafana","grafana-dashboard","grafana-datasource","grafana-plugin","nodegraph"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zosmac.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-23T00:07:13.000Z","updated_at":"2022-07-31T16:02:00.000Z","dependencies_parsed_at":"2024-04-08T00:47:16.753Z","dependency_job_id":null,"html_url":"https://github.com/zosmac/gomon-datasource","commit_stats":{"total_commits":61,"total_committers":2,"mean_commits":30.5,"dds":0.2786885245901639,"last_synced_commit":"dd1253a9a128c3e3e0681d14f2335cbf537dd1cf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zosmac%2Fgomon-datasource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zosmac%2Fgomon-datasource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zosmac%2Fgomon-datasource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zosmac%2Fgomon-datasource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zosmac","download_url":"https://codeload.github.com/zosmac/gomon-datasource/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246046312,"owners_count":20714951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","grafana","grafana-dashboard","grafana-datasource","grafana-plugin","nodegraph"],"created_at":"2024-10-02T05:06:43.705Z","updated_at":"2025-03-28T14:32:52.872Z","avatar_url":"https://github.com/zosmac.png","language":"Go","readme":"# Welcome to the Gomon Backend Data Source Plugin for Grafana\n\n![gomon data source](assets/gopher.png)\n\n- [Overview](#overview)\n- [Installing the Gomon Data Source](#installing-the-gomon-data-source)\n  - [Pre-requisites](#pre-requisites)\n  - [Download the Gomon Data Source](#download-the-gomon-data-source)\n  - [Build the Data Source Frontend](#build-the-data-source-frontend)\n  - [Build the Data Source Backend](#build-the-data-source-backend)\n  - [Install the Data Source](#install-the-data-source)\n- [Employing Prometheus, Loki, and Grafana](#employing-prometheus-loki-and-grafana)\n  - [Prometheus](#prometheus)\n  - [Loki](#loki)\n  - [Grafana](#grafana)\n- [Putting it all together](#putting-it-all-together)\n  - [Start the servers](#start-the-servers)\n    - [Prometheus](#prometheus-1)\n    - [Loki](#loki-1)\n    - [Grafana](#grafana-1)\n  - [Add Prometheus and Loki Data Sources to Grafana](#add-prometheus-and-loki-data-sources-to-grafana)\n    - [Configure the Prometheus Data Source](#configure-the-prometheus-data-source)\n    - [Configure the Loki Data Source](#configure-the-loki-data-source)\n  - [Install the Gomon Data Source Dashboard to Grafana](#install-the-gomon-data-source-dashboard-to-grafana)\n- [Visualize](#visualize)\n  - [Gomon Data Source Dashboard](#gomon-data-source-dashboard)\n  - [Grafana Inter-process and remote host connections node graph](#grafana-inter-process-and-remote-host-connections-node-graph)\n  - [Graphviz Inter-process and remote host connections node graph](#graphviz-inter-process-and-remote-host-connections-node-graph)\n- [Notices](#notices)\n\n## Overview\n\nThe [Gomon Data Source](https://github.com/zosmac/gomon-datasource) measures the state of the system, including its CPU, memory, filesystems, network interfaces, and processes. The Data Source also observes system logs and the system's management of files and processes. Hence, data source processing consists of two fundamental operations: measurement and observation.\n\nThe measurements of the system are performed through kernel interfaces that report the state of resources of the system: the CPU, the memory, the filesystems, the network interfaces, and the processes.\n\nThe observations of the system are events captured by the logging, file management, and process management subsystems. While not observing these events directly, the Data Source assumes that subsystem reporting is timely. A potential enhancement would be for the data source to initiate its own log, file, and process events to measure periodically the lag between initiation and reporting of these events.\n\nThe Gomon Data Source streams the measurements to [Prometheus](http://prometheus.io) and the observations to [Loki](https://grafana.com/oss/loki/) to record. In turn, [Grafana](https://grafana.com) references Prometheus and Loki to chart the measurements and report the observations. The data source `assets` folder includes a [Grafana Dashboard](assets/dashboard.json) to graph the streams to illustrate system conditions.\n\nThe data source can also format and present the system's inter-process connections in a [Grafana Node Graph Panel](https://grafana.com/docs/grafana/latest/panels/visualizations/node-graph/). Alternatively, if [Graphviz](\u003chttps://graphviz.org\u003e) is installed, the data source can render the inter-process connections node graph in a web view.\n\nFor more information about backend plugins, refer to the documentation on [Grafana Backend Plugins](https://grafana.com/docs/grafana/latest/developers/plugins/backend/).\n\n## Installing the Gomon Data Source\n\n### Pre-requisites\n\nBuilding the frontend component depends on the [Node](https://nodejs.org) runtime. Download the Node installer for your system and install.\n\nBuilding the backend component depends on [Go](https://golang.org). Download [Go's installer](https://golang.org/dl) for your system and install.\n\nThe plugin’s build and deployment use the [Mage](https://magefile.org) build tool. Follow the instructions on the site to install Mage.\n\n### Download the [Gomon Data Source](https://github.com/zosmac/gomon-datasource)\n\n```sh\ngit clone https://github.com/zosmac/gomon-datasource\ncd gomon-datasource\n```\n\n### Build the Data Source Frontend\n\n```sh\nmage -v frontend\n```\n\n### Build the Data Source Backend\n\nNote: `backend` is the default build.\n\n```sh\nmage -v [backend]\n```\n\n### Install the Data Source\n\nThe data source backend plugin is built into the `dist` subdirectory. Copy the contents to the Grafana plugins directory. The backend’s query of process connections requires root authority. Therefore, the backend module must be owned by root with its setuid permission set.\n\n```sh\ncp -R dist/ ${PLUGINS_DIR}/zosmac-gomon-datasource\n\ncd ${PLUGINS_DIR}/zosmac-gomon-datasource\nsudo chown 0:0 gomon-datasource_$(go env GOOS)_$(go env GOARCH)\nsudo chmod u+s gomon-datasource_$(go env GOOS)_$(go env GOARCH)\n```\n\n## Employing Prometheus, Loki, and Grafana\n\nFollow these steps for deploying the three servers that record measurements ([Prometheus](http://prometheus.io)) and observations ([Loki](https://grafana.com/oss/loki/)) to facilitate visualization ([Grafana](https://grafana.com)).\n\n### Prometheus\n\n[Prometheus](http://prometheus.io) is an open-source systems monitoring server for scraping and storing time-series data. At startup, the data source opens a `/metrics` endpoint for Prometheus to collect the measurements stream.\n\nTo install Prometheus, select an appropriate binary from the [Prometheus download page](https://prometheus.io/download/) for your Operating System and Architecture, download, and install.\n\nTo enable collection, open the `prometheus.yml` configuration file for the Prometheus deployment and add the following to `scrape_configs` (a sample configuration file is in [`assets/prometheus.yml`](assets/prometheus.yml)):\n\n```yml\n  - job_name: \"gomon-datasource\"\n    scheme: https\n    tls_config:\n      ca_file: /etc/ssh/cert.pem\n    static_configs:\n      - targets: [\"localhost:1234\"]\n```\n\n### Loki\n\n[Loki](https://grafana.com/oss/loki/) is an open-source log aggregation server. Via the data source's HTTP POSTs to the `/loki/api/v1/push` endpoint, Loki receives the data source observations. To install Loki, create a `loki` folder, select appropriate `loki` and `promtail` binaries from the list of Assets on the [Loki releases page](https://github.com/grafana/loki/releases/latest) for your platform, and download. Each binary also requires a configuration file; follow the instructions on the [Loki installation page](https://grafana.com/docs/loki/latest/installation/local) to copy these to the `loki` folder.\n\n```sh\ncd ${LOKI_DIR}\nunzip =(curl -L \"https://github.com/grafana/loki/releases/latest/download/loki-$(go env GOOS)-$(go env GOARCH).zip\")\nunzip =(curl -L \"https://github.com/grafana/loki/releases/latest/download/promtail-$(go env GOOS)-$(go env GOARCH).zip\")\nchmod a+x loki-$(go env GOOS)-$(go env GOARCH) promtail-$(go env GOOS)-$(go env GOARCH)\ncurl -O -L \"https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yaml\"\ncurl -O -L \"https://raw.githubusercontent.com/grafana/loki/main/clients/cmd/promtail/promtail-local-config.yaml\"\n```\n\n### Grafana\n\nTo install Grafana, select an appropriate binary from the [Grafana download page](https://grafana.com/grafana/download) for your platform, download, and install.\n\n## Putting it all together\n\n### Start the servers\n\n#### Prometheus\n\n```sh\ncd ${PROMETHEUS_DIR}\n./prometheus \u003e\u003eprometheus.log 2\u003e\u00261 \u0026\n```\n\n#### Loki\n\n```sh\ncd ${LOKI_DIR}\n./loki-$(go env GOOS)-$(go env GOARCH) -config.file loki-local-config.yaml \u003e\u003eloki.log 2\u003e\u00261 \u0026\n```\n\n#### Grafana\n\n```sh\ncd ${GRAFANA_DIR}\nGF_PATHS_PLUGINS=${PLUGINS_DIR} GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=zosmac-gomon-datasource bin/grafana-server web \u003e\u003egrafana.log 2\u003e\u00261 \u0026\n```\n\n### Add Prometheus and Loki [Data Sources](http://localhost:3000/datasources/new) to Grafana\n\n![Grafana data sources](assets/datasource-add.png)\n\n### Configure the Prometheus Data Source\n\nNote: while the Data Source's Settings Panel shows the default data source URL, you must still type it into the URL field. Then, scroll down and select Save \u0026 test.\n\n![Configure Prometheus](assets/prometheus-config.png)\n\n### Configure the Loki Data Source\n\nNote: while the Data Source's Settings Panel shows the default data source URL, you must still type it into the URL field. Then, scroll down and select Save \u0026 test.\n\n![Configure Loki](assets/loki-config.png)\n\n### Install the [Gomon Data Source Dashboard](assets/dashboard.json) to Grafana\n\n```sh\ncurl ${GRAFANA_CRED} -X POST -i -w \"\\n\" -H \"Content-Type: application/json\" -T ./assets/dashboard.json \"http://localhost:3000/api/dashboards/db\"\n```\n\n## Visualize\n\n### Gomon Data Source Dashboard\n\n[![grafana dashboard](assets/dashboard.png)](\u003chttp://localhost:3000\u003e)\n\n### Grafana Inter-process and Remote Host Connections Node Graph\n\n![gomon data source node graph](assets/nodegraph.png)\n\n### Graphviz Inter-process and Remote Host Connections Node Graph\n\nIf [Graphviz](\u003chttps://graphviz.org\u003e) is installed, Gomon can render a node graph of the inter-process and remote host connections via the `/gomon` endpoint:\n\n[![graphviz process nodegraph](assets/graphviz.png)](\u003chttp://localhost:1234/gomon\u003e)\n\nTo download and install [Graphviz](\u003chttps://graphviz.org/download/source/\u003e), select a stable release, download its tar file, build, and install.\n\nNote: `gomon-datasource` specifies `-Tsvgz` to the `dot` command. Ensure that the zlib development library is installed on your system, e.g. on Ubuntu `sudo apt install zlib1g-dev`, on Fedora `sudo yum install zlib devel`.\n\n```sh\ntar xzvf =(curl -L \"https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/7.1.0/graphviz-7.1.0.tar.gz\")\ncd graphviz-7.1.0\n./configure\nmake\nsudo make install\n```\n\nNote: installing from the git repository (i.e. `git clone https://gitlab.com/graphviz/graphviz/`) requires pre-configuration with `autogen.sh`, which in turn requires GNU autoconf, automake, and libtool. Find details at \u003chttps://graphviz.org/download/source/#git-repos\u003e\n\n## Notices\n\nCopyright © 2021-2023 The Gomon Project.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzosmac%2Fgomon-datasource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzosmac%2Fgomon-datasource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzosmac%2Fgomon-datasource/lists"}