Skip to content

Commit

Permalink
fix issue that metrics input v2 not started
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjiazhu committed Sep 24, 2024
1 parent e76377e commit 66129e5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pluginmanager/plugin_runner_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,16 @@ func (p *pluginv2Runner) runInput() {

func (p *pluginv2Runner) runMetricInput(control *pipeline.AsyncControl) {
for _, t := range p.TimerRunner {
if plugin, ok := t.state.(*MetricWrapperV2); ok {
if plugin, ok := t.state.(pipeline.MetricInputV2); ok {
metric := plugin
timer := t
control.Run(func(cc *pipeline.AsyncControl) {
timer.Run(func(state interface{}) error {
return metric.Read(p.InputPipeContext)
}, cc)
})
} else {
logger.Error(p.LogstoreConfig.Context.GetRuntimeContext(), "METRIC_INPUT_V2_START_FAILURE", "type assertion", "failure")
}
}
}
Expand Down

0 comments on commit 66129e5

Please sign in to comment.