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

Logs: Update logic to process logs dataPlane frame with labels field #77708

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

ivanahuckova
Copy link
Member

@ivanahuckova ivanahuckova commented Nov 6, 2023

Building upon the discussion from grafana/dataplane#37, where there have been updates to the logs dataPlane format (still in its proposal/early stage, subject to further changes) - specifically the renaming of attributes to labels. This PR focuses on updating the logic in Grafana. This update ensures that Grafana can correctly read data frames from the logs data plane, now including the labels field.

This change was implemented both in Grafana and Loki to facilitate testing of the updated logic (it's important to note that this feature in Loki is currently behind a toggle switch)

To test this logic, please follow these steps:

  1. Enable the feature toggle lokiLogsDataplane in your custom.ini configuration file, setting it to true.
  2. Confirm that log details, permalink, and table visualization are functioning as expected with the feature enabled.
  3. Likewise, test the behavior with lokiLogsDataplane set to false.

This testing will help ensure that the new logic and dataPlane format changes work as intended and do not disrupt the existing functionality.

When this is merged, I'll reach out to release team and product to agree on if this can be backported to both 10.1 and 10.2

Copy link
Contributor

Hello @ivanahuckova!
Backport pull requests need to be either:

  • Pull requests which address bugs,
  • Urgent fixes which need product approval, in order to get merged,
  • Docs changes.

Please, if the current pull request addresses a bug fix, label it with the type/bug label.
If it already has the product approval, please add the product-approved label. For docs changes, please add the type/docs label.
If the pull request modifies CI behaviour, please add the type/ci label.
If none of the above applies, please consider removing the backport label and target the next major/minor release.
Thanks!

Copy link
Contributor

Hello @ivanahuckova!
Backport pull requests need to be either:

  • Pull requests which address bugs,
  • Urgent fixes which need product approval, in order to get merged,
  • Docs changes.

Please, if the current pull request addresses a bug fix, label it with the type/bug label.
If it already has the product approval, please add the product-approved label. For docs changes, please add the type/docs label.
If the pull request modifies CI behaviour, please add the type/ci label.
If none of the above applies, please consider removing the backport label and target the next major/minor release.
Thanks!

@gabor
Copy link
Contributor

gabor commented Nov 6, 2023

nice work 👍 . i did not run it, but the changes look good.

Copy link
Contributor

@svennergr svennergr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Tested functionality and everything seems to work properly!


// the attributes-access is a little awkward, but it's necessary
// because there are multiple,very different dataframe-represenations.
// because there are multiple,very different dataFrame-representations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏


// the attributes-access is a little awkward, but it's necessary
// because there are multiple,very different dataframe-represenations.
// because there are multiple,very different dataFrame-representations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// because there are multiple,very different dataFrame-representations.
// because there are multiple, very different dataFrame representations.

@ivanahuckova ivanahuckova merged commit d4a257b into main Nov 7, 2023
29 checks passed
@ivanahuckova ivanahuckova deleted the ivana/logs-dataframe-attributes-to-labels branch November 7, 2023 09:53
Copy link
Contributor

The backport to v10.1.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-77708-to-v10.1.x origin/v10.1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x d4a257bc8ed5e4a55100a47ac7f1a079aa9375d6

When the conflicts are resolved, stage and commit the changes:

git add . && git cherry-pick --continue

If you have the GitHub CLI installed:

# Push the branch to GitHub:
git push --set-upstream origin backport-77708-to-v10.1.x
# Create the PR body template
PR_BODY=$(gh pr view 77708 --json body --template 'Backport d4a257bc8ed5e4a55100a47ac7f1a079aa9375d6 from #77708{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v10.1.x] Logs: Update logic to process logs dataPlane frame with labels field" --body-file - --label "area/backend" --label "area/explore" --label "area/frontend" --label "datasource/Loki" --label "add to changelog" --label "missing-labels" --label "backport" --base v10.1.x --milestone 10.1.x --web

Or, if you don't have the GitHub CLI installed (we recommend you install it!):

# Push the branch to GitHub:
git push --set-upstream origin backport-77708-to-v10.1.x

# Create a pull request where the `base` branch is `v10.1.x` and the `compare`/`head` branch is `backport-77708-to-v10.1.x`.

# Remove the local backport branch
git switch main
git branch -D backport-77708-to-v10.1.x

@grafana-delivery-bot grafana-delivery-bot bot added the backport-failed Failed to generate backport PR. Please resolve conflicts and create one manually. label Nov 7, 2023
Copy link
Contributor

The backport to v10.2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-77708-to-v10.2.x origin/v10.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x d4a257bc8ed5e4a55100a47ac7f1a079aa9375d6

When the conflicts are resolved, stage and commit the changes:

git add . && git cherry-pick --continue

If you have the GitHub CLI installed:

# Push the branch to GitHub:
git push --set-upstream origin backport-77708-to-v10.2.x
# Create the PR body template
PR_BODY=$(gh pr view 77708 --json body --template 'Backport d4a257bc8ed5e4a55100a47ac7f1a079aa9375d6 from #77708{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v10.2.x] Logs: Update logic to process logs dataPlane frame with labels field" --body-file - --label "area/backend" --label "area/explore" --label "area/frontend" --label "datasource/Loki" --label "add to changelog" --label "missing-labels" --label "backport" --base v10.2.x --milestone 10.2.x --web

Or, if you don't have the GitHub CLI installed (we recommend you install it!):

# Push the branch to GitHub:
git push --set-upstream origin backport-77708-to-v10.2.x

# Create a pull request where the `base` branch is `v10.2.x` and the `compare`/`head` branch is `backport-77708-to-v10.2.x`.

# Remove the local backport branch
git switch main
git branch -D backport-77708-to-v10.2.x

ivanahuckova added a commit that referenced this pull request Nov 7, 2023
…77708)

* Logs: Update dataplane logic to use labels instead of attributes

* Update Loki logs data plane data frame according to specs

* Remove only in test

(cherry picked from commit d4a257b)
ivanahuckova added a commit that referenced this pull request Nov 8, 2023
…els field (#77801)

Logs: Update logic to process logs dataPlane frame with labels field (#77708)

* Logs: Update dataplane logic to use labels instead of attributes

* Update Loki logs data plane data frame according to specs

* Remove only in test

(cherry picked from commit d4a257b)
@aangelisc aangelisc modified the milestones: 10.3.x, 10.2.3 Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants