{"id":17604283,"url":"https://github.com/giantswarm/prometheus-meta-operator","last_synced_at":"2025-04-07T11:06:18.133Z","repository":{"id":36953203,"uuid":"228355664","full_name":"giantswarm/prometheus-meta-operator","owner":"giantswarm","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-20T12:09:45.000Z","size":10136,"stargazers_count":19,"open_issues_count":4,"forks_count":2,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-22T06:34:50.086Z","etag":null,"topics":["alerting","golang","hacktoberfest","kubernetes","metrics","operatorkit","prometheus","prometheus-operator"],"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/giantswarm.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":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-16T09:57:47.000Z","updated_at":"2025-03-20T12:07:11.000Z","dependencies_parsed_at":"2023-09-27T16:05:44.445Z","dependency_job_id":"9fb87a37-1253-4954-b18f-b46a0f9490c1","html_url":"https://github.com/giantswarm/prometheus-meta-operator","commit_stats":{"total_commits":1050,"total_committers":49,"mean_commits":"21.428571428571427","dds":0.7257142857142858,"last_synced_commit":"09eb37b8a36c3f1024bb3b650420caf0e4871147"},"previous_names":[],"tags_count":267,"template":false,"template_full_name":"giantswarm/template-operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giantswarm%2Fprometheus-meta-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giantswarm%2Fprometheus-meta-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giantswarm%2Fprometheus-meta-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giantswarm%2Fprometheus-meta-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giantswarm","download_url":"https://codeload.github.com/giantswarm/prometheus-meta-operator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640463,"owners_count":20971557,"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":["alerting","golang","hacktoberfest","kubernetes","metrics","operatorkit","prometheus","prometheus-operator"],"created_at":"2024-10-22T14:08:21.128Z","updated_at":"2025-04-07T11:06:18.110Z","avatar_url":"https://github.com/giantswarm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/giantswarm/prometheus-meta-operator.svg?\u0026style=shield)](https://circleci.com/gh/giantswarm/prometheus-meta-operator) [![Docker Repository on Quay](https://quay.io/repository/giantswarm/prometheus-meta-operator/status \"Docker Repository on Quay\")](https://quay.io/repository/giantswarm/prometheus-meta-operator)\n\n## [DEPRECATED]: This repository is deprecated\n\nIt is largely replaced by [observability-operator](https://github.com/giantswarm/observability-operator/), more information at [observability/architecture](https://intranet.giantswarm.io/docs/observability/architecture/)\n\n# prometheus-meta-operator\n\nThe prometheus-meta-operator watches Cluster CRs and creates [prometheus-operator] CRs. It is implemented\nusing [operatorkit].\n\n## Getting Project\n\nClone the git repository: https://github.com/giantswarm/prometheus-meta-operator.git\n\n### How to build\n\nBuild it using the standard `go build` command.\n\n```\ngo build github.com/giantswarm/prometheus-meta-operator\n```\n\nYou may want to regenerate the unit test files with:\n```\ngo test -v ./... -update\n```\n\n### How to update upstream code\n\nWe store modified upstream code for our own usage.\n\n- pkg/alertmanager/config\n- pkg/prometheus/common/config\n\n#### Initial upstream setup\n\nAdd the upstream git repository:\n\n```\n$ git remote add alertmanager https://github.com/prometheus/alertmanager.git\n```\n\nOn first run commands are the same as for Upgrade except for `git subtree merge` which has to be replaced with:\n\n```\n$ git subtree add --squash -P pkg/alertmanager/config alertmanager-config\n```\n\n\n#### Upgrade\n\n```\n# add upstream tags\n$ git tag -d $(git tag -l)\n$ git fetch alertmanager\n\n$ git checkout v0.22.2\n$ git subtree split -P config/ -b alertmanager-config\n$ git checkout -b alertmanager-0.22.2 origin/master\n$ git subtree merge --message \"Upgrade alertmanager/config to v0.22.2\" --squash -P pkg/alertmanager/config alertmanager-config\n# fix conflicts (the usual way) if any\n\n# restore local tags\n$ git tag -d $(git tag -l)\n$ git fetch\n\n# push for review\n$ git push -u origin HEAD\n\n/!\\ Do not merge with squash, once approved merge to master manually.\n/!\\ We need to preserve commit history otherwise following git subtree commands won't work.\n$ git checkout master\n$ git merge --ff-only alertmanager-0.22.2\n$ git push\n```\n\n# remoteWrite CRs\n\nPrometheus-meta-operator also manages remoteWrite custom resources.\n\n\n## remoteWrite CRDs\n\nCode for remoteWrite CRDs is in the `api/v1alpha1/` directory.\n\nThe actual CRDs are in `config/crd/monitoring.giantswarm.io_remotewrites.yaml`\n\nTo generate the CRDs from code, just use `make generate`.\n\n## Deployment\n\nCRDs deployment is managed within the helm chart.\nThe remoteWrite CRD is located under the chart's templates directory as a symbolic link to the generated yaml file. \n\n[operatorkit]: https://github.com/giantswarm/operatorkit\n[prometheus-operator]: https://github.com/prometheus-operator/prometheus-operator\n\n# Custom Prometheus volume size\n\nPrometheus-meta-operator provides a way of setting custom Prometheus volume size.\n\nThe Prometheus volume size can be set on the cluster CR using the dedicated annotation `monitoring.giantswarm.io/prometheus-volume-size`\n\nThree values are possible:\n\n* `small` = 30 Gi\n* `medium` = 100 Gi\n* `large` = 200 Gi\n\nwhile `medium` is the default value.\n\n\nThe retention size of prometheis will be set according to the volume size: we apply a ratio of 90%:\n\n* `small` (30 Gi) =\u003e retentionSize = 27Gi\n* `medium` (100 Gi) =\u003e retentionSize = 90Gi\n* `large` (200 Gi) =\u003e retentionSize = 180Gi\n\nCheck [Prometheus Volume Sizing](https://docs.giantswarm.io/getting-started/observability/monitoring/prometheus/volume-size/) for more details.\n\n# Prometheus Agent Sharding\n\nPrometheus Meta Operator configures the Prometheus Agent instances running in workload clusters (pre-mimir setup cf. observability-operator).\n\nTo be able to ingest metrics without disrupting the workload running in the clusters, Prometheus Meta Operator can shard the number of running Prometheus Agents.\n\nThe default configuration is defined in PMO itself: PMO adds a new shard every 1M time series present in the WC prometheus running on the management cluster. To avoid scaling down too abruptly, we defined a scale down threshold of 20%.\n\nAs this default value was not enough to avoid workload disruptions, we added 2 ways to be able to override the scale up series count target and the scale down percentage.\n\n1. Those values can be configured at the installation level by overriding the following values:\n\n```yaml\nprometheusAgent:\n  shardScaleUpSeriesCount: 1000000\n  shardScaleDownPercentage: 0.20\n```\n\n2. Those values can also be set per cluster using the following cluster annotations:\n\n```yaml\nmonitoring.giantswarm.io/prometheus-agent-scale-up-series-count: 1000000\nmonitoring.giantswarm.io/prometheus-agent-scale-down-percentage: 0.20\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiantswarm%2Fprometheus-meta-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiantswarm%2Fprometheus-meta-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiantswarm%2Fprometheus-meta-operator/lists"}