You didn't copy what I wrote. You missed out the line "rules:", and also
the indentation is significant:
groups:
- name: MiscellaneousRules
* rules:*
- alert: PrometheusAllTargetsMissing
expr: ...
(for a given rule group, "name:" and "rules:" must be indented at the same
level; and each rule is a bullet underneath that)
Note that you don't have to indent sequences beyond the parent key, so the
following is also accepted:
groups:
- name: MiscellaneousRules
* rules:*
- alert: PrometheusAllTargetsMissing
expr: ....
> What I am trying to undertstand is exactly what is being mapped to where.
A "map" in YAML (and in Go) is what you might call a "dict" in Python or a
"Hash" in Ruby or Perl: a mapping from key to value.
In YAML, a map can look like this:
key1: value1
key2: value2
key3: value3
although it can also be represented more compactly as
{ key1: value1, key2: value2, key3: value3 }
There are also "sequences" (= "list" or "array" in other languages). Those
are
- value1
- value2
- value3
or
[ value1, value2, value3 ]
Both sequences and maps can contain other sequences and/or maps, by nesting.
The error message is saying you tried to put a map value in a place where
one was not expected by prometheus. That is: a file can be structurally
valid YAML, but still invalid input to prometheus, because it has the wrong
types of object in the wrong places.
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/daeee509-c0be-47d7-a48d-701a41616ac5o%40googlegroups.com.