[Metricbeat] Add JetStream metricset to NATS module#43310
Merged
rdner merged 95 commits intoelastic:mainfrom May 6, 2025
Merged
[Metricbeat] Add JetStream metricset to NATS module#43310rdner merged 95 commits intoelastic:mainfrom
rdner merged 95 commits intoelastic:mainfrom
Conversation
Attempting to generate the moduleFields once and share them across multiple mb.Event instances results in a fatal error: concurrent map iteration and map write panic. Instead, generate a unique set of module fields for each metricset event.
Idea is to allow filtering on: - stream names - consumer names Could potentially add more filtering options later
Add demo yml config
Also remove CompressOK. It's always true in JetStream
It seems 'mage update' doesn't recognize this type
Use configuration options to specify which sub-category of metrics should be reported.
API does not seem to respond to it.
Update and commit anything documentation-related
Member
|
/test |
Contributor
Author
|
@rdner Are the test failures for libbeat related to this PR? I can't access the buildkite results (still getting a 404) and I don't have any test failures when running |
Member
For security reasons, the Buildkite pipelines are private. All the failures appear to be unrelated to the changes in this PR. I’ll retrigger the tests. |
Member
|
/test |
rdner
approved these changes
May 5, 2025
Contributor
Author
|
Thanks everyone! |
dliappis
added a commit
to dliappis/beats
that referenced
this pull request
May 6, 2025
This commit removes the nats Dockerfile from the bump-golang GH action, since after elastic#43310 it no longer references golang docker images.
dliappis
added a commit
that referenced
this pull request
May 7, 2025
This commit removes the nats Dockerfile from the bump-golang GH action, since after #43310 it no longer references golang docker images.
colleenmcginnis
pushed a commit
to colleenmcginnis/beats
that referenced
this pull request
Jul 30, 2025
colleenmcginnis
pushed a commit
to colleenmcginnis/beats
that referenced
this pull request
Aug 7, 2025
colleenmcginnis
pushed a commit
to colleenmcginnis/beats
that referenced
this pull request
Aug 7, 2025
6 tasks
colleenmcginnis
pushed a commit
to colleenmcginnis/beats
that referenced
this pull request
Aug 8, 2025
This was referenced Aug 18, 2025
colleenmcginnis
pushed a commit
that referenced
this pull request
Aug 18, 2025
* add versioning information to fields.yml files related to #43310 * run update * add tabs for example document in docs/reference/metricbeat/metricbeat-metricset-nats-connection.md * add tabs for example document in docs/reference/metricbeat/metricbeat-metricset-nats-stats.md * apply suggestions from code review
mergify bot
pushed a commit
that referenced
this pull request
Aug 18, 2025
* add versioning information to fields.yml files related to #43310 * run update * add tabs for example document in docs/reference/metricbeat/metricbeat-metricset-nats-connection.md * add tabs for example document in docs/reference/metricbeat/metricbeat-metricset-nats-stats.md * apply suggestions from code review (cherry picked from commit b814855)
6 tasks
rdner
pushed a commit
that referenced
this pull request
Aug 18, 2025
* add versioning information to fields.yml files related to #43310 * run update * add tabs for example document in docs/reference/metricbeat/metricbeat-metricset-nats-connection.md * add tabs for example document in docs/reference/metricbeat/metricbeat-metricset-nats-stats.md * apply suggestions from code review (cherry picked from commit b814855) Co-authored-by: Colleen McGinnis <colleen.mcginnis@elastic.co>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
feat(metricbeat): Add JetStream metricset to NATS module
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Disruptive User Impact
Those using older versions of NATS (<2.2.6) may find compatibility issues with the module. Support for v1 has been dropped.
Author's Checklist
jetstreammetricset.jetstreammetricset were addedconnectionmetricset no longer produces errors related to schema application when ran against newer versions of NATSjetstreammetricset (new) can be configured to collect metrics about JetStream stats, accounts, streams, and consumersjetstreammetricset supports filtering on account names, stream names, and consumer names. No filters configured report on everything. These filters can compound.jetstreammetricset are all documentedjetstreammetricset are ingested properly into Elasticsearch (confirmation of valid mappings)How to test this PR locally
cdintometricbeatmage updatemage buildcdintomodules/natsand rundocker compose up -dto deploy a NATS 2.11 clustermetricbeat.ymlconfig to enable all metricsets for thenatsmodule (see the reference module config). Configure thehostssetting to match the local NATS server running in Docker (rundocker psto obtain the mapped port). Configure the output to be the local Elasticsearch server running in Docker.natsmodule eventually appear in Discover. Check to make sure there are metrics for thejetstreammetricset.natsmodule ingested into ElasticsearchRelated issues
Use cases
Scenario: Upgrading to newer versions of NATS and/or Metricbeat
Given a system using Metricbeat's NATS module to monitor a NATS server or cluster
When either Metricbeat or NATS are upgraded
Then there should be no compatibility issues in the collection of NATS metrics
And relevant metrics should be reported
Scenario: Monitoring JetStream streams and consumers
Given a system using NATS JetStream
When deploying Metricbeat to monitor the NATS server
Then Metricbeat should report metrics about JetStream stats, accounts, streams, and consumers
Screenshots
Logs