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

chore: Remove the Metrics name dedup #22

Merged
merged 3 commits into from
Mar 28, 2023
Merged

chore: Remove the Metrics name dedup #22

merged 3 commits into from
Mar 28, 2023

Conversation

sarabala1979
Copy link
Contributor

No description provided.

Signed-off-by: Saravanan Balasubramanian <[email protected]>
Signed-off-by: Saravanan Balasubramanian <[email protected]>
@sarabala1979
Copy link
Contributor Author

I created the issue to add test case for the Prometheus push. We need to find the test library to test Prometheus abstraction. we need to refactor the code

for _, payload := range msgPayloads {
if _, ok := keys[payload.Name]; !ok {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name level dedub was removed

return err
}
p.metrics.IncreaseTotalSuccess()
p.logger.Debug("Pushing Payload ", zap.Any("payload", payload))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debugw

})
appName := payload.Labels["app"]
p.metrics.IncreaseAnomalyGenerated(payload.Namespace, appName, payload.Name)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logically, missing default?

Signed-off-by: Saravanan Balasubramanian <[email protected]>
@sarabala1979 sarabala1979 merged commit 423fd2f into main Mar 28, 2023
@sarabala1979 sarabala1979 deleted the rm-dedu branch March 28, 2023 22:26
}
p.metrics.IncreaseTotalSuccess()
p.logger.Debug("Pushing Payload ", zap.Any("payload", payload))
pusher, err := p.createPusher(fmt.Sprintf("%s_%s_%s", payload.Namespace, payload.Subsystem, payload.Name))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double check: do we need to create a new pusher for each payload item?

p.logger.Errorw("Unsupported Metrics Type", zap.Any("payload", payload))
return fmt.Errorf("unsupported Metrics Type")
}
err = pusher.Push()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to double check: if a pusher needs an explicit close or such call.

}
p.logger.Infow("Successfully pushed", zap.Any("payload", payload))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this infow() generate too many log lines in regular cases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants