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

fix: stringify pyrra_window expression #1234

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

abestel
Copy link

@abestel abestel commented Aug 5, 2024

While trying to use Azure Prometheus Rules Converter with generic rules enabled, the following error was thrown:

Failed to validate Prometheus Rules Schema
[
  {
    "instancePath": "/groups/2/rules/1/expr",
    "schemaPath": "#/properties/expr/type",
    "keyword": "type",
    "params": {
      "type": "string"
    },
    "message": "must be string"
  },
]

This corresponds to the pyrra_window expression, which is currently a raw integer. Turning it into a string fixes the issue and does not seem to have any impact on the rule on Prometheus. This is also in line with the fact that pyrra_objective is also stringified.

While trying to use [Azure Prometheus Rules Converter](https://github.com/Azure/prometheus-collector/tree/main/tools/az-prom-rules-converter#az-prom-rules-converter) with generic rules enabled, the following error was thrown:

```
Failed to validate Prometheus Rules Schema
[
  {
    "instancePath": "/groups/2/rules/1/expr",
    "schemaPath": "#/properties/expr/type",
    "keyword": "type",
    "params": {
      "type": "string"
    },
    "message": "must be string"
  },
]
```

This corresponds to the `pyrra_window` expression, which is currently a raw integer. Turning it into a string fixes the issue and does not seem to have any impact on the rule on Prometheus. This is also in line with the fact that `pyrra_objective` is also stringified.
@metalmatze
Copy link
Member

Interesting fix.
Let's roll with it if it works for you.
Thanks!

@metalmatze metalmatze merged commit 196403e into pyrra-dev:main Aug 23, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants