Skip to content

Commit

Permalink
Export "Cluster Metadata" and other internal cluster_status module …
Browse files Browse the repository at this point in the history
…metrics (#99)

* Reworked the initialization of the `prometheus` module, so it procures the `cluster_id` by itself, instead of depending on the `cluster_status` module.
  * Why? Because we want the `prometheus` metrics `Register` ready BEFORE any of the other modules are launched, so each can add their own metrics.
* Passing in Prometheus Registry to the `cluster_status` module
* Exposing metrics for the `ClusterStatusEmitter`
  * `fetch_time`
  * `channel_capacity`
* Exposing metrics for `ClusterStatusRegister`
  * `brokers_total`
  * `topics_total`
  * `partitions_total`
  * `topic_partitions_total`
* Documenting all the new `cluster_status` metrics
* Deps upgrade
  * It includes a major update of `hyper` to `v1.0.1`
  • Loading branch information
detro authored Nov 19, 2023
1 parent 05df370 commit e5f6e9b
Show file tree
Hide file tree
Showing 13 changed files with 314 additions and 70 deletions.
121 changes: 82 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const_format = "0.2.32"
ctrlc = { version = "3.4.1", features = ["termination"] }
env_logger = "0.10.1"
exit-code = "1.0.0"
hyper = { version = "0.14.27", features = ["http1", "http2", "server", "runtime", "tcp"] }
hyper = { version = "1.0.1", features = ["http1", "http2", "server"] }
konsumer_offsets = { version = "0.3.0", default-features = false, features = ["ts_chrono"] }
log = "0.4.20"
prometheus = "0.13.3"
Expand Down
68 changes: 67 additions & 1 deletion METRICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ to produce the lag information for).
<dl>
<dt><code>kmtd_consumer_groups_total</code></dt>
<dd>
<b>Description:</b> <i>"Consumer groups currently in the cluster.</i><br/>
<b>Description:</b> <i>Consumer groups currently in the cluster.</i><br/>
<b>Labels:</b> <code>cluster_id</code><br/>
<b>Type:</b> <code>gauge</code><br/>
<b>Timestamped:</b> <code>false</code>
Expand All @@ -113,8 +113,72 @@ to produce the lag information for).
</dd>
</dl>

<dl>
<dt><code>kmtd_cluster_brokers_total</code></dt>
<dd>
<b>Description:</b> <i>Brokers currently in cluster.</i><br/>
<b>Labels:</b> <code>cluster_id</code><br/>
<b>Type:</b> <code>gauge</code><br/>
<b>Timestamped:</b> <code>false</code>
</dd>
</dl>

<dl>
<dt><code>kmtd_cluster_topics_total</code></dt>
<dd>
<b>Description:</b> <i>Topics currently in cluster.</i><br/>
<b>Labels:</b> <code>cluster_id</code><br/>
<b>Type:</b> <code>gauge</code><br/>
<b>Timestamped:</b> <code>false</code>
</dd>
</dl>

<dl>
<dt><code>kmtd_cluster_partitions_total</code></dt>
<dd>
<b>Description:</b> <i>Partitions currently in cluster.</i><br/>
<b>Labels:</b> <code>cluster_id</code><br/>
<b>Type:</b> <code>gauge</code><br/>
<b>Timestamped:</b> <code>false</code>
</dd>
</dl>

<dl>
<dt><code>kmtd_cluster_topic_partitions_total</code></dt>
<dd>
<b>Description:</b> <i>Topic's Partitions currently in cluster.</i><br/>
<b>Labels:</b> <code>cluster_id, topic</code><br/>
<b>Type:</b> <code>gauge</code><br/>
<b>Timestamped:</b> <code>false</code>
</dd>
</dl>

### Kommitted (internal) Metrics

#### `cluster_status` module

<dl>
<dt><code>kmtd_cluster_status_emitter_fetch_time_milliseconds</code></dt>
<dd>
<b>Description:</b> <i>Time (ms) taken to fetch cluster status metadata.</i><br/>
<b>Labels:</b> <code>cluster_id</code><br/>
<b>Type:</b> <code>histogram</code><br/>
<b>Timestamped:</b> <code>false</code>
</dd>
</dl>

<dl>
<dt><code>kmtd_cluster_status_emitter_channel_capacity</code></dt>
<dd>
<b>Description:</b> <i>Capacity of internal channel used to send cluster status metadata to rest of the service.</i><br/>
<b>Labels:</b> <code>cluster_id</code><br/>
<b>Type:</b> <code>gauge</code><br/>
<b>Timestamped:</b> <code>false</code>
</dd>
</dl>

#### `consumer_groups` module

<dl>
<dt><code>kmtd_consumer_groups_emitter_fetch_time_milliseconds</code></dt>
<dd>
Expand All @@ -135,6 +199,8 @@ to produce the lag information for).
</dd>
</dl>

#### `partition_offsets` module

<dl>
<dt><code>kmtd_partition_offsets_emitter_fetch_time_milliseconds</code></dt>
<dd>
Expand Down
Loading

0 comments on commit e5f6e9b

Please sign in to comment.