{"id":20331158,"url":"https://github.com/comcast/prombox","last_synced_at":"2025-05-08T01:31:14.082Z","repository":{"id":51284150,"uuid":"286531276","full_name":"Comcast/prombox","owner":"Comcast","description":"Prombox creates a sandbox environment for editing and testing Prometheus configuration on the fly","archived":true,"fork":false,"pushed_at":"2021-10-26T20:21:30.000Z","size":818,"stargazers_count":12,"open_issues_count":2,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-20T10:21:28.787Z","etag":null,"topics":["go","hacktoberfest","prometheus","vuejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Comcast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-10T16:54:24.000Z","updated_at":"2025-02-03T17:10:10.000Z","dependencies_parsed_at":"2022-09-11T15:22:45.205Z","dependency_job_id":null,"html_url":"https://github.com/Comcast/prombox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fprombox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fprombox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fprombox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Comcast%2Fprombox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Comcast","download_url":"https://codeload.github.com/Comcast/prombox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252981490,"owners_count":21835436,"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":["go","hacktoberfest","prometheus","vuejs"],"created_at":"2024-11-14T20:19:01.407Z","updated_at":"2025-05-08T01:31:13.616Z","avatar_url":"https://github.com/Comcast.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/github/license/Comcast/prombox)](/LICENSE) [![CI Pipeline Workflow](https://github.com/Comcast/prombox/workflows/CI%20Pipeline/badge.svg?branch=main)](https://github.com/Comcast/prombox/actions?query=workflow%3A%22CI+Pipeline%22+branch%3A%22main%22)\n\n# Prombox\nSandbox environment for editing and testing prometheus configuration on the fly.\n\n## Motivation\n\n[Prometheus](https://prometheus.io) users often have trouble configuring new targets or creating alerts and recording rules because getting the YAML syntax exactly right can be a struggle. When running Prometheus locally this isn't as big of a challenge because you have direct access to the config file and can make changes quickly. Once Prometheus is deployed into a production environment, however, this becomes challenging because you don't have the ability to re-create the same combination of configuration and environment.\n\nThis is especially challenging when you're taking advantage of some service discovery methods provided by Prometheus, like AWS EC2 discovery. You may be able to discover your instance hosts via the AWS EC2 API, but accessing the endpoint your application exposes metrics on may not work due to firewall rules. Prometheus needs to live within your AWS VPC or private network in order for the metric scraping to occur successfully.\n\nFor these reasons, we built \"Prombox\", a lightweight UI that allows users to build the Prometheus config file and alerts/recording rules. This could be deployed within your environment (AWS VPC, etc) along with an instance of Prometheus that mimics your production instance. This would create a \"sandbox\" that allows you to \"play\" with new rules and configuration options to see how they would work.\n\n![](docs/images/prombox.png)\n\n## Build and Run Docker image\n\n### Build Prombox\n\n```\nmake build\n```\n\n### Build Docker Image\n```\ndocker build -t prombox -f build/Dockerfile .\n```\n\n### Run docker-compose\n\n```\ndocker-compose up\n```\n\n### Access UI\n\nThe Prombox UI is accessible at `http://localhost:3000`\n\nThe Prometheus UI is accessible at `http://localhost:9090`\n\n## Run and Test Locally\n\n### Set Environment Variables\n\n#### Required\n```bash\nexport PROMETHEUS_ADDRESS=http://localhost:9090\nexport PROMETHEUS_FRAME_ADDRESS=http://localhost:9090\nexport PROMETHEUS_CONFIG=$(pwd)/prometheus/prometheus.yml\n```\n#### Optional\n```bash\nexport PORT=3000 (default: 3000)\nexport CORS_ALLOW_ORIGIN=http://localhost:8080 (default: empty)\n```\n\n### Run\n\n1. Run Prometheus at :9090 (using configuration in `/data/prometheus/prometheus.yml`)\n    ```\n    docker run \\\n        -p 9090:9090 \\\n        --mount type=bind,source=\"$(pwd)\"/data/prometheus/prometheus.yml,target=/etc/prometheus/prometheus.yml \\\n        prom/prometheus:v2.28.1 \\\n        --web.enable-lifecycle \\\n        --config.file=/etc/prometheus/prometheus.yml \\\n        --storage.tsdb.path=/prometheus \\\n        --web.console.libraries=/etc/prometheus/console_libraries \\\n        --web.console.templates=/etc/prometheus/consoles\n    ```\n1. Run Alertmanager at :9093 (using configuration in `/data/alertmanager/alertmanager.yml`)\n    ```\n    docker run \\\n        -p 9093:9093 -p 9094:9094 \\\n        --mount type=bind,source=\"$(pwd)\"/data/alertmanager/alertmanager.yml,target=/etc/alertmanager/alertmanager.yml \\\n        prom/alertmanager:v0.22.0 \\\n        --config.file=/etc/alertmanager/alertmanager.yml \\\n        --storage.path=/alertmanager \\\n        --log.level=info\n    ```\n\n2. Run API at :3000\n    ```\n    export PROMETHEUS_ADDRESS=http://localhost:9090\n    export PROMETHEUS_FRAME_ADDRESS=http://localhost:9090\n    export PROMETHEUS_CONFIG=$(pwd)/data/prometheus/prometheus.yml\n    export CORS_ALLOW_ORIGIN=http://localhost:8080\n    make run-api-dev\n    ```\n\n3. Run ui with hot-reloading at :8080\n    ```\n    make run-ui-dev\n    ```\n\n## Lint\nLinting go (go fmt + go vet + golint) and vue (npm lint) source code\n```\nmake lint\n```\n\n## Test\n\n### Unit Tests\nRun unit tests for ui\n```\nmake test-ui\n```\n\nRun unit tests for go\n```\nmake test-api\n```\n\nRun unit tests for both ui and go\n```\nmake test\n```\n\n## Upgrading Dependencies\n\n### Prometheus\nhttps://github.com/prometheus/prometheus/issues/7663\nhttps://github.com/prometheus/prometheus/issues/9302\n\n`go get github.com/prometheus/prometheus@v2.28.1` doesn't work because prometheus doesn't follow golang version semantics. Instead, use one of the following commands:\n\n- `go get github.com/prometheus/prometheus@release-2.28`\n- `go get github.com/prometheus/prometheus@b094459` (Given that `b094459` is the commit for `v2.28.1`)\n\nIn both cases, you will see `github.com/prometheus/prometheus v1.8.2-0.20210701133801-b0944590a1c9` in the `go.mod` file.\n\n### Go mody tidy\nClean up the go.sum file with `go mod tidy`\n\n## Copyright and License\nThis project is made available under the [Apache License, Version 2.0](LICENSE). Copyright information can be found in [NOTICE](NOTICE).\n\n## Code of Conduct\nSee the [Code of Conduct](CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fprombox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomcast%2Fprombox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomcast%2Fprombox/lists"}