Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nats Jetstream consumer #11046

Closed
b3rtram opened this issue Apr 28, 2022 · 5 comments · Fixed by #11373
Closed

Nats Jetstream consumer #11046

b3rtram opened this issue Apr 28, 2022 · 5 comments · Fixed by #11373
Labels
feature request Requests for new plugin and for new features to existing plugins help wanted Request for community participation, code, contribution

Comments

@b3rtram
Copy link
Contributor

b3rtram commented Apr 28, 2022

Feature Request

Nats.io Jetstream consumer

Proposal:

The Nats server has a new streaming technology called jetstream. I work with nats using jetstream and it would be very helpful when Telegraf could consume messages from that technology https://docs.nats.io/nats-concepts/jetstream

Current behavior:

Nats consumer plugin consumes data but not from a jetstream consumer

Desired behavior:

Telegraf can be used to consume data from a nats jetstream consumer

Use case:

Nats jetstream persists the messages to file. It makes our system more resilient and easier to design when our services could restart without losing data

@b3rtram b3rtram added the feature request Requests for new plugin and for new features to existing plugins label Apr 28, 2022
@reimda
Copy link
Contributor

reimda commented May 17, 2022

Hi @b3rtram, thanks for the feature request. It looks like jetstream support could be a good telegraf feature. Are you able to put together a PR to add support to the nats_consumer input?

@reimda reimda added the help wanted Request for community participation, code, contribution label May 17, 2022
@b3rtram
Copy link
Contributor Author

b3rtram commented May 18, 2022

Hi I am a developer and could try it, but I don't have so much experience in open source contribution.

@b3rtram
Copy link
Contributor Author

b3rtram commented Jun 20, 2022

Hi, i tried at weekend to implement this feature. My first approach of configuration is to add a new array for Jetstream Subjects.

JsSubjects []string toml:"js_subjects"

So a user could add normal subjects as usual and if needed js_subjects.
What do you think?

@reimda
Copy link
Contributor

reimda commented Jun 24, 2022

I think you're on the right track with "js_subjects". I'm not a nats/jetsream expert but from a quick read through the jetstream docs, it sounds like jetstream consumers subscribe by subject name.

Telegraf's kafka consumer input plugin does something similar. It has a setting "topics" which lets you choose which to subscribe to. Topics and jetstream subjects seem roughly analogous.

@b3rtram
Copy link
Contributor Author

b3rtram commented Jun 27, 2022

Ok thank you, have added a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins help wanted Request for community participation, code, contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants