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

Add tracing spans for rules API #4178

Merged

Conversation

toshi1127
Copy link
Contributor

Signed-off-by: Matsumoto toshi.matsumoto.3n@gmail.com

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Add tracing for federated rules API.

Closes #4131

Verification

  • make build
  • make test-local

Signed-off-by: Matsumoto <toshi.matsumoto.3n@gmail.com>
kakkoyun
kakkoyun previously approved these changes May 5, 2021
Copy link
Member

@kakkoyun kakkoyun left a comment

Choose a reason for hiding this comment

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

LGTM 🥇 Thanks for your contribution.
Great, clean PR.

Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Overall it looks good. But one thing I am not sure about is that it is too fine-grained, which might create a lot of spans for a single Rules request.
I am not very familiar with trace instrumentation, is there a best practice about it?

pkg/rules/manager.go Outdated Show resolved Hide resolved
Signed-off-by: Matsumoto <toshi.matsumoto.3n@gmail.com>
@toshi1127
Copy link
Contributor Author

I don't know the best practices either, but...
I think adding trace spans for each element might be useful to determine unnecessary trace spans in the future.

bwplotka
bwplotka previously approved these changes May 7, 2021
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Thanks a lot! Just one nit (:

I think this amount is fine.

Comment on lines 394 to 395
func (m *Manager) Rules(r *rulespb.RulesRequest, s rulespb.Rules_RulesServer) error {
var err error
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
func (m *Manager) Rules(r *rulespb.RulesRequest, s rulespb.Rules_RulesServer) error {
var err error
func (m *Manager) Rules(r *rulespb.RulesRequest, s rulespb.Rules_RulesServer) (err error) {

We can simplify (:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've finished fixing it.

@yeya24
Copy link
Contributor

yeya24 commented May 7, 2021

Hi @toshi1127, please rebase on main then we can get CI fixed.

@yeya24 yeya24 mentioned this pull request May 7, 2021
2 tasks
Signed-off-by: Matsumoto <toshi.matsumoto.3n@gmail.com>
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

LGTM!

@kakkoyun kakkoyun merged commit 58dce29 into thanos-io:main May 17, 2021
@bill3tt bill3tt mentioned this pull request Jun 3, 2021
2 tasks
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.

Add tracing for federated rules API
4 participants