Skip to content

Commit 3b749ad

Browse files
committed
using common span
1 parent 0afa169 commit 3b749ad

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

common4j/src/main/com/microsoft/identity/common/java/opentelemetry/SpanName.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,5 @@ public enum SpanName {
8080
*/
8181
EcsFlightsFetchConfigs,
8282
DevicePopMintSignedAccessToken,
83-
DevicePopDecrypt,
84-
DevicePopEncrypt
83+
DevicePopCryptoOperation
8584
}

common4j/src/main/com/microsoft/identity/common/java/platform/AbstractDevicePopManager.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import com.microsoft.identity.common.java.opentelemetry.OTelUtility;
6262
import com.microsoft.identity.common.java.opentelemetry.SpanExtension;
6363
import com.microsoft.identity.common.java.opentelemetry.SpanName;
64+
import com.microsoft.identity.common.java.opentelemetry.AttributeName;
6465
import com.microsoft.identity.common.java.util.StringUtil;
6566
import com.microsoft.identity.common.java.util.TaskCompletedCallbackWithError;
6667
import com.nimbusds.jose.JOSEException;
@@ -202,7 +203,7 @@ protected static final class CertificateProperties {
202203

203204
/**
204205
* Properties embedded in the SignedHttpRequest.
205-
* Roughly conforms to: https://tools.ietf.org/html/draft-ietf-oauth-signed-http-request-03
206+
* Roughly conforms to: <a href="https://tools.ietf.org/html/draft-ietf-oauth-signed-http-request-03">...</a>
206207
*/
207208
private static final class SignedHttpRequestJwtClaims {
208209

@@ -590,7 +591,8 @@ public String encrypt(@NonNull final Cipher cipher,
590591
@Override
591592
public byte[] encrypt(@NonNull final Cipher cipher, @NonNull final byte[] plaintext) throws ClientException {
592593
final String methodTag = TAG + ":encrypt";
593-
final Span span = OTelUtility.createSpan(SpanName.DevicePopEncrypt.name());
594+
final Span span = OTelUtility.createSpan(SpanName.DevicePopCryptoOperation.name());
595+
span.setAttribute(AttributeName.crypto_operation.name(), "encrypt");
594596
try (final Scope scope = SpanExtension.makeCurrentSpan(span)) {
595597
// Load our key material
596598
final KeyStore.PrivateKeyEntry privateKeyEntry = mKeyManager.getEntry();
@@ -654,7 +656,8 @@ public String decrypt(@NonNull final Cipher cipher,
654656
@Override
655657
public byte[] decrypt(@NonNull Cipher cipher, byte[] ciphertext) throws ClientException {
656658
final String methodTag = TAG + ":decrypt";
657-
final Span span = OTelUtility.createSpan(SpanName.DevicePopDecrypt.name());
659+
final Span span = OTelUtility.createSpan(SpanName.DevicePopCryptoOperation.name());
660+
span.setAttribute(AttributeName.crypto_operation.name(), "decrypt");
658661
try (final Scope scope = SpanExtension.makeCurrentSpan(span)) {
659662
// Load our key material
660663
final KeyStore.PrivateKeyEntry privateKeyEntry = mKeyManager.getEntry();

0 commit comments

Comments
 (0)