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

Commit

Permalink
Fix #674: Merge global config into plugin config for ProcessMetrics a…
Browse files Browse the repository at this point in the history
…nd PublishMetrics
  • Loading branch information
geauxvirtual committed Jan 22, 2016
1 parent 8011bb4 commit 6a8301e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -896,20 +896,20 @@ func (p *pluginControl) CollectMetrics(metricTypes []core.Metric, deadline time.
func (p *pluginControl) PublishMetrics(contentType string, content []byte, pluginName string, pluginVersion int, config map[string]ctypes.ConfigValue) []error {
// merge global plugin config into the config for this request
cfg := p.Config.Plugins.getPluginConfigDataNode(core.PublisherPluginType, pluginName, pluginVersion).Table()
for k, v := range config {
cfg[k] = v
for k, v := range cfg {
config[k] = v
}
return p.pluginRunner.AvailablePlugins().publishMetrics(contentType, content, pluginName, pluginVersion, cfg)
return p.pluginRunner.AvailablePlugins().publishMetrics(contentType, content, pluginName, pluginVersion, config)
}

// ProcessMetrics
func (p *pluginControl) ProcessMetrics(contentType string, content []byte, pluginName string, pluginVersion int, config map[string]ctypes.ConfigValue) (string, []byte, []error) {
// merge global plugin config into the config for this request
cfg := p.Config.Plugins.getPluginConfigDataNode(core.ProcessorPluginType, pluginName, pluginVersion).Table()
for k, v := range config {
cfg[k] = v
for k, v := range cfg {
config[k] = v
}
return p.pluginRunner.AvailablePlugins().processMetrics(contentType, content, pluginName, pluginVersion, cfg)
return p.pluginRunner.AvailablePlugins().processMetrics(contentType, content, pluginName, pluginVersion, config)
}

// GetPluginContentTypes returns accepted and returned content types for the
Expand Down

0 comments on commit 6a8301e

Please sign in to comment.