Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sinker): add activity in metric push in sinker, on change from idle/unknown to active #2221

Merged
merged 5 commits into from
Feb 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion sinker/otel/bridgeservice/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@ func (bs *SinkerOtelBridgeService) NotifyActiveSink(ctx context.Context, mfOwner
bs.logger.Error("unable to retrieve the sink config", zap.Error(err))
return err
}
if cfgRepo.State == config.Idle || cfgRepo.State == config.Unknown || cfgRepo.State == config.Active {

// only updates sink state if status Idle or Unknown
if cfgRepo.State == config.Idle || cfgRepo.State == config.Unknown {
cfgRepo.LastRemoteWrite = time.Now()
err = cfgRepo.State.SetFromString(newState)
if err != nil {
bs.logger.Error("unable to set state", zap.String("new_state", newState), zap.Error(err))
return err
}
err = bs.sinkerCache.AddActivity(mfOwnerId, sinkId)
if err != nil {
bs.logger.Error("error during update last remote write", zap.String("sinkId", sinkId), zap.Error(err))
return err
}
err = bs.sinkerCache.DeployCollector(ctx, cfgRepo)
if err != nil {
bs.logger.Error("error during update sink cache", zap.String("sinkId", sinkId), zap.Error(err))
Expand Down