This exactly corresponds to the statistic compared against MaxSamples
during the course of query execution, so users can see how close their
queries are to a limit.
Co-authored-by: Harkishen Singh <harkishensingh@hotmail.com>
Co-authored-by: Andrew Bloomgarden <blmgrdn@amazon.com>
Signed-off-by: Andrew Bloomgarden <blmgrdn@amazon.com>
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>
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>
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>
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>
* labels.Equal benchmark for equal, not equal, and differing lengths
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
* Compare equality of label.Label structs directly
Compare the structs using `==` instead of the name and value
of each label. This is functionally equivalent and about ~10%
faster in my testing.
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
* Use longer more realistic names and values in benchmark
Signed-off-by: Nick Pillitteri <nick.pillitteri@grafana.com>
This change ensures that we don't use the deprecated Ubuntu images which
are going to be unavailable starting May 31 2022 [1].
[1] https://circleci.com/blog/ubuntu-14-16-image-deprecation/
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
At the moment when I run make to build Prometheus npm tests are run as part of the process.
By default jest will run in interactive mode, unless CI env variable is set, meaning that it will run forever watching for file changes. This means that to build the binary I need to wait for jest to start and then press Q to exit it, which seems unnecessary.
Set CI=true for npm scripts so it always run in as a single run instead of watch mode.
Signed-off-by: Łukasz Mierzwa <l.mierzwa@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>
* 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>
* 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>
* scrape: allow providing a custom Dialer for scraping
This commit extends config.ScrapeConfig with an optional field to
override how HTTP connections to targets are created. This field is not
set directly in Prometheus, and is only added for the convenience of
downstream importers.
Closes#9706
Signed-off-by: Robert Fratto <robertfratto@gmail.com>
* scrape: move custom dial function to scrape.Options
Signed-off-by: Robert Fratto <robertfratto@gmail.com>
Note that this bugfix release also includes the update of the
containerd/containerd dependency, with the only purpose of shutting up
security scanner spam. We usually do not decument dependency updates
in the CHANGELOG. In this case, it isn't even doing anything. I plan
to mention the update in the announcement mail.
Signed-off-by: beorn7 <beorn@grafana.com>
Do not block when trying to write a batch to the queue. This can cause
appends to lock forever if the only thing reading from the queue needs
the mutex to write. Instead, if batchQueue is full pop the sample that
was just added from the partial batch and return false. The code doing
the appending already handles retries with backoff.
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>