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

docs(parsers): update readme for json_v2 parser #15840

Closed
wants to merge 6 commits into from

Conversation

mskonovalov
Copy link
Contributor

Summary

related to #15837

switching parser from "json" to "json_v2" is not equivalent.
Not sure if this is expected behavior or not.
In my config I have only

data_format = "json"

If I switch it to

data_format = "json_v2"

then Telegraf just stops working and not printing any output.
It is very confusing, even though it may be expected.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #

plugins/parsers/json_v2/README.md Outdated Show resolved Hide resolved
@Hipska
Copy link
Contributor

Hipska commented Sep 4, 2024

!retry-failed

@mskonovalov mskonovalov changed the title chore: update readme for json_v2 parser docs(parsers): update readme for json_v2 parser Sep 4, 2024
@telegraf-tiger telegraf-tiger bot added the docs Issues related to Telegraf documentation and configuration descriptions label Sep 4, 2024
@srebhan
Copy link
Member

srebhan commented Sep 4, 2024

@mskonovalov I'm not sure if we should put this note here... This general statement is true for any of the parsers as none of them has the same "semantics" compared to any other parser. So what should a user learn from this? To read and understand the documentation of the parser in charge?

If you do have some concrete hints for the user, e.g. "you need to explicitly define tags and fields" or similar, please feel free to add them but a "hey this is different than XYZ" won't help anyone IMO...

@srebhan srebhan self-assigned this Sep 4, 2024
@Hipska
Copy link
Contributor

Hipska commented Sep 4, 2024

What could be done instead is log a message on startup saying there is nothing configured for this parser. (or maybe even halt?)

@srebhan
Copy link
Member

srebhan commented Sep 4, 2024

@Hipska that would be even better I guess. Not sure how easy it is, json_v2 code is a mess.

@Hipska
Copy link
Contributor

Hipska commented Sep 4, 2024

@srebhan looks like it just needs some extra checks in func (p *Parser) Init() error

@mskonovalov
Copy link
Contributor Author

mskonovalov commented Sep 4, 2024

@srebhan yeah, I agree it is not ideal for sure.

I guess the assumption came from the fact that json and json_v2 do exactly the same. So "v2 is like better option of v1" :)
Naming is just a bit misleading in that sense.

But i aggree that it might be better to fail fast if there is no configuration for v2.

@mskonovalov
Copy link
Contributor Author

#15844

@srebhan
Copy link
Member

srebhan commented Sep 4, 2024

Let's continue with PR #15844 and close this one...

@srebhan srebhan closed this Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore docs Issues related to Telegraf documentation and configuration descriptions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants