Commit graph

1421 commits

Author SHA1 Message Date
Julien Pivotto 3599213e79
Release 2.37.0-rc.1 (#10999)
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-07-11 10:04:30 +02:00
Julien Pivotto 7479cd95b0
Fix UI release script and bump UI release (#10981)
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-07-05 15:12:59 +02:00
Augustin Husson 7b006e804c
enable ui module publication (#10876)
* enable ui module publication

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* use main changelog of Prometheus to reflect the changes of the packages

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* ignore changelog and license in the libs

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* replace perses references

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-06-30 12:10:10 +02:00
beorn7 cf474c1116 web: Add new histogram functions to highlight.js
Signed-off-by: beorn7 <beorn@grafana.com>
2022-06-29 17:31:00 +02:00
beorn7 9eafed0f79 promql: Add histogram_count and histogram_sum
This follow a simple function-based approach to access the count and
sum fields of a native Histogram. It might be more elegant to
implement “accessors” via the dot operator, as considered in the
brainstorming doc [1]. However, that would require the introduction of
a whole new concept in PromQL. For the PoC, we should be fine with the
function-based approch. Even the obvious inefficiencies (rate'ing a
whole histogram twice when we only want to rate each the count and the
sum once) could be optimized behind the scenes.

Note that the function-based approach elegantly solves the problem of
detecting counter resets in the sum of observations in the case of
negative observations. (Since the whole native Histogram is rate'd,
the counter reset is detected for the Histogram as a whole.)

We will decide later if an “accessor” approach is really needed. It
would change the example expression for average duration in
functions.md from

      histogram_sum(rate(http_request_duration_seconds[10m]))
	/
      histogram_count(rate(http_request_duration_seconds[10m]))

to

      rate(http_request_duration_seconds.sum[10m])
	/
      rate(http_request_duration_seconds.count[10m])

[1]: https://docs.google.com/document/d/1ch6ru8GKg03N02jRjYriurt-CZqUVY09evPg6yKTA1s/edit

Signed-off-by: beorn7 <beorn@grafana.com>
2022-06-28 18:16:48 +02:00
beorn7 a3a8f58bb3 promql: Add histogram_fraction function
Signed-off-by: beorn7 <beorn@grafana.com>
2022-06-28 15:58:03 +02:00
Augustin Husson 87ffac3e9d
Add readme for lezer-promql and update codemirror-promql readme (#10875)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-06-22 16:57:03 +02:00
Matthew ee11771323
fix: add response closures to web_test.go (#10675)
* fix: add response closures to web_test.go

Signed-off-by: mtfoley <mtfoley.mae@gmail.com>
2022-06-17 09:55:52 +02:00
beorn7 095b6c93dd Merge branch 'main' into sparsehistogram 2022-06-14 14:27:35 +02:00
Augustin Husson 5d1756c822
Upgrade codemirror and lezer to the latest version (#10841)
* 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>
2022-06-13 17:55:06 +02:00
Peter Štibraný 5bd761fbfc
Merge pull request #10857 from pstibrany/fix-errors-handling
API: Fix errors handling
2022-06-13 17:45:35 +02:00
Augustin Husson 3dad28fcbd
UI: fix build (#10862)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-06-13 16:40:08 +02:00
Augustin Husson 5184f49a2a
put every packages under the prometheus-io organization (#10849)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-06-13 15:19:07 +02:00
Augustin Husson e166cf402a
use npm workspace flag for the build instead of manually navigate through the folders (#10854)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-06-13 10:53:46 +02:00
beorn7 40ad5e284a Merge branch 'main' into beorn7/sparsehistogram 2022-06-09 20:50:30 +02:00
Julien Pivotto f2ba2a0800
Fix UI build (#10843)
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
2022-06-09 15:11:46 +02:00
Filip Petkovski a56731126d
Export TSDB status structs (#10783)
We would like to implement the tsdb/status API in certain Thanos
components.

In order to match the Prometheus API and avoid duplicating code,
this commit makes the structs used in the status API public.

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
2022-06-07 16:13:21 +01:00
Ben Kochie 9570924511
Merge pull request #9638 from prometheus/superq/agentMode
Add agent mode identifier
2022-05-24 10:11:21 +02:00
Łukasz Mierzwa 44e5f220c0
Move prometheus_ready metric to web package (#10729)
This moves prometheus_ready to the web package and links it with the ready variable that decides if HTTP requests should return 200 or 503.
This is a follow up change from #10682

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
2022-05-23 16:00:59 +02:00
Ivo Gosemann e22b54e253 Adds day_of_year function to PromQL
Signed-off-by: Ivo Gosemann <ivo.gosemann@sap.com>
2022-05-20 14:08:34 +02:00
Augustin Husson 4ece54852c
bump nexucis deps (#10713)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-05-20 09:22:09 +02:00
wangxiaolei 707600d84f
web: Make the dev proxy work with newer Node.js versions (#10690)
Signed-off-by: fatelei <fatelei@gmail.com>
2022-05-17 02:20:58 -06:00
Augustin Husson ff3ba13677
bump @nexucis/kvsearch v0.6.0 (#10702)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-05-17 09:04:57 +02:00
Augustin Husson 6bc5186f58
run sequentially the unit test in codemirror (#10692)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-05-13 14:49:38 +02:00
Bryan Boreham 4b9f248e85
unit tests: make all Labels sorted alphabetically (#10532)
"Labels is a sorted set of labels. Order has to be guaranteed upon
instantiation." says the comment, so fix all the tests that break this
rule.

For `BenchmarkLabelValuesWithMatchers()` and
`BenchmarkHeadLabelValuesWithMatchers()` the amount of work done changes
significantly if you put the labels in order, because all series refs
get neatly partitioned by the `tens` label, so I renamed the labels
to maintain the previous behaviour.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2022-05-04 23:41:36 +02:00
Augustin Husson 0a30ac3f9b
enable active search through dropped targets (#10668)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-05-04 20:27:56 +02:00
beorn7 c9f9ff9aa8 UI: Handle histograms without buckets
Signed-off-by: beorn7 <beorn@grafana.com>
2022-05-04 16:30:36 +02:00
beorn7 3bc711e333 Merge branch 'main' into sparsehistogram 2022-05-04 13:37:13 +02:00
beorn7 9cfc78814e React: Clean up formatting
Signed-off-by: beorn7 <beorn@grafana.com>
2022-05-04 13:31:34 +02:00
Björn Rabenstein 23675cad16
Merge pull request #10666 from prometheus/beorn7/exclude-empty-buckets-from-json
Histogram: Exclude empty buckets from json
2022-05-04 13:00:21 +02:00
beorn7 d16b314b72 Histogram: Do not render empty buckets in JSON output
While empty buckets can make sense in the internal representation (by
joining spans that would otherwise need more overhead for separate
representation), there are no spans in the JSON rendering. Therefore,
the JSON should not contain any empty buckets, since any buckets not
included in the output counts as empty anyway.

This changes both the inefficient MarshalJSON implementation as well
as the jsoniter implementation.

Signed-off-by: beorn7 <beorn@grafana.com>
2022-05-03 18:18:55 +02:00
beorn7 61d6d1df18 Histogram: Remove obsolete work-around code
Signed-off-by: beorn7 <beorn@grafana.com>
2022-05-03 17:57:52 +02:00
Arunprasad Rajkumar 854d671b6b
chore: remove unused file assets_generate.go (#10638)
This file seem to be a remaining of https://github.com/prometheus/prometheus/pull/10220

Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
2022-04-28 22:24:20 +02:00
beorn7 77a362b771 Histogram support in table view
Signed-off-by: beorn7 <beorn@grafana.com>
2022-04-28 19:49:13 +02:00
Matthieu MOREL e2ede285a2
refactor: move from io/ioutil to io and os packages (#10528)
* refactor: move from io/ioutil to io and os packages
* use fs.DirEntry instead of os.FileInfo after os.ReadDir

Signed-off-by: MOREL Matthieu <matthieu.morel@cnp.fr>
2022-04-27 11:24:36 +02:00
AndreSPy1 d8ca9aa67b
Allow setting the search term on alerts, targets, and discovery pages via the URL (#10613)
* changes in files of the expr in alerts, service and targets, Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* update prettier corrections

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* update prettier corrections

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* correction suggested fixes PR

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* Update Snap AlertContents.test.tsx and update recommendations in the code

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* Update web/ui/react-app/src/components/SearchBar.tsx

exactly, thanks :)

Co-authored-by: Julius Volz <julius.volz@gmail.com>
Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* Revert "Update web/ui/react-app/src/components/SearchBar.tsx
"

This reverts commit 679c763a02f65297e3f761db372a0928550f288c.

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* update SearchBar component

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* eslint-disable update SearchBar testing failed

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* correction part in eslint-disable

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* fully corrected suggestion with search expression in url

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

* implementation in handleSearchChange with useCallBack

Signed-off-by: AndreSPy1 <elsenorcito@gmail.com>

Co-authored-by: Julius Volz <julius.volz@gmail.com>
2022-04-26 21:20:48 +02:00
beorn7 37bbc07118 Histogram: Add jsoniter marshaling
This now even enables jsoniter marshaling of Points in an instant
query (which previously used the traditional JSON marshaling).

Signed-off-by: beorn7 <beorn@grafana.com>
2022-04-26 15:19:59 +02:00
beorn7 99894f6afa Histogram: Implement inefficient JSON rendering
Format is according to example 4 in
https://docs.google.com/document/d/1Efu0LX-fgNWix6ehfeCR0FzeWtHvftWFNoy7cYW9nqU/edit#

This is inefficient as it doesn't use jsoniter. It actually prevents
it for regular Points (with a conventional float Value), too.

Signed-off-by: beorn7 <beorn@grafana.com>
2022-04-14 20:38:49 +02:00
dependabot[bot] 90e6db6d45
build(deps): bump @fortawesome/free-solid-svg-icons in /web/ui (#10557)
Bumps [@fortawesome/free-solid-svg-icons](https://github.com/FortAwesome/Font-Awesome) from 6.0.0 to 6.1.1.
- [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
- [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md)
- [Commits](https://github.com/FortAwesome/Font-Awesome/compare/6.0.0...6.1.1)

---
updated-dependencies:
- dependency-name: "@fortawesome/free-solid-svg-icons"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 15:55:26 +02:00
dependabot[bot] 892f6baaeb
build(deps-dev): bump sinon from 12.0.1 to 13.0.1 in /web/ui (#10553)
Bumps [sinon](https://github.com/sinonjs/sinon) from 12.0.1 to 13.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v12.0.1...v13.0.1)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 15:28:21 +02:00
dependabot[bot] bc3561b7d2
build(deps): bump @fortawesome/fontawesome-svg-core in /web/ui (#10552)
Bumps [@fortawesome/fontawesome-svg-core](https://github.com/FortAwesome/Font-Awesome) from 1.3.0 to 6.1.1.
- [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
- [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md)
- [Commits](https://github.com/FortAwesome/Font-Awesome/commits/6.1.1)

---
updated-dependencies:
- dependency-name: "@fortawesome/fontawesome-svg-core"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 14:59:12 +02:00
dependabot[bot] 84c72a5e88
build(deps): bump moment from 2.29.1 to 2.29.2 in /web/ui (#10533)
Bumps [moment](https://github.com/moment/moment) from 2.29.1 to 2.29.2.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.1...2.29.2)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 14:50:26 +02:00
Garen Chan 1d45c418a5
Fix scrape interval and duration tooltip not showing. (#10545)
Signed-off-by: garenchan <garenchan23@gmail.com>
2022-04-07 14:36:08 +02:00
dependabot[bot] 9665c542a1
build(deps-dev): bump @types/node from 16.11.26 to 17.0.23 in /web/ui (#10534)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.26 to 17.0.23.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 10:02:14 +02:00
dependabot[bot] 6cacdb7f67
build(deps): bump sass from 1.44.0 to 1.49.11 in /web/ui (#10526)
Bumps [sass](https://github.com/sass/dart-sass) from 1.44.0 to 1.49.11.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.44.0...1.49.11)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-07 10:01:53 +02:00
beorn7 7ee1836ef5 Merge branch 'main' into sparsehistogram 2022-04-05 18:31:19 +02:00
Augustin Husson 043a2954f8
UI: stabilize dependencies and environment (#10517)
* 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>
2022-04-05 11:49:22 +02:00
beorn7 4210aac74a Merge branch 'main' into sparsehistogram 2022-03-22 14:47:42 +01:00
Andrew Bloomgarden ed091a1fb9 Allow replacing the stats struct before rendering JSON
This allows other implementations to inject their own statistics that
they're gathering in data linked from the context.Context. For example,
Cortex can inject its stats.Stats value under the `cortex` key.

Signed-off-by: Andrew Bloomgarden <blmgrdn@amazon.com>
2022-03-21 23:49:17 +01:00
Alan Protasio 606ef33d91 Track and report Samples Queried per query
We always track total samples queried and add those to the standard set
of stats queries can report.

We also allow optionally tracking per-step samples queried. This must be
enabled both at the engine and query level to be tracked and rendered.
The engine flag is exposed via a Prometheus feature flag, while the
query flag is set when stats=all.

Co-authored-by: Alan Protasio <approtas@amazon.com>
Co-authored-by: Andrew Bloomgarden <blmgrdn@amazon.com>
Co-authored-by: Harkishen Singh <harkishensingh@hotmail.com>
Signed-off-by: Andrew Bloomgarden <blmgrdn@amazon.com>
2022-03-21 23:49:17 +01:00
Julien Pivotto c901ebaf8d
ui/compress: Do not change git worktree (#10467)
This change makes sure that the git worktree is not changed while
compressing assets, making it better for local development.

To achieve this, the compression script keeps the un-compressed assets
and generates the go:embed directory when compressing the files.

A .gitignore file has been added to ignore generated files.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2022-03-20 15:08:32 +01:00
Gabriel Bernal 9ed56c6065
export newCompleteStrategy to avoid client import errors (#10448)
This will avoid codemirror-promql clients to choose manually between cjs or esm so the bundler can decide.

Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
2022-03-18 14:29:35 +01:00
Gabriel Bernal 38ef68e27f
fix: test commands should run only project related tests (#10440)
Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
2022-03-11 15:56:26 +01:00
Julius Volz 7f238e6a04
Fix DataTable tests and missing value key warning (#10422)
* 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>
2022-03-09 17:19:45 +01:00
Jan Fajerski 2c3d45c88a
Replace vfsgen with embed for static web assets (#10220)
* remove vfsgen usages

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* web: use embed package for static assets

This requires go 1.16.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* circleci: drop go generate in web/ui

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>

* Makefile: compress web assets before build

This commit add compression before (and decompression after) prometheus
is build. This ensures that gzipped assets are embeded in the prometheus
binary, if the builtinassets build tag is passed. If the build tag is
not passed this step is still executed but has no effect.
All this is executed in a subshell so that we can run the decompress
step even if the build step fails, but retain the exit code of promu.
This cleanup could also cover interrupts, but I left that out for now.

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
2022-03-09 10:21:31 +01:00
Ondrej Kokes 16e610ee8f
Add a tooltip for unix times (ISO strings) (#10376)
* 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>
2022-03-09 10:16:54 +01:00
dependabot[bot] 9dbd1cc1b9
build(deps-dev): bump typescript from 4.5.2 to 4.6.2 in /web/ui (#10402)
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.5.2 to 4.6.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.5.2...v4.6.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-06 17:33:45 +01:00
Łukasz Mierzwa 4e3b6fc043
Upgrade create-react-app to v5 (#10396)
* 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>
2022-03-05 20:45:55 +01:00
Łukasz Mierzwa a4317bf0ec
Run gofumpt on all files (#10392)
* Run gofumpt on all files

Getting golangci-lint errors when building on my laptop, possibly because I have newer version of gofumpt then what it was formatted with.
Run gofumpt -w -extra on all files as it will be needed in the future anyway.

* Update golangci-lint to v1.44.2

v1.44.0 upgraded gofumpt so bumping version in CI will help keep formatting correct for everyone

* Address golangci-lint error

Getting 'error-strings: error strings should not be capitalized or end with punctuation or a newline' from revive here.
Drop new line.

Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
2022-03-03 17:21:05 +01:00
dependabot[bot] bc15861e31
build(deps-dev): bump @types/react from 17.0.36 to 17.0.39 in /web/ui (#10323)
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 17.0.36 to 17.0.39.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 16:10:28 +01:00
Augustin Husson 779a9118db
bump kvsearch to v0.5.0 that support generic type. It removes unnecessary cast in the process (#10296)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-02-21 15:37:28 +01:00
SuperQ b297520666
Add agent mode identifier
Identify in the logs and liveness endpoints if the server is running in
Agent mode or not.

Signed-off-by: SuperQ <superq@gmail.com>
2022-02-17 05:27:09 +01:00
Julien Pivotto 9a2e93228e
Switch to grafana/regexp everywhere (#10268)
Let's have a consistent library for regexp.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2022-02-13 00:58:27 +01:00
Augustin Husson 4af2fc8bc2
Fix serving of Prometheus logo, move it into 'src/images' (#10236)
* 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>
2022-02-02 14:53:30 +01:00
Augustin Husson 727cdbff4c
remove old UI (#10208)
* remove old ui

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* add coments and removed unused struct

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* removed tplFunc

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-02-02 11:26:11 +01:00
Augustin Husson 68bfd226fb
Add Prometheus Logo (#10233)
* 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>
2022-02-01 15:39:35 +01:00
Julius Volz 3c9faa25bf
Fix bug that sets the range input to the resolution (#10227)
* 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>
2022-01-31 17:56:56 +01:00
dependabot[bot] fe06f16c11
build(deps): bump @codemirror/history from 0.19.0 to 0.19.2 in /web/ui (#10173)
Bumps [@codemirror/history](https://github.com/codemirror/history) from 0.19.0 to 0.19.2.
- [Release notes](https://github.com/codemirror/history/releases)
- [Changelog](https://github.com/codemirror/history/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codemirror/history/compare/0.19.0...0.19.2)

---
updated-dependencies:
- dependency-name: "@codemirror/history"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-25 12:39:48 +01:00
Matej Gera 2c61d29b2a
Tracing: Migrate to OpenTelemetry library (#9724)
Signed-off-by: Matej Gera <matejgera@gmail.com>
2022-01-25 11:08:04 +01:00
Augustin Husson 027b082793
Rework Alert page (#10142)
* 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>
2022-01-22 10:39:15 +01:00
Julien Pivotto a4d3206618
Merge release-2.33 forward into main (#10189)
* 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>
2022-01-20 17:19:00 +01:00
Augustin Husson b9f05e15f7 bump @nexucis/kvsearch to v0.4.0
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-01-19 16:11:09 +01:00
suyashtava 92ce9e3302
Improve graph colors in new UI (#10179)
* Colors for New UI
Signed-off-by: suyashtava <suyashtava@example.com>

Signed-off-by: suyashtava <suyashtava@gmail.com>

* Fixing indentation
Signed-off-by: suyashtava <suyashtava@example.com>

Signed-off-by: suyashtava <suyashtava@gmail.com>

* Fixing indentation2
Signed-off-by: suyashtava <suyashtava@example.com>

Signed-off-by: suyashtava <suyashtava@gmail.com>

* Fixing indentation3
Signed-off-by: suyashtava <suyashtava@example.com>

Signed-off-by: suyashtava <suyashtava@gmail.com>
2022-01-19 14:09:24 +01:00
Augustin Husson 74f497ac18 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>
2022-01-19 14:02:39 +01:00
dependabot[bot] a56f2856ed
build(deps-dev): bump @wojtekmaj/enzyme-adapter-react-17 in /web/ui (#10147)
Bumps [@wojtekmaj/enzyme-adapter-react-17](https://github.com/wojtekmaj/enzyme-adapter-react-17) from 0.6.5 to 0.6.6.
- [Release notes](https://github.com/wojtekmaj/enzyme-adapter-react-17/releases)
- [Commits](https://github.com/wojtekmaj/enzyme-adapter-react-17/compare/v0.6.5...v0.6.6)

---
updated-dependencies:
- dependency-name: "@wojtekmaj/enzyme-adapter-react-17"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-17 11:32:54 +01:00
Augustin Husson b9bc8e7c33 create a component to handle the search bar with debounce
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2022-01-12 16:23:38 +01:00
Björn Rabenstein 933f50bcda
Merge pull request #10121 from prometheus/beorn7/promql
PromQL: Promote negative offset and @ modifer to stable
2022-01-12 14:09:46 +01:00
Abhishek 2f4289a3bf
add limit to the rules api (#10152) 2022-01-11 22:44:22 -05:00
beorn7 b39f2739e5 PromQL: Always enable negative offset and @ modifier
This follows the line of argument that the invariant of not looking
ahead of the query time was merely emerging behavior and not a
documented stable feature. Any query that looks ahead of the query
time was simply invalid before the introduction of the negative offset
and the @ modifier.

Signed-off-by: beorn7 <beorn@grafana.com>
2022-01-11 17:08:55 +01:00
Augustin Husson bff9d06874
Service Discovery Page rework (#10131)
* 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>
2022-01-10 17:39:51 +01:00
Björn Rabenstein 0f4a1e6eac
Merge pull request #10119 from prometheus/beorn7/remote
API: Promote remote-write-receiver to stable
2022-01-10 15:55:10 +01:00
Augustin Husson dd9f96b893
rework the target page (#10103)
* 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>
2022-01-10 15:53:14 +01:00
Victor Häggqvist 931acc3ee8
fix overlapping click-targets of alert state checkboxes (#10136)
using the same margin as checkboxes on top of /graph

Signed-off-by: Victor Häggqvist <victor@snilius.com>
2022-01-07 10:38:01 +01:00
beorn7 8fdfa52976 API: Promote remote-write-receiver to stable
Since `/api/v1/write` is a mutating endpoint, we should still activate
the remote-write-receiver explicitly. But we should do it in the same
way as the other mutating endpoints, i.e. via a flag
`--web.enable-remote-write-receiver`.

This commit marks the feature flag as deprecated, i.e. it still works
but logs a warning on startup. This enables users to seamlessly
migrate. With the next minor release, we can start ignoring the
feature flag (but still warn a user that is trying to use it).

Signed-off-by: beorn7 <beorn@grafana.com>
2022-01-05 15:36:07 +01:00
Drew DeVault 8b0e1efd4f
Merge pull request #10100 from ddevault/main
codemirror-promql: use npm to run lezer-generator
2022-01-02 11:41:47 +01:00
dependabot[bot] d5845f8333
build(deps-dev): bump @types/sanitize-html in /web/ui (#10087)
Bumps [@types/sanitize-html](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sanitize-html) from 2.5.0 to 2.6.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sanitize-html)

---
updated-dependencies:
- dependency-name: "@types/sanitize-html"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-28 12:35:12 +01:00
dependabot[bot] 24718ce424
build(deps-dev): bump @typescript-eslint/eslint-plugin in /web/ui (#10054)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.5.0 to 5.8.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.8.0/packages/eslint-plugin)

Signed-off-by: SuperQ <superq@gmail.com>

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-23 11:46:06 +01:00
Julius Volz 32bd177b9c
Remove unusued npm package "i" (#10078)
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-12-23 11:07:46 +01:00
dependabot[bot] a030f43f20
build(deps-dev): bump @typescript-eslint/parser in /web/ui (#10055)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.5.0 to 5.8.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.8.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-23 11:05:56 +01:00
Oleg Zaytsev 3c400d443d
Accept promql.Engine interface in v1.NewAPI() (#10050)
Instead of requesting a concrete type. This would allow other
implementations that use the same API to replace or wrap the engine
implementation while maintaining the same API.

Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
2021-12-21 11:22:40 +01:00
Julius Volz 54dbfa7f68 Update package-lock.json
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-12-20 22:00:23 +01:00
Julius Volz 52a1a1a797 Also update codemirror-promql version in react-app
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-12-20 22:00:23 +01:00
Julius Volz d3ae69bb22 Cut v0.19.0 of codemirror-promql
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-12-20 22:00:23 +01:00
Augustin Husson 1a2a9db425 fix the case when there is nothing in the expr
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-12-20 20:54:01 +01:00
Augustin Husson 87463257a7 upgrade lezer deps to be aligned between the mirror and prometheus
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-12-20 20:53:44 +01:00
Shihao Xia f5c3ea1bf2
fix missing db.Close() in web_test.go in order to avoid goroutine leak (#10035)
Signed-off-by: Shihao Xia <charlesxsh@hotmail.com>
2021-12-20 17:37:53 +05:30
beorn7 64c7bd2b08 Merge branch 'main' into sparsehistogram 2021-12-18 14:04:25 +01:00
renzheng.wang 3462b79f4b
fix TestAgentAPIEndPoints (#9882)
* fix TestAgentAPIEndPoints

Signed-off-by: renzheng.wang <wangrzneu@gmail.com>

* fix TestAgentAPIEndPoints

Signed-off-by: renzheng.wang <wangrzneu@gmail.com>
2021-12-17 14:36:15 +00:00
beorn7 6f33ab2b35 Merge branch 'main' into sparsehistogram 2021-12-15 13:49:33 +01:00
Julien Pivotto db1551bd21
Merge pull request #10016 from prometheus/release-2.32
Merge back release 2.32
2021-12-14 20:58:58 +01:00