When accepting an autocompletion result within an Identifier node (could be a
metric name, function name, keyword, etc.), the inserted completion should
replace the entire Identifier node all the way to its last character, not only
to the current cursor position.
A limitation is that the correct replacement-until-end-of-identifier only works
when e.g. a function name is currently incomplete (which is likely anyway when
trying to replace it with a different one). This is because otherwise the
Identifier node gets replaced with a more specific function node type (like
`Rate`, `SumOverTime`, etc.), and handling all those adds more complexity.
https://github.com/prometheus/prometheus/issues/15839
Signed-off-by: Julius Volz <julius.volz@gmail.com>
The /classic/static/* route was added to serve vendor JavaScript and CSS
files (jQuery, Bootstrap, etc.) for console templates. These vendor assets
were removed in #14807 due to security vulnerabilities, making this route
obsolete as it now serves an empty directory.
The console feature remains functional via --web.console.templates and
--web.console.libraries flags. Users who need JavaScript/CSS libraries in
their custom console templates must provide these assets within the
directory specified by --web.console.libraries.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
When React components mount/unmount repeatedly, each creating a new
PromQLExtension, memory leaks occur due to LRU caches with ttlAutopurge
timers keeping references alive and in-flight HTTP requests holding
closure references. This adds destroy() methods throughout the class
hierarchy to properly release resources on unmount.
Changes:
- Add destroy() to PrometheusClient interface (optional)
- HTTPPrometheusClient: track AbortControllers and abort pending requests
- Cache: clear all LRU caches and reset cached data
- CachedPrometheusClient: delegate to cache and underlying client
- HybridComplete: delegate to prometheusClient
- CompleteStrategy: add optional destroy() method
- PromQLExtension: delegate to complete strategy
Signed-off-by: Ben Blackmore <ben.blackmore@dash0.com>
Update generated files with latest functions from Prometheus, adding
support for first_over_time, info, ts_of_first_over_time,
ts_of_last_over_time, ts_of_max_over_time, and ts_of_min_over_time.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Add make targets to generate and check PromQL function signatures and
documentation for the Mantine UI. The generate-promql-functions target
runs the Go generators and automatically lints the output files. The
check-generated-promql-functions target verifies that generated files
are up to date, similar to check-generated-parser.
Fix the gen_functions_list generator to output properly formatted
TypeScript code with correct indentation and semicolons.
Add check-generated-promql-functions to the UI tests CI job to ensure
generated files stay in sync with upstream changes.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
By running `make update-all-go-deps`.
`hashicorp/consul/api` must be held at v1.32.1 because later versions
require Go 1.25 and we choose to ensure that Promethes builds with the
last two versions of Go.
Also: fix compilation errors in remote-write example.
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Add a maximum limit of 10,000 to the TSDB status endpoint to prevent
resource exhaustion from excessively large limit values, as we preallocate
[]Stat for up to the limit: `make([]Stat, 0, length)`.
Note that the endpoint acquires a cardinality mutex during
stats calculation, so this can not be run in parallel.
Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
Currently both the backend and frontend printers/formatters/serializers
incorrectly transform the following expression:
```
up * ignoring() group_left(__name__) node_boot_time_seconds
```
...into:
```
up * node_boot_time_seconds
```
...which yields a different result (including the metric name in the result
vs. no metric name).
We need to keep empty `ignoring()` modifiers if there is a grouping modifier
present.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
Added tests for durationWithUnitRegexp to validate matching of complete durations with units and ensure non-matching cases are correctly identified.
Signed-off-by: ADITYA TIWARI <142050150+ADITYATIWARI342005@users.noreply.github.com>
- No duration unit suggestions shown if a valid unit follows the digit (e.g. , )
- Adds related test cases
Signed-off-by: ADITYA TIWARI <adityatiwari342005@gmail.com>
To reduce main UI clutter, I added a new settings submenu above the chart
itself for the new setting. So far it only has the one new axis setting, but it
could accommodate further settings in the future.
For now I'm only adding a boolean on/off setting to the UI to set the Y axis to
0 or not. However, the underlying stored URL field is already named
y_axis_min={number} and would support other Y axis minima, in case we want to
support custom values in the UI in the future - but then we'd probably also
want to add an axis maximum and possibly other settings.
Fixes https://github.com/prometheus/prometheus/issues/520
Signed-off-by: Julius Volz <julius.volz@gmail.com>
Partially fixes https://github.com/prometheus/prometheus/issues/17416 by
renaming all CT* names to ST* in the whole codebase except RW2 (this is
done in separate
[PR](https://github.com/prometheus/prometheus/pull/17411)) and
PrometheusProto exposition proto.
```
CreatedTimestamp -> StartTimestamp
CreatedTimeStamp -> StartTimestamp
created_timestamp -> start_timestamp
CT -> ST
ct -> st
```
Signed-off-by: bwplotka <bwplotka@gmail.com>
OTLP Receiver: Only update metadata to WAL when metadata-wal-records feature is enabled.
---------
Signed-off-by: pipiland2612 <nguyen.t.dang.minh@gmail.com>
We already have infinite scrolling for all the rules within a group, but this
adds a second (nested) level of infinite scrolling for the firing alerts within
a rule.
This should further improve the rendering speed for the /alerts page for
Prometheus setups with many firing alerts and when you expand the individual
rule panels that contain those firing alerts.
Fixes https://github.com/prometheus/prometheus/issues/17254
Signed-off-by: Julius Volz <julius.volz@gmail.com>