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: Add tracing to team service #86999

Merged
merged 4 commits into from Apr 29, 2024
Merged

Chore: Add tracing to team service #86999

merged 4 commits into from Apr 29, 2024

Conversation

IevaVasiljeva
Copy link
Contributor

@IevaVasiljeva IevaVasiljeva commented Apr 26, 2024

What is this feature?

Adds tracing to team service.

Enterprise PR: https://github.com/grafana/grafana-enterprise/pull/6546

Related to https://github.com/grafana/identity-access-team/issues/601

@IevaVasiljeva IevaVasiljeva added no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Apr 26, 2024
@IevaVasiljeva IevaVasiljeva added this to the 11.1.x milestone Apr 26, 2024
@IevaVasiljeva IevaVasiljeva requested review from a team as code owners April 26, 2024 14:51
Copy link
Contributor

@kalleep kalleep left a comment

Choose a reason for hiding this comment

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

Nice 🚀

}

func (s *Service) CreateTeam(name, email string, orgID int64) (team.Team, error) {
_, span := s.tracer.Start(context.Background(), "team.CreateTeam", trace.WithAttributes(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this and the IsTeamMember functions would create a new root span (because the context is not propagated). I'm not 100% sure, but the current context should be passed to those functions to have proper tracing. Wdyt?

It can be also handled in a follow up PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing it out. I was putting it off as CreateTeam is used in soooo many tests but otherwise only from the team creation API function, so it felt like a lot of work for no benefit (as no useful context would be propagated for any non-test code execution path). But now that I see the amount of test changes that are required for ProvideService anyway, I might as well add a few more 😄

@IevaVasiljeva IevaVasiljeva merged commit cee713e into main Apr 29, 2024
12 checks passed
@IevaVasiljeva IevaVasiljeva deleted the ieva/team-tracing branch April 29, 2024 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants