Improved OBO logging and added OBO observability to SESSION_CONTEXT#3192
Open
anushakolan wants to merge 3 commits intomainfrom
Open
Improved OBO logging and added OBO observability to SESSION_CONTEXT#3192anushakolan wants to merge 3 commits intomainfrom
anushakolan wants to merge 3 commits intomainfrom
Conversation
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves observability for user-delegated (OBO) authentication by enhancing OBO token acquisition logging and by adding OpenTelemetry correlation + OBO identity details into SQL Server SESSION_CONTEXT when set-session-context is enabled.
Changes:
- Add structured OBO token logging in
OboSqlTokenProviderwith event types andtraceIdcorrelation. - Extend
MsSqlQueryExecutor.GetSessionParamsQueryto setdab.trace_id,dab.span_id,dab.auth_type,dab.user_id, anddab.tenant_idinSESSION_CONTEXT. - Add unit tests validating inclusion/exclusion of correlation IDs and OBO observability session-context values.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Service.Tests/UnitTests/SqlQueryExecutorUnitTests.cs | Adds unit tests for new session-context observability values and Activity correlation behavior. |
| src/Core/Resolvers/OboSqlTokenProvider.cs | Adds structured log fields (EventType + traceId) for OBO validation/cache/acquisition events. |
| src/Core/Resolvers/MsSqlQueryExecutor.cs | Writes OpenTelemetry correlation IDs and OBO identity markers into SQL Server SESSION_CONTEXT. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
Closes #3125
What is this change?
Added the following values to SQL Server SESSION_CONTEXT when set-session-context is enabled:
How was this tested?
Unit Tests
Manual E2E Testing