-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Telemetry #3: Implement Telemetry in msal-node #1921
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. You might be able to avoid some code duplication by creating an acquire token common API that takes in a BaseClient and ClientConfiguration and calls acquireToken, logs, and cachesFailedRequests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to add the new telemetry CacheSchemaType
to the Node Storage class
…AD/microsoft-authentication-library-for-js into msal-node-MSER-Telemetry
…AD/microsoft-authentication-library-for-js into msal-node-MSER-Telemetry
…tion-library-for-js into msal-node-MSER-Telemetry
…zureAD/microsoft-authentication-library-for-js into msal-node-MSER-Telemetry
…zureAD/microsoft-authentication-library-for-js into msal-node-MSER-Telemetry
…ft-authentication-library-for-js into msal-node-MSER-Telemetry
…osoft-authentication-library-for-js into msal-node-MSER-Telemetry
…zureAD/microsoft-authentication-library-for-js into msal-node-MSER-Telemetry
…zureAD/microsoft-authentication-library-for-js into msal-node-MSER-Telemetry
refreshTokenClientConfig | ||
); | ||
return refreshTokenClient.acquireToken(validRequest); | ||
} catch (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure the catch is always telemetry initialization error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not. The catch is for any error that occurs in the flow so that Telemetry can properly cache it
lib/msal-node/src/utils/Constants.ts
Outdated
acquireTokenByCode = 871, | ||
acquireTokenByRefreshToken = 872, | ||
acquireTokenByDeviceCode = 671 | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are they no API ids for confidential clients? Are we adding it later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the callout. Confidential Client wasn't built out yet when this PR was first put up. Will add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two comments, approved.
…tion-library-for-js into msal-node-MSER-Telemetry
This PR builds on PR #1917 to enable sending Telemetry data to eSTS via 2 extra headers on all /token calls
Responsibilities of each library are:
msal-common
:TelemetryManager
classSilentFlowClient
increments cache hit counter each time tokens are returned from the cachemsal-browser
,msal-node
, etc:TelemetryManager
withapiId
,correlationId
, cache implementation,forceRefresh
value (silent calls only)authCodeClient
andsilentFlowClient