{"id":23782460,"url":"https://github.com/rtib/cql-metrics-collector","last_synced_at":"2026-05-18T02:35:29.011Z","repository":{"id":270161337,"uuid":"793568179","full_name":"rtib/cql-metrics-collector","owner":"rtib","description":"Metrics collector for Apache Cassandra","archived":false,"fork":false,"pushed_at":"2025-04-28T12:59:25.000Z","size":221,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-30T20:37:39.095Z","etag":null,"topics":["cassandra","cassandra-database","metrics"],"latest_commit_sha":null,"homepage":"https://rtib.github.io/cql-metrics-collector/","language":"Java","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/rtib.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-29T13:17:39.000Z","updated_at":"2025-04-28T12:59:29.000Z","dependencies_parsed_at":"2025-01-21T23:22:38.935Z","dependency_job_id":"b44040ad-c7d7-479a-a7d9-c3f354e38357","html_url":"https://github.com/rtib/cql-metrics-collector","commit_stats":null,"previous_names":["rtib/cql-metrics-collector"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/rtib/cql-metrics-collector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtib%2Fcql-metrics-collector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtib%2Fcql-metrics-collector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtib%2Fcql-metrics-collector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtib%2Fcql-metrics-collector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtib","download_url":"https://codeload.github.com/rtib/cql-metrics-collector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtib%2Fcql-metrics-collector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33162677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cassandra","cassandra-database","metrics"],"created_at":"2025-01-01T12:15:06.002Z","updated_at":"2026-05-18T02:35:28.995Z","avatar_url":"https://github.com/rtib.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cql-metrics-collector\n\n## Abstract\n\nThis project is meant as a PoC implementing a Prometheus metrics exporter for\nApache Cassandra. Since Cassandra started exposing metrics via virtual tables\navailable via CQL, a Prometheus exporter leveraging that seemed reasonable. \nImplemented as a sidecar service, cql-metrics-exporter is connecting an Apache\nCassandra node via localhost, queries its metrics via regular CQL and exports\nthem in Prometheus' text format on http://localhost:9500/metrics endpoint.\n\n## Installation\n\nUnback any of the bundles or install the Debian package provided in the release.\n\nWhen installing the Debian package, a system user for the service will also be created and a SystemD service unit is installed, allowing to launch and control the application instance.\n\n## Configuration\n\nThe project used [Typesafe config](https://lightbend.github.io/config/) for configuration. The main configuration file is placed at [/etc/application.conf](conf/application.conf) containing commented basic configuration.\n\nIf the Cassandra node is requiring user authentication, a tool user might be created in Cassandra. When using Cassandra `PasswordAuthenticator` and `CassandraAuthorizer`, follow the example below to set up a tool user\"\n\n```cql\ncassandra@cqlsh\u003e CREATE ROLE monitor WITH PASSWORD = 'secret' AND LOGIN = true AND SUPERUSER = false;\ncassandra@cqlsh\u003e GRANT SELECT PERMISSION ON KEYSPACE system_virtual_schema TO monitor;\ncassandra@cqlsh\u003e GRANT SELECT PERMISSION ON KEYSPACE system_views TO monitor;\n```\n\nThen follow the example in [/etc/application.conf](conf/application.conf) to set up the application authentication:\n\n```\ndatastax-java-driver.advanced.auth-provider {\n  class = PlainTextAuthProvider\n  username = monitor\n  password = secret\n}\n```\n\nFor more detailed configuration parameters refer to [reference.conf](src/main/resources/reference.conf).\n\n## Usage\n\nThe service may be started within an unprivileged user context with\n`bin/cql-metrics-collector`.\n\nOr on Debian deployments just start the `cql-metrics-collector.service` unit with systemctl.\n\nMetrics can be collected from HTTP `/metrics` endpoint available by default on port 9500.\n\n## Dashboards\n\nMetrics collected by a TSDB, e.g. [VictoriaMetrics](https://docs.victoriametrics.com/) can be visualized with e.g. [Grafana](https://grafana.com/oss/grafana/). While you are free to create metrics based visualizations, a few pre-defined dashboards are available in the [dashboards](dashboards) folder. These are part of the release, packaged in `dashboards.tar.gz` and can be imported to any Grafana instance.\n\n## Metrics labels\n\nAll exported metrics get a few labels. These sets of labels are merged from\na common set of label and a set of individual lables.\n\nThe common set of labels contains:\n\n* `cluster` - cluster name as configured for Cassandra\n* `dc` - datacenter of the current node as repoterd by Cassandra's snitch\n* `rack` - rack of the current node as reported by Cassandra's snitch\n* `node` - resolved host name, IP address and port the Cassandra node is listening\n\n## Supported metrics\n\nCurrently, only a few metrics are supported. The following virtual tables are\naccessed and exported as listed:\n\n* `disk_usage`, `max_partition_size`, `max_sstable_size`\n  * `cassandra_\u003cbasename\u003e` (gauge) - labeled with `keyspace` and `table`\n* `thread_pools`\n  * `cassandra_thread_pools` (gauge) - labeled with `name` of the threadpool and `metric` referring to one of active_tasks, active_tasks_limit, blocked_tasks, blocked_tasks_all_time or pending_tasks\n  * `cassandra_completed_tasks_counter` - labeled with `name` as above and `metric` completed_tasks\n* `caches`\n  * `cassandra_system_caches` (gauge) - labeled with `name` of the system cache and `metric` referring to one of capacity_bytes, hit_ratio, recent_hit_rate_per_second, recent_request_rate_per_second or size_bytes\n  * `cassandra_system_cache_counter` -  labeled with `name` as above and `metric` referring to one of entry_count, hit_count or request_count\n* `coordinator_read_latency`, `coordinator_scan_latency`, `coordinator_write_latency`, `local_read_latency`, `local_scan_latency`, `local_write_latency`\n  * all above latency metrics tables are exoprted using four metric names:\n    * `cassandra_\u003cbasename\u003e_count` - exporting the count field of the base table\n    * `cassandra_\u003cbasename\u003e_max` - exporting the max latency in milliseconds\n    * `cassandra_\u003cbasename\u003e_buckets` - exporting p50th and p99th buckets in milliseconds\n    * `cassandra_\u003cbasename\u003e_rate` - exporting the request rate per seconds\n  * all metrics are labeled with `keyspace` and `table` referring to the subject of the metrics\n  * the buckets are additionally labeled with `quantile`\n* `rows_per_read`, `tombstones_per_read`\n  * `cassandra_\u003cbasename\u003e` - labeled with `keyspace`, `table` and `metric` referring to one of max, p50th and p99th\n  * `cassandra_\u003cbasename\u003e_count` - labeled with `keyspace`, `table` and `metric` referring to reads\n* `batch_metrics`\n  * `cassandra_batch_metrics` - labeled with `statement` and `metric=\"max\"`\n  * `cassandra_batch_metrics_summary` - labeled with `statement` and `quantile`\n* `cql_metrics`\n  * `cassandra_cql_metrics` - labeled with `metric` for the actual metric name\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtib%2Fcql-metrics-collector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtib%2Fcql-metrics-collector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtib%2Fcql-metrics-collector/lists"}