net_response 这个组件这样写正确吗,

Viewed 123

上传中......[[instances]]
这样写配置文件会报错
failed to load configuration of plugin: local.net_response error: toml: line 9 (last key "instances.targets"): expected a comma (',') or array terminator (']'), but got '"'

[[instances]]
targets = [
"172.19.201.2:3306"
]
labels = { name="mysql" }
[[instances]]
targets = [
"172.19.201.2:6379"
]
labels = { name="redis" }
[[instances]]
targets = [
"172.19.201.3:8012"
]
labels = { name="weixin" }
4 Answers

看报错是期望每个targets后面加个逗号

引用
[[instances]]
targets = [
"172.19.201.2:3306",
]
labels = { name="mysql" }
[[instances]]
targets = [
"172.19.201.2:6379",
]
labels = { name="redis" }
[[instances]]
targets = [
"172.19.201.3:8012",
]
labels = { name="weixin" }

1、是不支持多个instances加标签的写法吗

一定不是

不信,骗人的吧

确实添加,后正常获取到数据了

image.png

不加逗号,也可以。原封不动拷贝的你的内容,好使。所以我说你骗人。

我targes中写了多个地址 O(∩_∩)O

果然是个骗子,贴的信息和自己测试的内容不同 😂

我的锅,没贴全,嘿嘿嘿