{"id":18640519,"url":"https://github.com/rexagod/crdmetrics","last_synced_at":"2025-04-11T10:33:09.951Z","repository":{"id":252702096,"uuid":"841175105","full_name":"rexagod/crdmetrics","owner":"rexagod","description":"⎈ CRDMetrics controller's source.","archived":false,"fork":false,"pushed_at":"2024-09-12T17:35:24.000Z","size":17308,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-13T06:50:06.191Z","etag":null,"topics":["sig-instrumentation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"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/rexagod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","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":"2024-08-11T21:24:29.000Z","updated_at":"2024-09-12T17:35:29.000Z","dependencies_parsed_at":"2024-08-29T17:20:36.204Z","dependency_job_id":null,"html_url":"https://github.com/rexagod/crdmetrics","commit_stats":null,"previous_names":["rexagod/crsm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexagod%2Fcrdmetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexagod%2Fcrdmetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexagod%2Fcrdmetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rexagod%2Fcrdmetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rexagod","download_url":"https://codeload.github.com/rexagod/crdmetrics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223466443,"owners_count":17149770,"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":["sig-instrumentation"],"created_at":"2024-11-07T05:54:48.842Z","updated_at":"2024-11-07T05:54:49.387Z","avatar_url":"https://github.com/rexagod.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `crdmetrics`: Custom Resource Definition Metrics\n\n[![CI](https://github.com/rexagod/crdmetrics/actions/workflows/continuous-integration.yaml/badge.svg)](https://github.com/rexagod/crdmetrics/actions/workflows/continuous-integration.yaml) [![Go Report Card](https://goreportcard.com/badge/github.com/rexagod/crdmetrics)](https://goreportcard.com/report/github.com/rexagod/crdmetrics) [![Go Reference](https://pkg.go.dev/badge/github.com/rexagod/crdmetrics.svg)](https://pkg.go.dev/github.com/rexagod/crdmetrics)\n\n## Summary\n\nCustom Resource Definition Metrics (`crdmetrics`) is a Kubernetes controller that builds on Kube-State-Metrics' Custom Resource State's ideology and generates metrics for custom resources based on the configuration specified in its managed resource, `CRDMetricsResource`.\n\nThe project's [conformance benchmarking](./tests/bench/bench.sh) shows 3x faster RTT for `crdmetrics` as compared to Kube-State-Metrics' Custom Resource Definition Metrics ([f8aa7d9b](https://github.com/kubernetes/kube-state-metrics/commit/f8aa7d9bb9d8e29876e19f4859391a54a7e61d63)) feature-set:\n\n```\nTue Aug 20 21:18:58 IST 2024\n[CRDMETRICS]\nBUILD:  1021ms\nRTT:    1044ms\n[KUBESTATEMETRICS]\nBUILD:  1042ms\nRTT:    3122ms\n```\n\n## Development\n\nStart developing by following these steps:\n\n- Set up dependencies with `make setup`.\n- Test out your changes with `make apply apply-testdata local`.\n  - Telemetry metrics, by default, are exposed on `:9998/metrics`.\n  - Resource metrics, by default, are exposed on `:9999/metrics`.\n- Start a `pprof` interactive session with `make pprof`.\n\nFor more details, take a look at the [Makefile](Makefile) targets.\n\n## Notes\n\n- Garbage in, garbage out: Invalid configurations will generate invalid metrics. The exception to this being that certain checks that ensure metric structure are still present (for e.g., `value` should be a `float64`).\n- Library support: The module is **never** intended to be used as a library, and as such, does not export any functions or types, with `pkg/` being an exception (for managed types and such).\n- Metrics stability: There are no metrics [stability](https://kubernetes.io/blog/2021/04/23/kubernetes-release-1.21-metrics-stability-ga/) guarantees, as the metrics are user-generated.\n- No middle-ware: The configuration is `unmarshal`led into a set of stores that the codebase directly operates on. There is no middle-ware that processes the configuration before it is used, in order to avoid unnecessary complexity. However, the expression(s) within the `value` and `labelValues` may need to be evaluated before being used, and as such, are exceptions.\n\n## TODO\n\nIn the order of priority:\n\n- [X] CEL expressions for metric generation (or [*unstructured.Unstructured](https://github.com/kubernetes/apimachinery/issues/181), if that suffices).\n- [X] Conformance test(s) for Kube-State-Metrics' [Custom Resource State API](https://github.com/kubernetes/kube-state-metrics/blob/main/docs/metrics/extend/customresourcestate-metrics.md#multiple-metricskitchen-sink).\n- [X] Benchmark(s) for Kube-State-Metrics' [Custom Resource State API](https://github.com/kubernetes/kube-state-metrics/blob/main/docs/metrics/extend/customresourcestate-metrics.md#multiple-metricskitchen-sink).\n- [X] E2E tests covering the controller's basic functionality.\n- [X] `s/CRSM/CRDMetrics`.\n- [X] [Graduate to ALPHA](https://github.com/kubernetes/enhancements/issues/4785), i.e., draft out a KEP.\n- [ ] Make `CRDMetricsResource` namespaced-scope. This allows for:\n  - per-namespace configuration (separate configurations between teams), and,\n  - garbage collection, since currently the namespace-scoped deployment manages its cluster-scoped resources, which are not garbage collect-able in Kubernetes by design.\n- [ ] Meta-metrics for metric generation failures.\n\n###### [License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frexagod%2Fcrdmetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frexagod%2Fcrdmetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frexagod%2Fcrdmetrics/lists"}