Commit Graph

1172 Commits

Author SHA1 Message Date
Matthew 628211c25a
Feat UI metrics search (#9629)
* feat: add search to metrics explorer

Signed-off-by: mtfoley <mtfoley.mae@gmail.com>

* fix: ui-lint and ui-build errors

Signed-off-by: mtfoley <mtfoley.mae@gmail.com>

* feat: use @nexucis/fuzzy

Signed-off-by: mtfoley <mtfoley.mae@gmail.com>

* chore: code style and delete commented test

Signed-off-by: mtfoley <mtfoley.mae@gmail.com>

* rename Props to MetricsExplorerProps

Signed-off-by: mtfoley <mtfoley.mae@gmail.com>
2021-11-08 19:11:39 +01:00
Augustin Husson 4caae4e4a6
add a negative boost for some trigonometric functions that can overlapp other regular promQL functions (#9688)
* add a negative boost for some trigonometric functions that can overlapp other regular promQL functions

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

* add comments to explain the purpose of the attribute boost

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-11-08 14:32:38 +01:00
Augustin Husson 17fc57948a
codemirror-promql moved to prometheus org (#9651)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-11-03 12:46:58 +01:00
Julien Pivotto b40e254f25
Agent: Add a boolean to the index to indicate agent mode. (#9649)
I would like to avoid extra API call's to determine if we are running in
Agent Mode, so I think we could use this approach.

This is a bootstrap of #9612

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2021-11-03 03:47:14 +00:00
Mateusz Gozdek 1a6c2283a3 Format Go source files using 'gofumpt -w -s -extra'
Part of #9557

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2021-11-02 19:52:34 +01:00
Julien Pivotto b1e8e8a0ca
Merge pull request #9642 from prometheus/release-2.31
Merge back release 2.31
2021-11-02 14:19:28 +01:00
Robert Fratto bc72a718c4
Initial draft of prometheus-agent (#8785)
* Initial draft of prometheus-agent

This commit introduces a new binary, prometheus-agent, based on the
Grafana Agent code. It runs a WAL-only version of prometheus without the
TSDB, alerting, or rule evaluations. It is intended to be used to
remote_write to Prometheus or another remote_write receiver.

By default, prometheus-agent will listen on port 9095 to not collide
with the prometheus default of 9090.

Truncation of the WAL cooperates on a best-effort case with Remote
Write. Every time the WAL is truncated, the minimum timestamp of data to
truncate is determined by the lowest sent timestamp of all samples
across all remote_write endpoints. This gives loose guarantees that data
from the WAL will not try to be removed until the maximum sample
lifetime passes or remote_write starts functionining.

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* add tests for Prometheus agent (#22)

* add tests for Prometheus agent

* add tests for Prometheus agent

* rearranged tests as per the review comments

* update tests for Agent

* changes as per code review comments

Signed-off-by: SriKrishna Paparaju <paparaju@gmail.com>

* incremental changes to prometheus agent

Signed-off-by: SriKrishna Paparaju <paparaju@gmail.com>

* changes as per code review comments

Signed-off-by: SriKrishna Paparaju <paparaju@gmail.com>

* Commit feedback from code review

Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* Port over some comments from grafana/agent

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* Rename agent.Storage to agent.DB for tsdb consistency

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* Consolidate agentMode ifs in cmd/prometheus/main.go

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* Document PreAction usage requirements better for agent mode flags

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* remove unnecessary defaultListenAddr

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

* `go fmt ./tsdb/agent` and fix lint errors

Signed-off-by: Robert Fratto <robertfratto@gmail.com>

Co-authored-by: SriKrishna Paparaju <paparaju@gmail.com>
2021-10-29 16:25:05 +01:00
Julius Volz e7a12ac80a
Fix broken prefixed asset links in webpack build (#9586)
* Fix broken prefixed asset links in webpack build

Fixes https://github.com/prometheus/prometheus/issues/9585

Signed-off-by: Julius Volz <julius.volz@gmail.com>

* Use .env file for PUBLIC_URL npm build env var

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-10-25 12:52:13 +02:00
Augustin Husson a4ad290987
remove old promql editor (#9452)
* remove old promql editor

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

* rename CMExpression by Expression

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-10-18 17:22:23 +02:00
Augustin Husson 703d9bcd56
prepare the changelog for a next release of codemirror-promql (#9492)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-10-18 16:41:32 +02:00
Augustin Husson 08011925a1
update documentation around react-app (#9476)
* update documentation around react-app and how to upgrade the npm dependencies

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

* wording around caution to take when updating the deps

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

* fixing the npm version to be used and explain where you should perform the npm install command

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

* simplify what is required to build prometheus from the source

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

* aligned period and removed redondant word installed

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

* set nodeJS version to be used at 16

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

* describe manuel steps to update a dependency for the react-app

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

* rewording of the manuel step to update the dependencies

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-10-18 12:47:31 +02:00
Paweł Szulik 4414351576
web api: Delete unnecessary conversion. (#9517) 2021-10-15 18:41:53 -04:00
Pablo Caderno b878527151
Added deferred close to 'http.File' opened (#9443) (#9461)
Signed-off-by: Pablo Caderno <kaderno@gmail.com>
2021-10-06 13:02:46 +02:00
Mayursinh Sarvaiya 1270b87970
chore(ui): debounce effect in timerange query (#9359)
* chore(ui): debounce effect in timerange query

Signed-off-by: mayursiinh <marvinduff97@gmail.com>

* chore: private declaration of debounceExecuteQuery

Signed-off-by: mayursiinh <marvinduff97@gmail.com>

* fix: lint issue

Signed-off-by: mayursiinh <marvinduff97@gmail.com>
2021-10-03 15:05:16 +02:00
Augustin Husson 149e36921b
assess in readme that codemirror-promql is in prometheus/prometheus (#9388)
* assess in readme that codemirror is in prometheus/prometheus

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

* fix wording

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

* remove preview

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-28 09:19:04 +02:00
Augustin Husson eca9546ba4
fix package-lock.json (#9400)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-27 18:58:41 +02:00
Julius Volz f103acd513
Merge pull request #9248 from LeviHarrison/atan2-binary-op
PromQL: Add `atan2` binary operator
2021-09-27 18:45:56 +02:00
Augustin Husson dbbfd1ccf6
change license in package.json file of cmp (#9399)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-27 10:17:30 +02:00
Levi Harrison 2f896c98ff Address review comments
Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-09-26 15:45:25 -04:00
Augustin Husson 3e494eac71
upgrade to codemirror v19 (#9363)
* upgrade to codemirror v19

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

* fix autocomplete test

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

* fix wording

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-24 21:40:49 +02:00
Augustin Husson 7bcca77340
provide a way to override the apiPrefix in codemirror prom client + cleanup readme (#9384)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-24 07:52:50 +02:00
Levi Harrison e27ac3e7e4 Add grammar (maybe?)
Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-09-23 10:30:46 -04:00
Augustin Husson 545fbfd7f4 specify npm version in the engine
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-16 21:15:20 +02:00
Julius Volz 447d9401fc
Merge pull request #9239 from LeviHarrison/promql-trig-functions
PromQL: Add trigonometric functions
2021-09-16 14:11:40 +02:00
Levi Harrison 2c7bec758d Tabs to spaces
Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-09-15 23:02:26 -04:00
Levi Harrison ed220c1ae7 Add grammar
Signed-off-by: Levi Harrison <git@leviharrison.dev>
2021-09-15 23:02:25 -04:00
Augustin Husson e52204e556 fix eslint warning for codemirror-promql
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-15 13:38:48 +02:00
Julius Volz d2c0eac37f Fix linter errors in codemirror-promql module
Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-09-15 11:48:21 +02:00
Augustin Husson 1b740aeb6e Merge branch 'main' into feature/use-npm-workspace
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-14 19:27:44 +02:00
Augustin Husson af7aab7937 add global mock for the matchMedia function
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-14 15:49:46 +02:00
Augustin Husson 05b9a11a62 remove jest.restoreAllMock() call
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-14 15:49:46 +02:00
Augustin Husson c3306e6366 set canvas mock
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-14 15:49:46 +02:00
Julius Volz 5498ca5214 Update React 16->17, TypeScript, and some other node deps
This updates React, TypeScript, and some other node packages (but not
everything).

A couple of notes:

- `enzyme-adapter-react-16` does not have a React 17 equivalent yet, so I
  switched to the fork `@wojtekmaj/enzyme-adapter-react-17`
- A bunch of tests are still failing because I think in the enzyme testing
  environment, a browser API (`ResizeObserver`) is missing, and maybe for other
  reasons. This needs to be explored + fixed.
- The TypeScript update introduced more stringent rules, which required fixing
  up a bunch of pieces of code a bit.
- The `use-media` package doesn't work with React 17 yet, so I just built our
  own minimal `useMedia` hook instead (just a couple of lines).
- I commented out part of the code in `withStartingIndicator.tsx` because it
  fails the now-stricter lint checks. It needs to be fixed (and not commented
  out).

Signed-off-by: Julius Volz <julius.volz@gmail.com>
2021-09-14 15:46:59 +02:00
Augustin Husson 22fa0aa408
remove app package in codemirror-module (#9322)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-14 12:33:10 +02:00
George Robinson 049b4f4f13
Support customization of template options in TemplateExpander (#9290)
Signed-off-by: George Robinson <george.robinson@grafana.com>
2021-09-13 17:19:08 +05:30
Augustin Husson 19f5f44bf9 remove craco, no need for it
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-11 12:10:05 +02:00
Victor Häggqvist 9aaea327a0 use same top and bottom margin for alert filename
Signed-off-by: Victor Häggqvist <victor@snilius.com>
2021-09-10 21:21:22 +02:00
Augustin Husson 27aec91914 review the UI ci and associated command
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-10 17:18:25 +02:00
Augustin Husson 5c42b04af7 move to npm workspace
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-10 15:38:20 +02:00
Augustin Husson fa56d1e43b Merge branch 'feature/cleanup-codemirror' into feature/use-npm-workspace 2021-09-09 17:55:50 +02:00
Augustin Husson 29b788a7b5 remove app package in codemirror-module
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-09 17:52:03 +02:00
Victor Häggqvist 02cedb837d use consistent margin-bottom for all alert kinds
Signed-off-by: Victor Häggqvist <victor@snilius.com>
2021-09-08 21:28:49 +02:00
Augustin Husson c83137e757 Merge branch 'main' into update-react-and-ts
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-08 17:28:46 +02:00
Augustin Husson e1d8891a73 add global mock for the matchMedia function
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-08 17:26:24 +02:00
Augustin Husson 2cfdaf915f remove jest.restoreAllMock() call
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-08 17:13:44 +02:00
Ganesh Vernekar 1a5b21b78b
Update dependencies for v2.30.0 (#9308)
* Update Go dependencies

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Update React dependencies

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-09-07 20:17:21 +05:30
Augustin Husson b67c49a9ff Merge branch 'main' into update-react-and-ts
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-07 16:39:54 +02:00
Augustin Husson e785a0a31f set canvas mock
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-07 16:34:41 +02:00
Augustin Husson c827413755 Merge branch 'main' into update-react-and-ts
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
2021-09-07 11:51:39 +02:00
SuperQ 6281d26002
Update various react-app dependencies
Update several dependencies to cleanup `npm outdated`.

Signed-off-by: SuperQ <superq@gmail.com>
2021-09-07 11:34:37 +02:00