Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
env:
# set this to <repo>:<branch/sha> to build and test with an unreleased
# version of the azure-monitor-opentelemetry-autoconfigure dependency
AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT:
AZURE_MONITOR_OPENTELEMETRY_AUTOCONFIGURE_SNAPSHOT: trask/azure-sdk-for-java:session-id

jobs:
spotless:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void methodEnter(
@Advice.This UserContext userContext, @Advice.Argument(0) String name) {
Span span = VirtualField.find(UserContext.class, Span.class).get(userContext);
if (span != null) {
span.setAttribute("enduser.id", name);
span.setAttribute("enduser.pseudo.id", name);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void setRequestUser() {
.hasAttributesSatisfyingExactly(
equalTo(CodeIncubatingAttributes.CODE_NAMESPACE, "Code"),
equalTo(CodeIncubatingAttributes.CODE_FUNCTION, "setUser"),
equalTo(EnduserIncubatingAttributes.ENDUSER_ID, "myuser")),
equalTo(EnduserIncubatingAttributes.ENDUSER_PSEUDO_ID, "myuser")),
span ->
span.hasName("Code.internalSetUser")
.hasKind(INTERNAL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public String testApi() {
Span.current().setAttribute("myattr1", "myvalue1");
Span.current().setAttribute("myattr2", "myvalue2");
Span.current().setAttribute("enduser.id", "myuser");
Span.current().setAttribute("enduser.pseudo.id", "mypseudo");
Span.current().setAttribute("session.id", "mysession");
Span.current().updateName("myspanname");
return "OK!";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ void testApi() throws Exception {
.isEqualTo("testroleinstance");
assertThat(telemetry.rddEnvelope1.getTags())
.hasEntrySatisfying("ai.internal.sdkVersion", v -> assertThat(v).startsWith("java:3."));
assertThat(telemetry.rddEnvelope1.getTags()).containsEntry("ai.user.id", "myuser");
assertThat(telemetry.rddEnvelope1.getTags()).containsEntry("ai.user.authUserId", "myuser");
assertThat(telemetry.rddEnvelope1.getTags()).containsEntry("ai.user.id", "mypseudo");
assertThat(telemetry.rddEnvelope1.getTags()).containsEntry("ai.session.id", "mysession");

SmokeTestExtension.assertParentChild(
telemetry.rd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ void testApi() throws Exception {

assertThat(telemetry.rdEnvelope.getTags())
.hasEntrySatisfying("ai.internal.sdkVersion", v -> assertThat(v).startsWith("java:3."));
assertThat(telemetry.rdEnvelope.getTags()).containsEntry("ai.user.id", "myuser");
assertThat(telemetry.rdEnvelope.getTags()).containsEntry("ai.user.authUserId", "myuser");
assertThat(telemetry.rdEnvelope.getTags()).containsEntry("ai.user.id", "mypseudo");
assertThat(telemetry.rdEnvelope.getTags()).containsEntry("ai.session.id", "mysession");
}

@Test
Expand Down
Loading