unable to add rules in prometheus and getting below errors

62 views
Skip to first unread message

Satish Parimi

unread,
Nov 28, 2023, 10:21:33 AM11/28/23
to Prometheus Users

 FAILED:

     splunkalerts_rules.yml: yaml: unmarshal errors:

  line 1: field apiVersion not found in type rulefmt.RuleGroups

  line 2: field kind not found in type rulefmt.RuleGroups

  line 3: field metadata not found in type rulefmt.RuleGroups

  line 8: field spec not found in type rulefmt.RuleGroups


prometheus. version: 2.41.0


Brian Candler

unread,
Nov 28, 2023, 10:38:12 AM11/28/23
to Prometheus Users
You have an error in your file "splunkalerts_rules.yml", but you haven't shown it. The message even tells you exactly what line the error is in.

It looks to me though like you're trying to put a Kubernetes resource definition file in place of a Prometheus rules file. Both are YAML, but they have different structures.

The YAML format that Prometheus expects is documented here: https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/ (including an example of what a valid file would look like)

Reply all
Reply to author
Forward
0 new messages