Skip to content

Commit

Permalink
Fixed stream message rate on jetstream dashboards
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
  • Loading branch information
piotrpio committed Jan 26, 2024
1 parent 861732f commit 84dde2a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions collector/jsz.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func newJszCollector(system, endpoint string, servers []*CollectedServer) promet
serverLabels,
nil,
),
// jetstream_stream_total_messages
// jetstream_server_total_streams
streams: prometheus.NewDesc(
prometheus.BuildFQName(system, "server", "total_streams"),
"Total number of streams in JetStream",
Expand Down Expand Up @@ -147,14 +147,14 @@ func newJszCollector(system, endpoint string, servers []*CollectedServer) promet
streamLabels,
nil,
),
// jetstream_stream_state_first_seq
// jetstream_stream_first_seq
streamFirstSeq: prometheus.NewDesc(
prometheus.BuildFQName(system, "stream", "first_seq"),
"First sequence from a stream",
streamLabels,
nil,
),
// jetstream_stream_state_last_seq
// jetstream_stream_last_seq
streamLastSeq: prometheus.NewDesc(
prometheus.BuildFQName(system, "stream", "last_seq"),
"Last sequence from a stream",
Expand Down
2 changes: 1 addition & 1 deletion walkthrough/grafana-jetstream-dash-helm.json
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@
"pluginVersion": "8.3.4",
"targets": [
{
"expr": "sum(rate(nats_stream_total_messages{server_id=~\"$server\",stream_name=~\"$stream\"}[$__rate_interval])) by (stream_name)",
"expr": "sum(rate(nats_stream_last_seq{server_id=~\"$server\",stream_name=~\"$stream\"}[$__rate_interval])) by (stream_name)",
"hide": false,
"interval": "",
"legendFormat": "{{stream_name}}",
Expand Down
2 changes: 1 addition & 1 deletion walkthrough/grafana-jetstream-dash.json
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@
"pluginVersion": "8.3.4",
"targets": [
{
"expr": "sum(rate(jetstream_stream_total_messages{server_id=~\"$server\",stream_name=~\"$stream\"}[$__rate_interval])) by (stream_name)",
"expr": "sum(rate(jetstream_stream_last_seq{server_id=~\"$server\",stream_name=~\"$stream\"}[$__rate_interval])) by (stream_name)",
"hide": false,
"interval": "",
"legendFormat": "{{stream_name}}",
Expand Down

0 comments on commit 84dde2a

Please sign in to comment.