Skip to content

For proactive refresh log error to otel and change token source to IDP#4561

Merged
neha-bhargava merged 21 commits into
mainfrom
nebharg/4492
Feb 22, 2024
Merged

For proactive refresh log error to otel and change token source to IDP#4561
neha-bhargava merged 21 commits into
mainfrom
nebharg/4492

Conversation

@neha-bhargava

@neha-bhargava neha-bhargava commented Jan 23, 2024

Copy link
Copy Markdown
Contributor

Fixes #4492

Changes proposed in this request
Add telemetry for background request for proactive token refresh.
Log error to otel if the background process fails.
Added tags ApiId and IsProactiveRefresh to MsalFailure counter
Added tag CacheRefreshReason to histograms MsalTotalDuration, MsalDurationInL1CacheInUs, MsalDurationInL2Cache

Testing
Added unit tests and integration tests

Performance impact

Documentation

  • All relevant documentation is updated.

Comment thread src/client/Microsoft.Identity.Client/AuthenticationResultMetadata.cs Outdated
Comment thread src/client/Microsoft.Identity.Client/Internal/Requests/SilentRequestHelper.cs Outdated
Comment thread tests/Microsoft.Identity.Test.Unit/TelemetryTests/OTelInstrumentationTests.cs Outdated
Comment thread tests/Microsoft.Identity.Test.Unit/TelemetryTests/OTelInstrumentationTests.cs Outdated
@trwalke

trwalke commented Jan 26, 2024

Copy link
Copy Markdown
Member

Isn't this going to skew the cache hit ratio metrics resulting in potential customer concern for those who monitor this? Also, while there is a token refresh, the token returned to the user is not the one acquired to from the endpoint. Are we sure this is the right thing to change?

@neha-bhargava

Copy link
Copy Markdown
Contributor Author

Isn't this going to skew the cache hit ratio metrics resulting in potential customer concern for those who monitor this? Also, while there is a token refresh, the token returned to the user is not the one acquired to from the endpoint. Are we sure this is the right thing to change?

Yes, I will be changing the token source back to cache, we should be using both token source and cache refresh reason when generating metrics. Thanks

@bgavrilMS

Copy link
Copy Markdown
Member

Hi @neha-bhargava - this has been opened for quite a while. Would you like the team to review again?

@pmaytak pmaytak self-requested a review February 15, 2024 21:09
Comment thread src/client/Microsoft.Identity.Client/Internal/Requests/RequestBase.cs Outdated
Comment thread tests/Microsoft.Identity.Test.Unit/TelemetryTests/OTelInstrumentationTests.cs Outdated
@neha-bhargava neha-bhargava merged commit 13a7778 into main Feb 22, 2024
@neha-bhargava neha-bhargava deleted the nebharg/4492 branch February 22, 2024 20:31
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.

In case of proactive token refresh record telemetry for the background process that refreshes the token.

5 participants