Parse JSON String arrays properly so string elements can be retrieved#11921
Merged
Parse JSON String arrays properly so string elements can be retrieved#11921
Conversation
Contributor
MichelHollands
left a comment
There was a problem hiding this comment.
Looking good. Can you add the unit tests from https://github.com/grafana/loki/pull/10690/files?
| module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files. No newline at end of file | ||
| module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files. | ||
|
|
||
| go 1.21 |
Contributor
There was a problem hiding this comment.
(nit) Perhaps we shouldn't change operator files.
Collaborator
Author
There was a problem hiding this comment.
I can revert, this was picked up through one of the build commands
MichelHollands
approved these changes
Feb 13, 2024
Contributor
MichelHollands
left a comment
There was a problem hiding this comment.
LGTM. We'll need a CHANGELOG entry though as this is user visible.
grafanabot
added a commit
that referenced
this pull request
Feb 13, 2024
rhnasc
pushed a commit
to inloco/loki
that referenced
this pull request
Apr 12, 2024
…grafana#11921) **What this PR does / why we need it**: This PR imports the newly forked grafana/jsonparser over the buger/jsonparser module. The latter has seemingly been abandoned. PR 10690 introduces a fix to the jsonparser module, which has been incorporated into the grafana fork of the module. The PR is designed to fix accessing string array elements from within a JSON structure. For example, with the following JSON: `{"log":{"message":{"content":{"misses":["a","b","c","d"]}}}}` The Loki code, before this PR, when searching for `json misses = "log.message.content.misses[0]" ` will result in an "Unknown value type error". After this PR is merged, the result will assign `a` to the `misses` variable. **Which issue(s) this PR fixes**: Fixes #[9179](grafana#9179) grafana#10690 **Special notes for your reviewer**: **Checklist** - [x] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [ ] Documentation added - [x] Tests updated - [x] `CHANGELOG.md` updated - [x] If the change is worth mentioning in the release notes, add `add-to-release-notes` label - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/setup/upgrade/_index.md` - [ ] For Helm chart changes bump the Helm chart version in `production/helm/loki/Chart.yaml` and update `production/helm/loki/CHANGELOG.md` and `production/helm/loki/README.md`. [Example PR](grafana@d10549e) - [ ] If the change is deprecating or removing a configuration option, update the `deprecated-config.yaml` and `deleted-config.yaml` files respectively in the `tools/deprecated-config-checker` directory. [Example PR](grafana@0d4416a)
rhnasc
pushed a commit
to inloco/loki
that referenced
this pull request
Apr 12, 2024
…ys properly so string elements can be retrieved (grafana#11931) Add PR grafana#11921 to release notes for next release --------- Co-authored-by: Paul Rogers <paul.rogers@grafana.com>
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.
What this PR does / why we need it:
This PR imports the newly forked grafana/jsonparser over the buger/jsonparser module. The latter has seemingly been abandoned. PR 10690 introduces a fix to the jsonparser module, which has been incorporated into the grafana fork of the module.
The PR is designed to fix accessing string array elements from within a JSON structure. For example, with the following JSON:
{"log":{"message":{"content":{"misses":["a","b","c","d"]}}}}The Loki code, before this PR, when searching for
json misses = "log.message.content.misses[0]"will result in an "Unknown value type error". After this PR is merged, the result will assignato themissesvariable.Which issue(s) this PR fixes:
Fixes #9179
#10690
Special notes for your reviewer:
Checklist
CONTRIBUTING.mdguide (required)CHANGELOG.mdupdatedadd-to-release-noteslabeldocs/sources/setup/upgrade/_index.mdproduction/helm/loki/Chart.yamland updateproduction/helm/loki/CHANGELOG.mdandproduction/helm/loki/README.md. Example PRdeprecated-config.yamlanddeleted-config.yamlfiles respectively in thetools/deprecated-config-checkerdirectory. Example PR