【发布时间】:2020-10-06 09:38:44
【问题描述】:
我已按照here 的描述添加了 JVM 监控插件
这一切都很好,我可以,但现在我想添加更多 JMX 指标。例如MemoryPool 特定计数器
所以我把这个配置添加到/opt/stackdriver/collectd/etc/collectd.d/jvm-sun-hotspot.conf
<MBean "jvm_localhost_MemoryPool">
ObjectName "java.lang:type=MemoryPool,name=*"
InstanceFrom "name"
<Value>
Type "gauge"
InstancePrefix "memorypool-usage_used"
Table false
Attribute "Usage.used"
</Value>
</MBean>
和
Collect "jvm_localhost_MemoryPool"
在Connection 部分
这似乎是有效的 collectd 配置,但是当它被发送到 Stackdriver/Google Cloud Monitoring 时,它被拒绝了。
012 {#012 "index": 261,#012 "valueErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported
collectd id: plugin: \"jvm\" type: \"gauge\" type_instance: \"memorypool-usagecommitted\""#012 }#012 }#012 ]#012 },#012 {#012
"index": 262,#012 "valueErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd id: plug
in: \"jvm\" type: \"gauge\" type_instance: \"memorypool-usageinit\""#012 }#012 }#012 ]#012 },#012 {#012 "index": 263,#012
"valueErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd id: plugin: \"jvm\" type: \"gau
ge\" type_instance: \"memorypool-usagemax\""#012 }#012 }#012 ]#012 },#012 {#012 "index": 264,#012 "valueErrors": [#012
{#012 "error": {#012 "code": 3,#012 "message": "Unsupported
现在据我了解,它需要作为自定义指标添加,但this document 建议它将自动创建。 事实上,当我查看builtin jvm metrics 的列表时,我看不到它们如何映射到 collectd 配置中的现有列表。
例如os-open_fd_count 是如何映射到 os/open_files 的?
查看 Google 的 custom collectd implementation 发送的实际 api 请求会很有帮助,但我看不到增加日志记录的方法。
我可以从 this post 看到,这可能是我想要查看的自定义指标,但我该如何在 collectd 配置中做到这一点?
我试过了
InstancePrefix "custom.googleapis.com/memorypool-usage"
但仍然没有快乐。
以前有没有人这样做过,或者可以就我做错了什么提供任何建议?
【问题讨论】:
标签: stackdriver google-cloud-stackdriver collectd google-cloud-monitoring