我正在GCP中运行 Couchdb 2.1.1 ,并希望在Stackdriver中设置对CouchDB集群的监视。 CouchDB的现有 Stackdriver 插件不再起作用(已弃用)。
我已经尝试了多种方法来尝试解决此问题,包括尝试更新不建议使用的配置文件,但是我在系统日志中会得到我不确定如何解释的错误。
下面是一个配置文件,我仅用于使一个统计信息出现在Stackdriver中:
# This is the monitoring configuration for CouchDB.
# Look for COUCHDB_HOST and COUCHDB_PORT to adjust your configuration file.
LoadPlugin curl_json
<Plugin "curl_json">
<URL "http://localhost:5986/_stats">
Instance "couchdb"
User "foo"
Password "XXX"
<Key "couchdb/httpd/requests/value">
Type "counter"
</Key>
</URL>
</Plugin>
LoadPlugin match_regex
LoadPlugin target_set
LoadPlugin target_replace
<Chain "curl_json_couchdb">
<Rule "rewrite_curl_json_to_couchdb">
<Match regex>
Plugin "^curl_json$"
PluginInstance "^couchdb.*$"
</Match>
<Target "replace">
PluginInstance "^couchdb" ""
</Target>
<Target "set">
Plugin "couchdb"
</Target>
</Rule>
<Rule "rewrite_empty_plugininstance">
<Match regex>
PluginInstance "^$"
</Match>
<Target "set">
PluginInstance "localhost"
</Target>
</Rule>
<Rule "go_back">
Target "return"
</Rule>
</Chain>
<Chain "PreCache">
<Rule "jump_to_curl_json_couchdb">
<Target "jump">
Chain "curl_json_couchdb"
</Target>
</Rule>
</Chain>
PreCacheChain "PreCache"
这是我在系统日志中看到的错误:
systemd[1]: Starting LSB: start and stop Stackdriver Agent...
stackdriver-agent[14682]: mesg: ttyname failed: Inappropriate ioctl for device
stackdriver-agent[14682]: Starting Stackdriver metrics collection agent: stackdriver-agentoption = Interval; value = 60.000000;
stackdriver-agent[14682]: option = Hostname; value = ;
stackdriver-agent[14682]: option = FQDNLookup; value = false;
stackdriver-agent[14682]: Created new plugin context.
collectd[14701]: plugin_load: plugin "syslog" successfully loaded.
collectd[14701]: type = syslog, key = LogLevel, value = info
collectd[14701]: plugin_load: plugin "df" successfully loaded.
collectd[14701]: plugin_load: plugin "cpu" successfully loaded.
collectd[14701]: plugin_load: plugin "swap" successfully loaded.
collectd[14701]: plugin_load: plugin "interface" successfully loaded.
collectd[14701]: plugin_load: plugin "disk" successfully loaded.
collectd[14701]: plugin_load: plugin "load" successfully loaded.
collectd[14701]: plugin_load: plugin "memory" successfully loaded.
collectd[14701]: plugin_load: plugin "processes" successfully loaded.
collectd[14701]: plugin_load: plugin "tcpconns" successfully loaded.
collectd[14701]: write_gcm: inside module_register for stackdriver_agent/5.5.2-384.stretch
collectd[14701]: plugin_load: plugin "write_gcm" successfully loaded.
collectd[14701]: plugin_load: plugin "match_regex" successfully loaded.
collectd[14701]: plugin_load: plugin "match_throttle_metadata_keys" successfully loaded.
collectd[14701]: plugin_load: plugin "stackdriver_agent" successfully loaded.
collectd[14701]: plugin_load: plugin "exec" successfully loaded.
collectd[14701]: plugin_load: plugin "aggregation" successfully loaded.
collectd[14701]: plugin_load: plugin "curl_json" successfully loaded.
collectd[14701]: plugin_load: plugin "target_set" successfully loaded.
collectd[14701]: plugin_load: plugin "target_replace" successfully loaded.
stackdriver-agent[14682]: option = PIDFile; value = /var/run/stackdriver-agent.pid;
stackdriver-agent[14682]: option = Interval; value = 60.000000;
stackdriver-agent[14682]: option = Hostname; value = ;
stackdriver-agent[14682]: option = FQDNLookup; value = false;
stackdriver-agent[14682]: Created new plugin context.
collectd[14707]: plugin_load: plugin "syslog" successfully loaded.
collectd[14707]: type = syslog, key = LogLevel, value = info
collectd[14707]: plugin_load: plugin "df" successfully loaded.
collectd[14707]: plugin_load: plugin "cpu" successfully loaded.
collectd[14707]: plugin_load: plugin "swap" successfully loaded.
collectd[14707]: plugin_load: plugin "interface" successfully loaded.
collectd[14707]: plugin_load: plugin "disk" successfully loaded.
collectd[14707]: plugin_load: plugin "load" successfully loaded.
collectd[14707]: plugin_load: plugin "memory" successfully loaded.
collectd[14707]: plugin_load: plugin "processes" successfully loaded.
collectd[14707]: plugin_load: plugin "tcpconns" successfully loaded.
collectd[14707]: write_gcm: inside module_register for stackdriver_agent/5.5.2-384.stretch
collectd[14707]: plugin_load: plugin "write_gcm" successfully loaded.
collectd[14707]: plugin_load: plugin "match_regex" successfully loaded.
collectd[14707]: plugin_load: plugin "match_throttle_metadata_keys" successfully loaded.
collectd[14707]: plugin_load: plugin "stackdriver_agent" successfully loaded.
collectd[14707]: plugin_load: plugin "exec" successfully loaded.
collectd[14707]: plugin_load: plugin "aggregation" successfully loaded.
collectd[14707]: plugin_load: plugin "curl_json" successfully loaded.
collectd[14707]: plugin_load: plugin "target_set" successfully loaded.
collectd[14707]: plugin_load: plugin "target_replace" successfully loaded.
stackdriver-agent[14682]: .
systemd[1]: Started LSB: start and stop Stackdriver Agent.
collectd[14708]: Initialization complete, entering read-loop.
collectd[14708]: tcpconns plugin: Reading from netlink succeeded. Will use the netlink method from now on.
collectd[14708]: write_gcm: Asking metadata server for auth token
collectd[14708]: write_gcm: Server response (CollectdTimeseriesRequest) contains errors:#012{#012 "payloadErrors": [#012 {#012 "index": 369,#012 "valueErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd id: plugin: \"couchdb\" type: \"counter\" type_instance: \"requests-value\""#012 }#012 }#012 ]#012 }#012 ]#012}
collectd[14708]: write_gcm: Server response (CollectdTimeseriesRequest) contains errors:#012{#012 "payloadErrors": [#012 {#012 "index": 801,#012 "valueErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd id: plugin: \"couchdb\" type: \"counter\" type_instance: \"requests-value\""#012 }#012 }#012 ]#012 }#012 ]#012}
collectd[14708]: write_gcm: Server response (CollectdTimeseriesRequest) contains errors:#012{#012 "payloadErrors": [#012 {#012 "index": 809,#012 "valueErrors": [#012 {#012 "error": {#012 "code": 3,#012 "message": "Unsupported collectd id: plugin: \"couchdb\" type: \"counter\" type_instance: \"requests-value\""#012 }#012 }#012 ]#012 }#012 ]#012}
有人可以帮忙弄清楚为什么这个配置文件不起作用吗?