Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
support for streaming plugins:
Browse files Browse the repository at this point in the history
- In getMetricsAndCollectors will get from both collectors and streaming-collectors
- Fix in StreamMetrics()
  • Loading branch information
kjlyon committed Jul 19, 2017
1 parent a31e1d5 commit ddf8fb7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,8 @@ func (p *pluginControl) getMetricsAndCollectors(requested []core.RequestedMetric
mt.config = cfg

// apply the defaults from the global (plugin) config
cfgNode := p.pluginManager.GetPluginConfig().getPluginConfigDataNode(core.CollectorPluginType, mt.Plugin.Name(), mt.Plugin.Version())
plType, _ := core.ToPluginType(mt.Plugin.TypeName())
cfgNode := p.pluginManager.GetPluginConfig().getPluginConfigDataNode(plType, mt.Plugin.Name(), mt.Plugin.Version())
cfg.ApplyDefaults(cfgNode.Table())

// apply defaults to the metric that may be present in the plugins
Expand Down Expand Up @@ -1111,7 +1112,7 @@ func (p *pluginControl) StreamMetrics(
if mt.Config() != nil {
mt.Config().ReverseMergeInPlace(
p.Config.Plugins.getPluginConfigDataNode(
core.CollectorPluginType,
core.StreamingCollectorPluginType,
pmt.plugin.Name(),
pmt.plugin.Version()))
}
Expand Down

0 comments on commit ddf8fb7

Please sign in to comment.