Fix incorrect instance lookups in plugins

Fix mistaken lookups missing the instance part, or trying to get the id
from the removed instance.id property.
This commit is contained in:
Hornwitser committed 2020-03-13 22:46:17 +01:00
1 parent 1e6b807ae3
commit 6f22942cc5
3 files changed
+7 -4

No files matched your search

+2 -2
View File
@@ -226,7 +226,7 @@ plugin you listen for an event named ipc-channel_name in order to get
data sent by `send_json`. For example in the plugin code:
async init() {
this.server.on('ipc-my_plugin_foo', content =>
this.instance.server.on('ipc-my_plugin_foo', content =>
this.handleFoo(content).catch(err => console.log(
"Error handling foo:", foo
))
@@ -478,7 +478,7 @@ accordingly, for example:
);
// Somewhere in the instance plugin code
barMetric.labels(String(this.config.id)).set(someValue);
barMetric.labels(String(this.instance.config.get("instance.id"))).set(someValue);
Metrics are automatically registered to the default registry, and this
default registry is automatically polled by the master server on slaves.