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

tenant: add tenant to trace #862

Merged
merged 3 commits into from
Nov 21, 2024
Merged

tenant: add tenant to trace #862

merged 3 commits into from
Nov 21, 2024

Conversation

stefanhengl
Copy link
Member

@stefanhengl stefanhengl commented Nov 21, 2024

This adds the tenant ID to the trace. I also move the pprof logging from FromContext to the higher level typeRepoSearcher. The number of events was too high, because we logged missing tenants per document.

I also fixed a bug where pprof logging didn't work at all, because we read the tenant enforcemnt ENV after we set the pprof profile, so the profile was always nil.

Test plan:
Checked locally that tenants show up in the traces and "missing_tenant" shows up as pprof profile.

image image

This adds the tenant ID to the trace. I also move the pprof logging from
FromContext to a higher level searcher, because the number of events was
too high, because we logged missing tenants per document.

Note: Before, pprof logging didn't work at all, because we read the
tenant enforcemnt ENV after we set the pprof profile, so the profile
was always nil.

Test plan:
Checked locally that tenants show up in the traces and
zoekt_missing_tenant shows up as pprof profile.
internal/tenant/internal/enforcement/enforcement.go Outdated Show resolved Hide resolved
internal/tenant/context.go Outdated Show resolved Hide resolved
@stefanhengl stefanhengl merged commit c1295f9 into main Nov 21, 2024
8 checks passed
@stefanhengl stefanhengl deleted the sh/mt/better-logging branch November 21, 2024 11:20
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.

2 participants