-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Fix: Use dashboard time range in prometheus variable editor #78950
Merged
Conversation
This file contains 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
itsmylife
added
type/bug
datasource/Prometheus
add to changelog
no-changelog
Skip including change in changelog/release notes
backport v10.2.x
labels
Dec 1, 2023
bohandley
approved these changes
Dec 1, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
3 tasks
grafana-delivery-bot bot
pushed a commit
that referenced
this pull request
Dec 1, 2023
Use dashboard time range in variable editor (cherry picked from commit 46044ef)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-78950-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 46044efdf8592f88e59a6cc277a98370a446e9b7 When the conflicts are resolved, stage and commit the changes:
If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-78950-to-v10.2.x
# Create the PR body template
PR_BODY=$(gh pr view 78950 --json body --template 'Backport 46044efdf8592f88e59a6cc277a98370a446e9b7 from #78950{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v10.2.x] Fix: Use dashboard time range in prometheus variable editor" --body-file - --label "type/bug" --label "datasource/Prometheus" --label "area/frontend" --label "add to changelog" --label "no-changelog" --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-78950-to-v10.2.x
# Create a pull request where the `base` branch is `v10.2.x` and the `compare`/`head` branch is `backport-78950-to-v10.2.x`.
# Remove the local backport branch
git switch main
git branch -D backport-78950-to-v10.2.x |
grafana-delivery-bot
bot
added
the
backport-failed
Failed to generate backport PR. Please resolve conflicts and create one manually.
label
Dec 21, 2023
gtk-grafana
pushed a commit
that referenced
this pull request
Dec 21, 2023
Use dashboard time range in variable editor (cherry picked from commit 46044ef)
3 tasks
79 tasks
bohandley
added a commit
that referenced
this pull request
Jan 30, 2024
This was referenced Jan 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
add to changelog
area/frontend
backport v10.2.x
backport-failed
Failed to generate backport PR. Please resolve conflicts and create one manually.
datasource/Prometheus
no-changelog
Skip including change in changelog/release notes
type/bug
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 is this feature?
While using a non-default time range on a Prometheus dashboard, variable editor queries always end up being queries with the default time range. This was happening because 'languageProvider
had never received the time range. This PR makes sure
languageProvider` receives the right time range always.Why do we need this feature?
A better variable support in Prometheus
Who is this feature for?
Prometheus users
Which issue(s) does this PR fix?:
Fixes #78947
Special notes for your reviewer:
How to test
last 2 days
end - start
is 6h which is the default time rangePlease check that: