Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disable promExpr validation feature flag for Cli and operator #4

Merged
merged 5 commits into from
Jul 13, 2023

Conversation

r3code
Copy link
Owner

@r3code r3code commented Jul 13, 2023

Pull from slok#511

This commit would fix issue slok#510

Hi.
promql expr validator in code caused issues because of lack of compatibility with some new promql inspired query engines like MetricsQL.
I think it would be helpful if we add some feature to sloth to allow people to disable promql validation if they want

For example:

i want to create a SLO from this SLI

version: "prometheus/v1"
service: "myservice"
slos:

Latency

  • name: "my_metricsql-query"
    objective: 99.5
    description: ""
    sli:
    events:
    error_query: sum(count_over_time((my-metrics{} > 15)) OR on() vector(0) )
    total_query: sum(count_over_time((my-metric{})) OR on() vector(0))
    alerting:
    page_alert:
    disable: true
    ticket_alert:
    disable: true
    but i got error

INFO[0000] SLI plugins loaded plugins=0 svc=storage.FileSLIPlugin version=v0.11.0 window=30d
INFO[0000] SLO period windows loaded svc=alert.WindowsRepo version=v0.11.0 window=30d windows=2
INFO[0000] Generating from Prometheus spec version=v0.11.0 window=30d
error: "generate" command failed: could not generate Prometheus format rules: could not generate prometheus rules: invalid SLO group: Key: 'SLOGroup.SLOs[0].SLI.Events.ErrorQuery' Error:Field validation for 'ErrorQuery' failed on the 'prom_expr' tag
Key: 'SLOGroup.SLOs[0].SLI.Events.TotalQuery' Error:Field validation for 'TotalQuery' failed on the 'prom_expr' tag
My query is actually correct and give me response from VictoriaMetrics in grafana with VictoriaMetrics prometheus data source

My suggestion is adding a capability of disabling promexpr validation with some flag
for example:

sloth generate -i ../my-victoriametrics-queries/test.yml -o /tmp/test.yaml --disable-promExpr-validation

dependabot bot and others added 5 commits June 16, 2023 17:41
Bumps [github.com/prometheus/prometheus](https://github.com/prometheus/prometheus) from 0.39.1 to 0.40.3.
- [Release notes](https://github.com/prometheus/prometheus/releases)
- [Changelog](https://github.com/prometheus/prometheus/blob/main/CHANGELOG.md)
- [Commits](prometheus/prometheus@v0.39.1...v0.40.3)

---
updated-dependencies:
- dependency-name: github.com/prometheus/prometheus
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Xabier Larrakoetxea <[email protected]>
@r3code r3code self-assigned this Jul 13, 2023
@r3code r3code added the enhancement New feature or request label Jul 13, 2023
@r3code r3code merged commit 7cc5abf into r3code:main Jul 13, 2023
r3code added a commit that referenced this pull request Dec 11, 2024
* Update prometeus operator dependecies

* Cli: Add a flag for disabling promExpr validation

* K8s Operator: Add a falg for disabling promExpr validation

* Helm chart: Add disablepromExprValidation to sloth configuration

Signed-off-by: Синявский Дмитрий Сергеевич <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants