Skip to content

Added telemetry to capture encrypt and decrypt operations in device PoP scenarios, Fixes AB#3468126#2844

Merged
somalaya merged 6 commits into
devfrom
somalaya/addTelemetry
Dec 26, 2025
Merged

Added telemetry to capture encrypt and decrypt operations in device PoP scenarios, Fixes AB#3468126#2844
somalaya merged 6 commits into
devfrom
somalaya/addTelemetry

Conversation

@somalaya
Copy link
Copy Markdown
Contributor

@somalaya somalaya commented Dec 22, 2025

What : Adding telemetry to capture Encrypt and Decrypt crypto operations in device PoP cases

Why : We think these operations are not invoked at all and we marked it as deprecated in previous PRs. But to remove them completely, we need the telemetry to check if they are for sure not being invoked.

Testing : Verified that the spans are getting created correctly.

Fixes AB#3468126

@github-actions
Copy link
Copy Markdown

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

@somalaya somalaya marked this pull request as ready for review December 22, 2025 21:05
@somalaya somalaya requested a review from a team as a code owner December 22, 2025 21:05
Copilot AI review requested due to automatic review settings December 22, 2025 21:05
@somalaya somalaya changed the title Added telemetry to capture encrypt and decrypt operations in device PoP scenarios Added telemetry to capture encrypt and decrypt operations in device PoP scenarios, Fixes AB#3468126 Dec 22, 2025
@github-actions
Copy link
Copy Markdown

✅ Work item link check complete. Description contains link AB#3468126 to an Azure Boards work item.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds telemetry instrumentation to the encrypt and decrypt operations in AbstractDevicePopManager to track usage of methods marked as deprecated. The telemetry will help determine whether these cryptographic operations are still being invoked before complete removal.

Key changes:

  • Added new DevicePopCryptoOperation span name to the telemetry enum
  • Instrumented encrypt and decrypt methods with OpenTelemetry spans that track operation type and status
  • Refactored exception handling by consolidating error code mapping into a shared helper method

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
common4j/src/main/com/microsoft/identity/common/java/opentelemetry/SpanName.java Added DevicePopCryptoOperation enum value for tracking device PoP crypto operations
common4j/src/main/com/microsoft/identity/common/java/platform/AbstractDevicePopManager.java Added telemetry spans to encrypt/decrypt methods using existing crypto_operation attribute; refactored exception handling into mapCryptoExceptionToErrorCode helper method; also fixed a bug where NoSuchPaddingException was incorrectly mapped to NO_SUCH_ALGORITHM instead of NO_SUCH_PADDING in the decrypt method

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@AzureAD AzureAD deleted a comment from Copilot AI Dec 22, 2025
@somalaya somalaya force-pushed the somalaya/addTelemetry branch from 798d56a to 804f98a Compare December 23, 2025 17:34
@somalaya somalaya requested a review from a team as a code owner December 23, 2025 17:34
@somalaya somalaya force-pushed the somalaya/addTelemetry branch from 804f98a to 7d2e957 Compare December 26, 2025 17:42
@somalaya somalaya merged commit 7ea5c92 into dev Dec 26, 2025
23 checks passed
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.

4 participants