Skip to content

Commit 9cca8e7

Browse files
authored
Azure-json migration (#3790)
1 parent e4478ad commit 9cca8e7

File tree

6 files changed

+23
-8
lines changed

6 files changed

+23
-8
lines changed

.github/workflows/build-common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
required: false
99

1010
env:
11-
EXPORTER_VERSION: 1.0.0-beta.25 # to be updated with the latest version
11+
EXPORTER_VERSION: 1.0.0-beta.28 # to be updated with the latest version
1212

1313
jobs:
1414
spotless:

agent/agent-tooling/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies {
2121
implementation(project(":agent:agent-profiler:agent-diagnostics"))
2222
implementation(project(":etw:java"))
2323

24-
implementation("com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.26")
24+
implementation("com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.28")
2525
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap")
2626
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling")
2727
compileOnly("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-servlet-common-bootstrap")
@@ -87,6 +87,11 @@ dependencies {
8787
testCompileOnly("com.google.code.findbugs:jsr305")
8888
}
8989

90+
configurations.all {
91+
// temporarily overriding version until latest azure-json is part of azure-core
92+
resolutionStrategy.force("com.azure:azure-json:1.2.0")
93+
}
94+
9095
configurations {
9196
"implementation" {
9297
exclude(group = "net.bytebuddy", module = "byte-buddy") // we use byte-buddy-dep

agent/agent-tooling/gradle.lockfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ ch.qos.logback:logback-core:1.3.14=runtimeClasspath
88
com.azure:azure-core-http-netty:1.15.2=runtimeClasspath
99
com.azure:azure-core:1.50.0=runtimeClasspath
1010
com.azure:azure-identity:1.13.1=runtimeClasspath
11-
com.azure:azure-json:1.1.0=runtimeClasspath
12-
com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.26=runtimeClasspath
11+
com.azure:azure-json:1.2.0=runtimeClasspath
12+
com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.28=runtimeClasspath
1313
com.azure:azure-sdk-bom:1.2.26=runtimeClasspath
1414
com.azure:azure-storage-blob:12.27.0=runtimeClasspath
1515
com.azure:azure-storage-common:12.26.0=runtimeClasspath

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/telemetry/TelemetryClient.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,18 @@ public void populateDefaults(AbstractTelemetryBuilder telemetryBuilder, Resource
332332
}
333333
telemetryBuilder.setResource(resource);
334334
for (Map.Entry<String, String> entry : globalTags.entrySet()) {
335-
telemetryBuilder.addTag(entry.getKey(), entry.getValue());
335+
// avoid putting null value into map. azure-json allows null values by default; whereas,
336+
// jackson doesn't
337+
if (!Strings.isNullOrEmpty(entry.getValue())) {
338+
telemetryBuilder.addTag(entry.getKey(), entry.getValue());
339+
}
336340
}
337341
for (Map.Entry<String, String> entry : globalProperties.entrySet()) {
338-
telemetryBuilder.addProperty(entry.getKey(), entry.getValue());
342+
// avoid putting null value into map. azure-json allows null values by default; whereas,
343+
// jackson doesn't
344+
if (!Strings.isNullOrEmpty(entry.getValue())) {
345+
telemetryBuilder.addProperty(entry.getKey(), entry.getValue());
346+
}
339347
}
340348
new ResourceParser().updateRoleNameAndInstance(telemetryBuilder, resource);
341349
}

agent/agent/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,5 +226,7 @@ configurations {
226226
// excluding unused dependencies for size (~1.8mb)
227227
exclude("com.fasterxml.jackson.dataformat", "jackson-dataformat-xml")
228228
exclude("com.fasterxml.woodstox", "woodstox-core")
229+
// temporarily overriding version until latest azure-json is part of azure-core
230+
resolutionStrategy.force("com.azure:azure-json:1.2.0")
229231
}
230232
}

licenses/more-licenses.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ _2024-08-12 03:55:29 UTC_
358358
> - **POM Project URL**: [https://github.com/Azure/azure-sdk-for-java](https://github.com/Azure/azure-sdk-for-java)
359359
> - **POM License**: MIT License - [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)
360360
361-
**69** **Group:** `com.azure` **Name:** `azure-json` **Version:** `1.1.0`
361+
**69** **Group:** `com.azure` **Name:** `azure-json` **Version:** `1.2.0`
362362
> - **POM Project URL**: [https://github.com/Azure/azure-sdk-for-java](https://github.com/Azure/azure-sdk-for-java)
363363
> - **POM License**: MIT License - [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)
364364
365-
**70** **Group:** `com.azure` **Name:** `azure-monitor-opentelemetry-exporter` **Version:** `1.0.0-beta.26`
365+
**70** **Group:** `com.azure` **Name:** `azure-monitor-opentelemetry-exporter` **Version:** `1.0.0-beta.28`
366366
> - **POM License**: MIT License - [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)
367367
368368
**71** **Group:** `com.azure` **Name:** `azure-storage-blob` **Version:** `12.27.0`

0 commit comments

Comments
 (0)