aa3513fc89
* consoles: exclude iowait and steal from CPU Utilisation 'iowait' and 'steal' indicate specific idle/wait states, which shouldn't be counted into CPU Utilisation. Also see https://github.com/prometheus-operator/kube-prometheus/pull/796 and https://github.com/kubernetes-monitoring/kubernetes-mixin/pull/667. Per the iostat man page: %idle Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request. %iowait Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request. %steal Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> * tsdb: shrink txRing with smaller integers 4 billion active transactions ought to be enough for anyone. Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * tsdb: create isolation transaction slice on demand When Prometheus restarts it creates every series read in from the WAL, but many of those series will be finished, and never receive any more samples. By defering allocation of the txRing slice to when it is first needed, we save 32 bytes per stale series. Signed-off-by: Bryan Boreham <bjboreham@gmail.com> * add cluster variable to Overview dashboard Signed-off-by: Erik Sommer <ersotech@posteo.de> * promql: simplify Native Histogram arithmetics Signed-off-by: Linas Medziunas <linas.medziunas@gmail.com> * Cut 2.49.0-rc.0 (#13270) * Cut 2.49.0-rc.0 Signed-off-by: bwplotka <bwplotka@gmail.com> * Removed the duplicate. Signed-off-by: bwplotka <bwplotka@gmail.com> --------- Signed-off-by: bwplotka <bwplotka@gmail.com> * Add unit protobuf parser Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it> * Go on adding protobuf parsing for unit Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it> * ui: create a reproduction for https://github.com/prometheus/prometheus/issues/13292 Signed-off-by: machine424 <ayoubmrini424@gmail.com> * Get conditional right Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it> * Get VM Scale Set NIC (#13283) Calling `*armnetwork.InterfacesClient.Get()` doesn't work for Scale Set VM NIC, because these use a different Resource ID format. Use `*armnetwork.InterfacesClient.GetVirtualMachineScaleSetNetworkInterface()` instead. This needs both the scale set name and the instance ID, so add an `InstanceID` field to the `virtualMachine` struct. `InstanceID` is empty for a VM that isn't a ScaleSetVM. Signed-off-by: Daniel Nicholls <daniel.nicholls@resdiary.com> * Cut v2.49.0-rc.1 Signed-off-by: bwplotka <bwplotka@gmail.com> * Delete debugging lines, amend error message for unit Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it> * Correct order in error message Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it> * Consider storage.ErrTooOldSample as non-retryable Signed-off-by: Daniel Kerbel <nmdanny@gmail.com> * scrape_test.go: Increase scrape interval in TestScrapeLoopCache to reduce potential flakiness Signed-off-by: machine424 <ayoubmrini424@gmail.com> * Avoid creating string for suffix, consider counters without _total suffix Signed-off-by: Arianna Vespri <arianna.vespri@yahoo.it> * build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.17.0 to 1.18.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.17.0...v1.18.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump actions/setup-node from 3.8.1 to 4.0.1 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.8.1 to 4.0.1. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits]( |
||
---|---|---|
.. | ||
module | ||
react-app | ||
static | ||
.gitignore | ||
.nvmrc | ||
assets_embed.go | ||
build_ui.sh | ||
embed.go.tmpl | ||
package-lock.json | ||
package.json | ||
README.md | ||
ui.go |
Overview
The ui
directory contains static files and templates used in the web UI. For
easier distribution they are compressed (c.f. Makefile) and statically compiled
into the Prometheus binary using the embed package.
During development it is more convenient to always use the files on disk to
directly see changes without recompiling.
To make this work, remove the builtinassets
build tag in the flags
entry
in .promu.yml
, and then make build
(or build Prometheus using
go build ./cmd/prometheus
).
This will serve all files from your local filesystem. This is for development purposes only.
React-app
Introduction
The react application is a monorepo composed by multiple different npm packages. The main one is react-app
which
contains the code of the react application.
Then you have different npm packages located in the folder modules
. These packages are supposed to be used by the
react-app and also by others consumers (like Thanos)
Pre-requisite
To be able to build the react application you need:
- npm >= v7
- node >= v20
Installing npm dependencies
The React UI depends on a large number of npm packages. These are not checked in, so you will
need to move to the directory web/ui
and then download and install them locally via the npm package manager:
npm install
npm consults the package.json
and package-lock.json
files for dependencies to install. It creates a node_modules
directory with all installed dependencies.
NOTE: Do not run npm install
in the react-app
folder or in any sub folder of the module
directory.
Upgrading npm dependencies
As it is a monorepo, when upgrading a dependency, you have to upgrade it in every packages that composed this monorepo (
aka, in all sub folder of module
and in react-app
)
Then you have to run the command npm install
in web/ui
and not in a sub folder / sub package. It won't simply work.
Running a local development server
You can start a development server for the React UI outside of a running Prometheus server by running:
npm start
This will open a browser window with the React app running on http://localhost:3000/. The page will reload if you make edits to the source code. You will also see any lint errors in the console.
NOTE: It will reload only if you change the code in react-app
folder. Any code changes in the folder module
is
not considered by the command npm start
. In order to see the changes in the react-app you will have to
run npm run build:module
Due to a "proxy": "http://localhost:9090"
setting in the package.json
file, any API requests from the React UI are
proxied to localhost
on port 9090
by the development server. This allows you to run a normal Prometheus server to
handle API requests, while iterating separately on the UI.
[browser] ----> [localhost:3000 (dev server)] --(proxy API requests)--> [localhost:9090 (Prometheus)]
Running tests
To run the test for the react-app and for all modules, you can simply run:
npm test
if you want to run the test only for a specific module, you need to go to the folder of the module and run
again npm test
.
For example, in case you only want to run the test of the react-app, go to web/ui/react-app
and run npm test
To generate an HTML-based test coverage report, run:
CI=true npm test:coverage
This creates a coverage
subdirectory with the generated report. Open coverage/lcov-report/index.html
in the browser
to view it.
The CI=true
environment variable prevents the tests from being run in interactive / watching mode.
See the Create React App documentation for more information about running tests.
Building the app for production
To build a production-optimized version of the React app to a build
subdirectory, run:
npm run build
NOTE: You will likely not need to do this directly. Instead, this is taken care of by the build
target in the main
Prometheus Makefile
when building the full binary.
Integration into Prometheus
To build a Prometheus binary that includes a compiled-in version of the production build of the React app, change to the root of the repository and run:
make build
This installs dependencies via npm, builds a production build of the React app, and then finally compiles in all web assets into the Prometheus binary.