Groups
Groups
Sign in
Groups
Groups
Prometheus Users
Conversations
About
Send feedback
Help
error orccured during parsing service discovery file.
39 views
Skip to first unread message
ㅁㄴ
unread,
May 21, 2020, 9:52:30 PM
5/21/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prometheus Users
- prometheus.yml
global:
scrape_interval: 3s
evaluation_interval: 3s
rule_files:
# - "first.rules"
# - "second.rules"
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
- job_name: node_exporter
file_sd_configs:
- files:
- '/Users/skynet/prometheus/server/sd.yml'
- sd.yml
targets:
- "localhost:9100/metrics"
labels:
- ensemble: ["
127.0.0.1:2181
"]
- service_code: "test"
- node: ["
127.0.0.1:11211
", "
127.0.0.1:11212
"]
when I run prometheus, this error is occured.
msg="Error reading file" path=/Users/skynet/prometheus/server/sd.yml err="yaml: unmarshal errors:\n line 1: cannot unmarshal !!map into []*targetgroup.Group"
How can i fix?
Brian Candler
unread,
May 22, 2020, 1:59:48 AM
5/22/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prometheus Users
Firstly, the top level of the targets file must be a list, which means "bullet points" required at the top:
- targets: ...
labels: ...
- targets: ...
labels: ...
Secondly, the labels themselves can only be strings, not lists.
- targets:
- "localhost:9100/metrics"
labels:
- ensemble: "
127.0.0.1:2181
"
- service_code: "test"
- node: "
127.0.0.1:11211
"
You can't have two values for the label "node".
Reply all
Reply to author
Forward
0 new messages