{"id":22733912,"url":"https://github.com/permutive-engineering/prometheus4cats-contrib","last_synced_at":"2025-04-14T02:04:53.670Z","repository":{"id":63296892,"uuid":"563773081","full_name":"permutive-engineering/prometheus4cats-contrib","owner":"permutive-engineering","description":"Prometheus4Cats instumentation for thrid party libaries","archived":false,"fork":false,"pushed_at":"2024-12-01T05:03:52.000Z","size":196,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-12-01T06:22:15.497Z","etag":null,"topics":["bigtable","fs2-kafka","metrics","prometheus","prometheus-metrics","prometheus4cats","refreshable","scala","trace4cats"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/permutive-engineering.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2022-11-09T09:59:11.000Z","updated_at":"2024-08-30T11:44:00.000Z","dependencies_parsed_at":"2024-06-01T06:23:41.342Z","dependency_job_id":"503ae786-2846-408e-880c-08d848f6f81d","html_url":"https://github.com/permutive-engineering/prometheus4cats-contrib","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutive-engineering%2Fprometheus4cats-contrib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutive-engineering%2Fprometheus4cats-contrib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutive-engineering%2Fprometheus4cats-contrib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permutive-engineering%2Fprometheus4cats-contrib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/permutive-engineering","download_url":"https://codeload.github.com/permutive-engineering/prometheus4cats-contrib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229126184,"owners_count":18024022,"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":["bigtable","fs2-kafka","metrics","prometheus","prometheus-metrics","prometheus4cats","refreshable","scala","trace4cats"],"created_at":"2024-12-10T20:16:57.894Z","updated_at":"2024-12-10T20:16:58.384Z","avatar_url":"https://github.com/permutive-engineering.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometheus4Cats Contrib\n\nThis repository contains a series of integrations for [Prometheus4Cats] that instrument other libraries or metric\nsources. Each integration is documented below:\n\n## Bigtable\n\nGoogle Bigtable [Java client instrumentation](https://cloud.google.com/bigtable/docs/client-side-metrics).\nUses a [Prometheus4Cats] callback registry to inspect the client metrics registered with OpenCensus.\n\nUse the [`BigtableOpenCensusMetrics`](/modules/prometheus4cats-contrib-google-cloud-bigtable/src/main/scala/prometheus4cats/bigtable/BigtableOpenCensusMetrics.scala)\nsmart constructor to enable metric collection on the Java client and registering them with a\n[`MetricFactory.WithCallbacks`].\n\n```sbt\n\"com.permutive\" %% \"prometheus4cats-contrib-google-cloud-bigtable\" % \"3.0.0\"\n```\n\n## Cats-Effect\n\n[Cats-Effect] metrics taken from JMX MBeans. This includes a\n[CPU starvation](https://typelevel.org/cats-effect/docs/core/starvation-and-tuning) counter.\n\nUse the [`CatsEffectMBeans`](/modules/prometheus4cats-contrib-cats-effect/src/main/scala/prometheus4cats/catseffect/CatsEffectMBeans.scala)\nsmart constructor register callbacks for [Cats-Effect] MBeans with [`MetricFactory.WithCallbacks`].\n\n```sbt\n\"com.permutive\" %% \"prometheus4cats-contrib-cats-effect\" % \"3.0.0\"\n```\n\n## FS2-Kafka\n\n[FS2-Kafka] integration that instruments consumers and producers. Uses a [Prometheus4Cats] callback registry to inspect\nbuilt-in [Kafka client metrics](https://docs.confluent.io/platform/current/kafka/monitoring.html#).\n\nUse the smart constructors in [`KafkaMetrics`](/modules/prometheus4cats-contrib-fs2-kafka/src/main/scala/prometheus4cats/fs2kafka/KafkaMetrics.scala)\nto register callbacks for producers and consumers with a [`MetricFactory.WithCallbacks`].\n\n```sbt\n\"com.permutive\" %% \"prometheus4cats-contrib-fs2-kafka\" % \"3.0.0\"\n```\n\n## Refreshable\n\nInstrumented implementation of [Refreshable]. Provides the following metrics:\n\n| Metric Name                          | Labels                            | Metric Type | Description                                                                                                 |\n|--------------------------------------|-----------------------------------|-------------|-------------------------------------------------------------------------------------------------------------|\n| `refreshable_read_total`             | `refreshable_name`, `value_state` | Counter     | Number of times this Refreshable has been read, with a label denoting the state of the value                |\n| `refreshable_is_running`             | `refreshable_name`                | Gauge       | Whether this Refreshable is running - `1` if true, `0` if false                                             |\n| `refreshable_retries_exhausted`      | `refreshable_name`                | Gauge       | Whether retries have been exhausted for this Refreshable - `1` if true, `0` if false                        |\n| `refreshable_refresh_failing`        | `refreshable_name`                | Gauge       | Whether refresh is currently failing - `1` if true, `0` if false                                            |\n| `refreeshable_refresh_success_total` | `refreshable_name`                | Counter     | Number of times the refresh operation has succeeded                                                         |\n| `refreshable_refresh_failure_total`  | `refreshable_name`                | Counter     | Number of times refresh failed                                                                              |\n| `refreshable_status`                 | `refreshable_name`, `value_state` | Gauge       | The current status of this Refreshable - a value of `1` against the label value indicates the current state |\n\nUse the [`InstrumentedRefreshable`](/modules/prometheus4cats-contrib-refreshable/src/main/scala/prometheus4cats/refreshable/InstrumentedRefreshable.scala)\nsmart constructor to instrument a given `Refreshable` when used with an instance of [`MetricFactory.WithCallbacks`].\n\n```sbt\n\"com.permutive\" %% \"prometheus4cats-contrib-refreshable\" % \"3.0.0\"\n```\n\n## Trace4Cats\n\nInstrumented implementations of [Trace4Cats] interfaces. Provides the following metrics:\n\n| Interface       | Metric Name                          | Labels                                    | Metric Type | Description                                        |\n|-----------------|--------------------------------------|-------------------------------------------|-------------|----------------------------------------------------|\n| `EntryPoint`    | `trace4cats_entry_point_spans_total` | `span_kind`, `is_root`, `sample_decision` | Counter     | Total number of spans created                      |\n| `SpanCompleter` | `trace4cats_completer_spans_total`   | `completer_name`                          | Counter     | Total number of spans completed                    |\n| `SpanCompleter` | `trace4cats_completer_complete_time` | `completer_name`                          | Histogram   | Time it takes to complete a span in seconds        |\n| `SpanExporter`  | `trace4cats_exporter_batches_total`  | `exporter_name`                           | Counter     | Total number of batches sent via this exporter     |\n| `SpanExporter`  | `trace4cats_exporter_export_time`    | `exporter_name`                           | Histogram   | Time it takes to export a span batch in seconds    |\n| `SpanExporter`  | `trace4cats_exporter_batch_size`     | `exporter_name`                           | Histogram   | Size distribution of batches sent by this exporter |\n\nUse the [`InstrumentedEntrypoint`](/modules/prometheus4cats-contrib-trace4cats/src/main/scala/prometheus4cats/trace4cats/InstrumentedEntrypoint.scala),\n[`InstrumentedSpanCompleter`](/modules/prometheus4cats-contrib-trace4cats/src/main/scala/prometheus4cats/trace4cats/InstrumentedSpanCompleter.scala) and\n[`InstrumentedSpanExporter`](/modules/prometheus4cats-contrib-trace4cats/src/main/scala/prometheus4cats/trace4cats/InstrumentedSpanExporter.scala) with\na [`MetricFactory`] to return instrumented wrappers of the underlying implementations.\n\n```sbt\n\"com.permutive\" %% \"prometheus4cats-contrib-trace4cats\" % \"3.0.0\"\n```\n\n[Cats-Effect]: https://typelevel.org/cats-effect\n[FS2-Kafka]: https://fd4s.github.io/fs2-kafka/\n[Refreshable]: https://github.com/permutive-engineering/refreshable\n[Trace4Cats]: https://github.com/trace4cats/trace4cats\n[Prometheus4Cats]: https://github.com/permutive-engineering/prometheus4cats\n[`MetricFactory`]: https://permutive-engineering.github.io/prometheus4cats/docs/interface/metric-factory/\n[`MetricFactory.WithCallbacks`]: https://permutive-engineering.github.io/prometheus4cats/docs/interface/metric-factory/#metricfactory-or-metricfactorywithcallbacks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermutive-engineering%2Fprometheus4cats-contrib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermutive-engineering%2Fprometheus4cats-contrib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermutive-engineering%2Fprometheus4cats-contrib/lists"}