{"id":19541598,"url":"https://github.com/brigadecore/brigade-metrics","last_synced_at":"2025-04-26T17:30:50.993Z","repository":{"id":37787293,"uuid":"387625236","full_name":"brigadecore/brigade-metrics","owner":"brigadecore","description":"Collect and visualize metrics from Brigade 2","archived":false,"fork":false,"pushed_at":"2023-02-25T11:09:26.000Z","size":275,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-04T16:27:46.525Z","etag":null,"topics":["brigade","metrics","monitoring","v2"],"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/brigadecore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-20T00:13:41.000Z","updated_at":"2024-07-10T15:31:22.000Z","dependencies_parsed_at":"2024-06-19T05:28:40.206Z","dependency_job_id":"c2324036-29c2-4d6c-a200-2409218b53e8","html_url":"https://github.com/brigadecore/brigade-metrics","commit_stats":{"total_commits":79,"total_committers":4,"mean_commits":19.75,"dds":"0.15189873417721522","last_synced_commit":"e7f4e1a82a37996a3720fd46f6e8b80db0c3f3d8"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brigadecore%2Fbrigade-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brigadecore","download_url":"https://codeload.github.com/brigadecore/brigade-metrics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251025592,"owners_count":21524829,"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":["brigade","metrics","monitoring","v2"],"created_at":"2024-11-11T03:11:12.836Z","updated_at":"2025-04-26T17:30:50.645Z","avatar_url":"https://github.com/brigadecore.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brigade Metrics: Monitoring for Brigade 2\n\n![build](https://badgr.brigade2.io/v1/github/checks/brigadecore/brigade-metrics/badge.svg?appID=99005)\n[![codecov](https://codecov.io/gh/brigadecore/brigade-metrics/branch/main/graph/badge.svg?token=ER6NYB0V9K)](https://codecov.io/gh/brigadecore/brigade-metrics)\n[![Go Report Card](https://goreportcard.com/badge/github.com/brigadecore/brigade-metrics)](https://goreportcard.com/report/github.com/brigadecore/brigade-metrics)\n[![slack](https://img.shields.io/badge/slack-brigade-brightgreen.svg?logo=slack)](https://kubernetes.slack.com/messages/C87MF1RFD)\n\n\u003cimg width=\"100\" align=\"left\" src=\"logo.png\"\u003e\n\nBrigade Metrics adds monitoring capabilities to a Brigade 2 installation. It\nutilizes Brigade APIs to export time series metrics to Prometheus and makes\nvisualizations of those metrics available through a Grafana dashboard.\n\n\u003cbr clear=\"left\"/\u003e\n\n## Installation\n\nPrerequisites:\n\n* A Kubernetes cluster:\n    * For which you have the `admin` cluster role\n    * That is already running Brigade 2\n    * Capable of provisioning a _public IP address_ for a service of type\n      `LoadBalancer`. (This means you won't have much luck running the gateway\n      locally in the likes of kind or minikube unless you're able and willing to\n      mess with port forwarding settings on your router, which we won't be\n      covering here.)\n\n* `kubectl`, `helm` (commands below require Helm 3.7.0+), and `brig` (the\n  Brigade 2 CLI)\n\n### 1. Create a Service Account\n\n__Note:__ To proceed beyond this point, you'll need to be logged into Brigade 2\nas the \"root\" user (not recommended) or (preferably) as a user with the `ADMIN`\nrole. Further discussion of this is beyond the scope of this documentation.\nPlease refer to Brigade's own documentation.\n\nUsing Brigade 2's `brig` CLI, create a service account:\n\n```shell\n$ brig service-account create \\\n    --id brigade-metrics \\\n    --description brigade-metrics\n```\n\nMake note of the __token__ returned. This value will be used in another step.\n_It is your only opportunity to access this value, as Brigade does not save it._\n\nAuthorize this service account with read-only access to Brigade:\n\n```shell\n$ brig role grant READER \\\n    --service-account brigade-metrics\n```\n\n### 2. Installing Brigade Metrics\n\nFor now, we're using the [GitHub Container Registry](https://ghcr.io) (which is\nan [OCI registry](https://helm.sh/docs/topics/registries/)) to host our Helm\nchart. Helm 3.7 has _experimental_ support for OCI registries. In the event that\nthe Helm 3.7 dependency proves troublesome for users, or in the event that this\nexperimental feature goes away, or isn't working like we'd hope, we will revisit\nthis choice before going GA.\n\nFirst, be sure you are using\n[Helm 3.7.0](https://github.com/helm/helm/releases/tag/v3.7.0) or greater and\nenable experimental OCI support:\n\n```shell\n$ export HELM_EXPERIMENTAL_OCI=1\n```\n\nUse the following command to extract the full set of configuration options from\nthe chart. Here we're storing a copy at `~/brigade-metrics-values.yaml`:\n\n```shell\n$ helm inspect values oci://ghcr.io/brigadecore/brigade-metrics \\\n    --version v0.4.1 \u003e ~/brigade-metrics-values.yaml\n```\n\nEdit the configuration (`~/brigade-metrics-values.yaml` in this example). At\nminimum, you will need to make the following changes:\n\n* Set the value of `exporter.brigade.apiAddress` to the address of your Brigade 2\n  API server. This should utilize the _internal_ DNS hostname by which that API\n  server is reachable _within_ your Kubernetes cluster. This value is defaulted\n  to `https://brigade-apiserver.brigade.svc.cluster.local`, but may need to be\n  updated if you installed Brigade 2 in a different namespace.\n\n* Set the value of `exporter.brigade.apiToken` to the service account token that\n  was generated earlier.\n\n* `grafana.host`: Set this to the host name where you'd like the dashboard\n  (Grafana) to be accessible.\n\n* Specify a username and password for the metrics dashboard by setting values\n  for `grafana.auth.username` and `grafana.auth.password`.\n\n* `grafana.service.type`: If you plan to enable ingress (advanced), you can\n  leave this as its default -- `ClusterIP`. If you do not plan to enable\n  ingress, you probably will want to change this value to `LoadBalancer`.\n\nInstall Brigade Metrics, referencing your edited configuration:\n\n```shell\n$ helm install brigade-metrics \\\n    oci://ghcr.io/brigadecore/brigade-metrics \\\n    --version v0.4.1 \\\n    --create-namespace \\\n    --namespace brigade-metrics \\\n    --values ~/brigade-metrics-values.yaml \\\n    --wait \\\n    --timeout 300s\n```\n\n### 3. (RECOMMENDED) Create a DNS Entry\n\nIf you overrode defaults and set `grafana.service.type` to `LoadBalancer`, use\nthis command to find the gateway's public IP address:\n\n```shell\n$ kubectl get svc brigade-metrics-grafana \\\n    --namespace brigade-metrics \\\n    --output jsonpath='{.status.loadBalancer.ingress[0].ip}'\n```\n\nIf you overrode defaults and enabled support for an ingress controller, you\nprobably know what you're doing well enough to track down the correct IP without\nour help. 😉\n\nWith this public IP in hand, edit your name servers and add an `A` record\npointing your domain to the public IP.\n\n### 4. Accessing the Dashboard\n\nIf you overrode defaults and set `grafana.service.type` to `LoadBalancer`, then\nthe dashboard should be accessible over HTTPS at the public IP address or DNS\nhostname.\n\nIf you kept the default setting of `ClusterIP` for `grafana.service.type`, then\nuse port forwarding to expose the dashboard on your local network interface:\n\n```shell\n$ kubectl port-forward \\\n    service/brigade-metrics-grafana \\\n    --namespace brigade-metrics \\\n    8443:443\n```\n\nIn this case, the dashboard should be accessible at `https://localhost:8443`.\nExpect to receive a cert warning.\n\nLog in using the username and password you selected in the previous section.\n\n## Contributing\n\nThe Brigade project accepts contributions via GitHub pull requests. The\n[Contributing](CONTRIBUTING.md) document outlines the process to help get your\ncontribution accepted.\n\n## Support \u0026 Feedback\n\nWe have a slack channel!\n[Kubernetes/#brigade](https://kubernetes.slack.com/messages/C87MF1RFD) Feel free\nto join for any support questions or feedback, we are happy to help. To report\nan issue or to request a feature open an issue\n[here](https://github.com/brigadecore/brigade-metrics/issues)\n\n## Code of Conduct\n\nParticipation in the Brigade project is governed by the\n[CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrigadecore%2Fbrigade-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrigadecore%2Fbrigade-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrigadecore%2Fbrigade-metrics/lists"}