This commit adds a new 'keep_firing_for' field to Prometheus alerting
rules. The 'resolve_delay' field specifies the minimum amount of time
that an alert should remain firing, even if the expression does not
return any results.
This feature was discussed at a previous dev summit, and it was
determined that a feature like this would be useful in order to allow
the expression time to stabilize and prevent confusing resolved messages
from being propagated through Alertmanager.
This approach is simpler than having two PromQL queries, as was
sometimes discussed, and it should be easy to implement.
This commit does not include tests for the 'resolve_delay' field. This
is intentional, as the purpose of this commit is to gather comments on
the proposed design of the 'resolve_delay' field before implementing
tests. Once the design of the 'resolve_delay' field has been finalized,
a follow-up commit will be submitted with tests."
See https://github.com/prometheus/prometheus/issues/11570
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
* Add API endpoints for getting scrape pool names
This adds api/v1/scrape_pools endpoint that returns the list of *names* of all the scrape pools configured.
Having it allows to find out what scrape pools are defined without having to list and parse all targets.
The second change is adding scrapePool query parameter support in api/v1/targets endpoint, that allows to
filter returned targets by only finding ones for passed scrape pool name.
Both changes allow to query for a specific scrape pool data, rather than getting all the targets for all possible scrape pools.
The problem with api/v1/targets endpoint is that it returns huge amount of data if you configure a lot of scrape pools.
Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
* Add a scrape pool selector on /targets page
Current targets page lists all possible targets. This works great if you only have a few scrape pools configured,
but for systems with a lot of scrape pools and targets this slow things down a lot.
Not only does the /targets page load very slowly in such case (waiting for huge API response) but it also take
a long time to render, due to huge number of elements.
This change adds a dropdown selector so it's possible to select only intersting scrape pool to view.
There's also scrapePool query param that will open selected pool automatically.
Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
We have 2 bugfixes, one which is important for Windows users and
another one on native histograms. I think it is worth cutting another
bugfix release before 2.41 comes out.
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
* Switch from 'sanity' to more inclusive lanuage
"Removing ableist language in code is important; it helps to create and
maintain an environment that welcomes all developers of all backgrounds,
while emphasizing that we as developers select the most articulate,
precise, descriptive language we can rather than relying on metaphors.
The phrase sanity check is ableist, and unnecessarily references mental
health in our code bases. It denotes that people with mental illnesses
are inferior, wrong, or incorrect, and the phrase sanity continues to be
used by employers and other individuals to discriminate against these
people."
From https://gist.github.com/seanmhanson/fe370c2d8bd2b3228680e38899baf5cc
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
* fix the way to get the list of workspaces
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* update UI dependencies
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* Allow copying label-value pair to buffer on click
Kept similar DOM structure to keep test compatibility.
Using `navigator.clipboard` API since it is used by the current standard browsers.
React hot toast is used to notify that the text was successfully copied into clipboard.
Signed-off-by: lpessoa <luisalmeida@yape.com.pe>
* Using reactstrap for toast notification
Using the bootstrap toast notification provided by reactstrap.
Clipboard handling is managed using React.Context via a shared callback.
Updated css according to CR suggestions.
Signed-off-by: lpessoa <luisalmeida@yape.com.pe>
* Changes from CR comments
Cleaning up renderFormatted method.
Renamed Clipboard to ToastContext.
Updated tests.
Signed-off-by: Luis Pessoa <luisalmeida@yape.com.pe>
Signed-off-by: lpessoa <luisalmeida@yape.com.pe>
Signed-off-by: Luis Pessoa <luisalmeida@yape.com.pe>
* Tweak colors in the dark theme to improve contrast
Some colors from the dark theme used in the query editor have a very low
contrast ratio with the background.
Signed-off-by: Jorge Luis Betancourt Gonzalez <jorge-luis.betancourt@trivago.com>
* Avoid duplicated function call when in dark mode
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: Jorge Luis Betancourt Gonzalez <jorge-luis.betancourt@trivago.com>
* Apply styles for the matching bracket when focused in dark mode
Signed-off-by: Jorge Luis Betancourt Gonzalez <jorge-luis.betancourt@trivago.com>
* Improve style of the matching brackets when focused
Signed-off-by: Jorge Luis Betancourt Gonzalez <jorge-luis.betancourt@trivago.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
* Allow formatting PromQL expressions in the UI
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Improve error handling, also catch HTTP errors
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove now-unneeded async property
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Disable format button when already formatted
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Disable format button when there are linter errors
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove disabling of format button again for linter errors
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* bump codemirror to v0.20.x and lezer to v.0.16.x
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* bump codemirror to v6 and lezer to v1
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* stop treating warning as error for UI
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* create lezer-promql module + move codemirror to a pure esm module + unified dependencies
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* ignore test utils file and remove the type "module" in package.json
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* use jest to run the lezer-promql test
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* give an automatic way to update the ui dependencies
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* update all dependencies using make update-npm-deps
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix react-app test
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* remove generated file
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* remove unnecessary backslash in script
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix reviews
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* rewording
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* use npx to run lezer-generator
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* Fix DataTable tests and missing value key warning
Fixes issues introduced in https://github.com/prometheus/prometheus/pull/10376
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Fix more DataTable brokenness
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Add a tooltip for unix times (ISO strings)
Signed-off-by: Ondrej Kokes <ondrej.kokes@gmail.com>
* Leverage useLocalTime to adjust ISO string tooltips
Signed-off-by: Ondrej Kokes <ondrej.kokes@gmail.com>
* revert pre styling removal
Signed-off-by: Ondrej Kokes <ondrej.kokes@gmail.com>
* Upgrade create-react-app to v5
Some other dependencies needs to be upgraded as well, plus some typescript errors fixed.
Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
* Use ESM imports for codemirror-promql
Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
* Update FontAwesome to v6
Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
* add prometheus logo in the list of file that should be served at the root
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* move prometheus logo to src/images
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* Add Prometheus logo in react UI
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* Use REM
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
* increase the margin top of the navbar-brand
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Co-authored-by: Julien Pivotto <roidelapluie@inuits.eu>
* Fix bug that sets the range input to the resolution
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Address review comments
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* rework the target page
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* put back the URL of the endpoint
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* replace old code by the new one and change function style
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* align filter and search bar on the same row
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* remove unnecessary return
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* upgrade kvsearch to v0.3.0
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix unit test
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* add missing style on column
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* add placeholder and autofocus
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* put back the previous table design
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix issue relative to the position of the tooltip
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix health filter
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix test on label tooltip
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* simplify filter condition
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* rework service discovery page
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* introduced generic custom infinite scroll component
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* adjust the placeholder in discovery page
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* ignore returning type missing
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* rework alert page
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* update snapshot to match the new rendering
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix infinite scroll component usage in alert
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* align checkbox like it was before
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* propose a more responsive line to display the buttons and the search bar
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* add a script to update the snapshot and update it
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* text in span won't be wrapped
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* create a component to handle the search bar with debounce
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* Update web/ui/react-app/src/pages/serviceDiscovery/Services.tsx
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* Nits after PR 10051 merge (#10159)
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Co-authored-by: Marco Pracucci <marco@pracucci.com>
* tsdb/agent: Fix deadlock from simultaneous GC and write (#10166)
* tsdb/agent: Fix deadlock from simultaneous GC and write
This commit fixes a potential deadlock where storing in-memory series
references could deadlock with a WAL GC cycle.
Signed-off-by: Robert Fratto <robertfratto@gmail.com>
* add missing license header
Signed-off-by: Robert Fratto <robertfratto@gmail.com>
* order local imports
Signed-off-by: Robert Fratto <robertfratto@gmail.com>
* align deadlock testing with discovery/manager_test.go method
Also prevents GCs from running concurrently, which could also cause a
deadlock (even though it's currently impossible for two GCs to run
concurrently).
Signed-off-by: Robert Fratto <robertfratto@gmail.com>
* bump @nexucis/kvsearch to v0.4.0
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* Bump github.com/prometheus/client_golang to v1.12.0
Signed-off-by: beorn7 <beorn@grafana.com>
* Cut v2.33.0-rc.1
Signed-off-by: beorn7 <beorn@grafana.com>
Co-authored-by: Augustin Husson <husson.augustin@gmail.com>
Co-authored-by: Julius Volz <julius.volz@gmail.com>
Co-authored-by: Mauro Stettler <mauro.stettler@gmail.com>
Co-authored-by: Marco Pracucci <marco@pracucci.com>
Co-authored-by: Robert Fratto <robertfratto@gmail.com>
* rework the target page
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* put back the URL of the endpoint
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* replace old code by the new one and change function style
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* align filter and search bar on the same row
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* remove unnecessary return
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* upgrade kvsearch to v0.3.0
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix unit test
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* add missing style on column
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* add placeholder and autofocus
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* put back the previous table design
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix issue relative to the position of the tooltip
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix health filter
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix test on label tooltip
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* simplify filter condition
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* rework service discovery page
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* introduced generic custom infinite scroll component
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* adjust the placeholder in discovery page
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* ignore returning type missing
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* apply fix required by the review
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* index discoveredLabels
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>