{"id":21971271,"url":"https://github.com/eldada/metrics-viewer","last_synced_at":"2025-10-23T16:21:43.993Z","repository":{"id":44966272,"uuid":"315585357","full_name":"eldada/metrics-viewer","owner":"eldada","description":"An Open Metrics terminal graph viewer as a standalone binary or a JFrog CLI plugin","archived":false,"fork":false,"pushed_at":"2022-01-15T10:11:32.000Z","size":643,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T09:21:51.414Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eldada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-24T09:43:16.000Z","updated_at":"2024-09-28T01:10:22.000Z","dependencies_parsed_at":"2022-09-09T05:11:12.824Z","dependency_job_id":null,"html_url":"https://github.com/eldada/metrics-viewer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":"jfrog/jfrog-cli-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fmetrics-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fmetrics-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fmetrics-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldada%2Fmetrics-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldada","download_url":"https://codeload.github.com/eldada/metrics-viewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251309132,"owners_count":21568749,"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":[],"created_at":"2024-11-29T14:49:50.513Z","updated_at":"2025-10-23T16:21:43.986Z","avatar_url":"https://github.com/eldada.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JFrog CLI metrics-viewer Plugin\nA JFrog CLI plugin or standalone binary to show [open-metrics](https://openmetrics.io/) formatted data in a terminal based graph.\n\n- JFrog Artifactory\n![The Metrics Viewer Graph - single metric](images/metrics-viewer-graph.png)\n\n- JFrog Artifactory (multiple metrics)\n![The Metrics Viewer Graph - multiple metrics](images/metrics-viewer-graph-multiple.png)\n\n## About this plugin\nThis JFrog CLI plugin is for viewing JFrog products metrics in real time in a terminal. \n\n## Building from source\nTo build the **metrics-viewer** binary\n```shell\ngo build\n```\nTo build the **metrics-viewer** binary for multiple operating systems and architectures (Mac, Linux and Windows)\n```shell\n./build-binary.sh\n```\n\n\n# Testing the code\n```shell\n# Just run the tests\ngo test ./...\n\n# Run the tests and create a coverage report\nmkdir -p out \u0026\u0026 go test -coverprofile=out/coverage.out ./... \u0026\u0026 go tool cover -html=out/coverage.out\n```\n\n## Building a Docker image\nTo build the **metrics-viewer** into a Docker image and use it\n```shell\n# Build the Docker image\ndocker build -t metrics-viewer:0.3.0 .\n\n# Test the Docker image\ndocker run --rm metrics-viewer:0.3.0 --version\n```\n\n## Installation of local binary with JFrog CLI\nIf you don't want to install the plugin from the [JFrog CLI Plugins Registry](https://github.com/jfrog/jfrog-cli-plugins-reg), it needs to be built and installed manually.\u003cbr\u003e\n\nFollow these steps to install and use this plugin with JFrog CLI.\n1. Make sure JFrog CLI is installed on you machine by running ```jf```. If it is not installed, [install](https://jfrog.com/getcli/) it.\n2. Create a directory named ```plugins``` under ```~/.jfrog/``` if it does not exist already.\n3. Clone this repository.\n4. CD into the root directory of the cloned project.\n5. Run ```go build``` to create the binary in the current directory.\n6. Copy the binary into the ```~/.jfrog/plugins``` directory.\n\n## Installation with JFrog CLI (when plugin is in the JFrog CLI Plugins Registry)\nInstalling the latest version:\n```shell\njf plugin install metrics-viewer\n```\n\nInstalling a specific version:\n```shell\njf plugin install metrics-viewer@version\n```\n\nUninstalling a plugin\n```shell\njf plugin uninstall metrics-viewer\n```\n\n## Artifactory Metrics\nYou can view [Artifactory Metrics](https://jfrog.com/help/r/jfrog-platform-administration-documentation/open-metrics) in various ways.\n\nTo try it out, you can run Artifactory as Docker container.\n\n* [Start Artifactory as a Docker](https://jfrog.com/help/r/jfrog-installation-setup-documentation/install-artifactory-single-node-with-docker) container and [enable its metrics](https://jfrog.com/help/r/jfrog-platform-administration-documentation/open-metrics)\n\n* Once Artifactory is up, you can see the metrics log file or [REST API endpoint](https://jfrog.com/help/r/jfrog-rest-apis/get-the-open-metrics-for-artifactory)\n```shell\n# See the metrics log files. For example, Artifactory and Metadata logs\ncat artifactory/log/artifactory-metrics.log\ncat artifactory/log/metadata-metrics.log\n\n# Get the metrics from Artifactory REST API\ncurl -s -uadmin:password http://localhost:8082/artifactory/api/v1/metrics\n```\n\n## Usage\n### Commands\n#### As JFrog CLI plugin\nThe **metrics-viewer** can be run as a JFrog CLI Plugin or directly as a binary\n- **Usage**\n```shell\njf metrics-viewer \u003ccommand\u003e [options]\n```  \n\n- **Commands**: See available commands by just running the binary\n```shell\njf metrics-viewer\njf metrics-viewer help\n```\n\n- **Options**: To see available options for each command, call it with the help\n```shell\njf metrics-viewer help graph \njf metrics-viewer help print \n```\n#### As a standalone binary\n- **Usage**\n```shell\n./metrics-viewer \u003ccommand\u003e [options]\n```  \n\n- **Commands**: See available commands by just running the binary\n```shell\n./metrics-viewer\n./metrics-viewer help\n```\n\n- **Options**: To see available options for each command, call it with the help\n```shell\n./metrics-viewer help graph \n./metrics-viewer help print \n```\n\n### Examples as JFrog CLI plugin\n- Using the **metrics-viewer** binary\n```shell\n# Use with the default Artifactory that is configured by the JFrog CLI\njf metrics-viewer graph\n\n# Use with direct Artifactory metrics API URL\njf metrics-viewer graph --url http://localhost:8082/artifactory/api/v1/metrics --user admin --password password\n\n# Use with direct Metadata metrics API URL (NOTE: must get an access token from Artifactory)\njf metrics-viewer graph --url http://localhost:8082/metadata/api/v1/metrics --token ${TOKEN}\n\n# Print metrics of the default Artifactory that is configured by the JFrog CLI\njf metrics-viewer print\n\n# Print metrics of the \"art17\" Artifactory with name matching the \"app_\" filter\njf metrics-viewer print --server-id art17 --filter 'app_.*'\n\n# Print selected Artifactory metrics as CSV\njf metrics-viewer print --url http://localhost:8082/artifactory/api/v1/metrics --user admin --password password \\\n    --format csv --metrics jfrt_runtime_heap_totalmemory_bytes,jfrt_db_connections_active_total\n```\n\n### Examples as standalone binary\n- Using the **metrics-viewer** binary\n```shell\n# Use with the default Artifactory that is configured by the JFrog CLI\n./metrics-viewer graph\n\n# Use with direct Artifactory metrics API URL\n./metrics-viewer graph --url http://localhost:8082/artifactory/api/v1/metrics --user admin --password password\n\n# Use with direct Metadata metrics API URL (NOTE: must get an access token from Artifactory)\n./metrics-viewer graph --url http://localhost:8082/metadata/api/v1/metrics --token ${TOKEN}\n\n# Print metrics of the default Artifactory that is configured by the JFrog CLI\n./metrics-viewer print\n\n# Print metrics of the \"art17\" Artifactory with name matching the \"app_\" filter\n./metrics-viewer print --server-id art17 --filter 'app_.*'\n\n# Print selected Artifactory metrics as CSV\n./metrics-viewer print --url http://localhost:8082/artifactory/api/v1/metrics --user admin --password password \\\n    --format csv --metrics jfrt_runtime_heap_totalmemory_bytes,jfrt_db_connections_active_total\n```\n\n- Using the Docker image\n```shell\n# Use with direct Artifactory metrics API URL\n# NOTE: The server URL has to be accessible from within the Docker container\ndocker run --rm --name metrics-viewer metrics-viewer:0.3.0 \\\n    graph --url http://artifactory-server/artifactory/api/v1/metrics --user admin --password password\n\n# Print specific metrics as CSV\n# NOTE: The Docker container needs to access the file system for the logs, so need to mount it into the container \ndocker run --rm --name metrics-viewer -v $(pwd)/artifactory:/artifactory metrics-viewer:0.3.0 \\\n    print --file /artifactory/log/artifactory-metrics.log \\\n    --format csv --metrics jfrt_runtime_heap_freememory_bytes,jfrt_runtime_heap_totalmemory_bytes\n```\n\n### The Viewer\nOnce running, the viewer will show 3 main sections\n- Left pane: Box with selected metrics and another box with list of available metrics (matching search pattern if set)\n- Center pane: Graph of selected metrics\n- Right pane: Selected metrics metadata and **Max**, **Min** and **Current** values\n\n#### Keys\n- Up/Down arrow keys: Move between available metrics\n- Space/Enter: Select/Deselect metric to view\n- \"/\": Search pattern in available metrics (supprts regex)\n  - Enter to apply pattern and jump back to metrics list\n  - ESC to clear search text\n- Ctrl+C: Exit **metrics-viewer**\n\n## Release Notes\nThe release notes are available [here](RELEASE.md).\n\n## Contributions\nA big **THANK YOU** to the **real** developers here for joining me for this idea!\n- [yinonavraham](https://github.com/yinonavraham)\n- [noamshemesh](https://github.com/noamshemesh)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldada%2Fmetrics-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldada%2Fmetrics-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldada%2Fmetrics-viewer/lists"}