Skip to content
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

Support stable HTTP semconv #3418

Merged
merged 94 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
4979fdc
Support stable HTTP semconv
trask Dec 2, 2023
f763853
Test with SNAPSHOT
trask Jan 6, 2024
4dd1077
Update dependency version
trask Jan 6, 2024
d520ec8
Merge remote-tracking branch 'origin/main' into stable-http-semconv
heyams Jan 10, 2024
483ad50
Fix
heyams Jan 10, 2024
b2b595f
Fix license
heyams Jan 10, 2024
4fc4e1d
exporter jar
heyams Jan 10, 2024
b42259a
Update exporter
heyams Jan 10, 2024
1244320
Fix lettuce smoke test
heyams Jan 11, 2024
9c9e151
Revert samplingoverrides
heyams Jan 11, 2024
66bc14b
Update artifact
heyams Jan 11, 2024
3bbae68
Fix compilation
heyams Jan 11, 2024
8ca9345
Fix cassandra
heyams Jan 11, 2024
7da6073
Fix telemetry processor smoke tests
heyams Jan 12, 2024
d177d4d
Revert timeout
heyams Jan 12, 2024
40398d4
Bump otelInstrumentationAlphaVersion from 1.32.0-alpha to 2.0.0-alpha
dependabot[bot] Jan 15, 2024
3280d9e
Fix sampling overrides
heyams Jan 16, 2024
f766534
Merge branch 'main' into stable-http-semconv
heyams Jan 16, 2024
7f465b9
Fix
heyams Jan 16, 2024
4e510fc
Fix spotless
heyams Jan 16, 2024
30edc3f
Merge branch 'main' into dependabot/gradle/otelInstrumentationAlphaVe…
heyams Jan 16, 2024
a174aa4
Fix
heyams Jan 17, 2024
f285aa2
Merge branch 'dependabot/gradle/otelInstrumentationAlphaVersion-2.0.0…
heyams Jan 17, 2024
3831a7a
Merge branch 'main' into dependabot/gradle/otelInstrumentationAlphaVe…
heyams Jan 17, 2024
ee47127
./gradlew resolveAndLockAll --write-locks
github-actions[bot] Jan 17, 2024
c069df4
Merge branch 'main' into stable-http-semconv
heyams Jan 17, 2024
e1a53b6
Fix
heyams Jan 17, 2024
146d1eb
Merge branch 'dependabot/gradle/otelInstrumentationAlphaVersion-2.0.0…
heyams Jan 17, 2024
95bf571
Update dependency
heyams Jan 18, 2024
5856526
Fix
heyams Jan 18, 2024
4003137
Fix
heyams Jan 18, 2024
379d20f
Fix
heyams Jan 18, 2024
5c9ccca
Fix tests
heyams Jan 18, 2024
46e819a
Merge branch 'dependabot/gradle/otelInstrumentationAlphaVersion-2.0.0…
heyams Jan 22, 2024
20d5db0
Merge remote-tracking branch 'origin/main' into stable-http-semconv
heyams Jan 22, 2024
29b49ae
Fix
heyams Jan 22, 2024
4a81a18
Update jar
heyams Jan 23, 2024
65c7d91
Fix tests
heyams Jan 23, 2024
24f874a
Fix unit tests
heyams Jan 23, 2024
6da7a6a
Fix
heyams Jan 23, 2024
5baa39d
Enable controller span based on customer's config
heyams Jan 23, 2024
df80579
Revert lettuce test
heyams Jan 23, 2024
3a13791
Delete test jar
heyams Jan 23, 2024
d6e62a7
Exclude io.prometheus dependency
heyams Jan 24, 2024
efcdecc
Fix
heyams Jan 24, 2024
338c657
Exclude inst/io/prometheus/**
heyams Jan 25, 2024
06ac279
Fix tests
heyams Jan 25, 2024
1524358
Support more attributes backward compat
heyams Jan 26, 2024
3c68992
Merge remote-tracking branch 'origin/main' into stable-http-semconv
heyams Jan 26, 2024
7a91df5
Comments
heyams Jan 26, 2024
61ed5da
Fix spotless
heyams Jan 26, 2024
2907029
Fix request and response headers
heyams Jan 26, 2024
30bc116
Take care both client and server headers
heyams Jan 26, 2024
7df456d
Update exporter to beta.17
heyams Jan 26, 2024
8dce2bd
Update test
heyams Jan 26, 2024
6900345
Update httpheader test
heyams Jan 26, 2024
1466795
Merge branch 'main' into stable-http-semconv
heyams Jan 26, 2024
82348fe
Comments
heyams Jan 26, 2024
098812a
Merge branch 'stable-http-semconv' of https://github.com/microsoft/Ap…
heyams Jan 26, 2024
084407f
Revert lettuceTest
heyams Jan 26, 2024
b995bea
Fix test
heyams Jan 26, 2024
e26cc08
Fix backward compat for http request/response header and sampling ove…
heyams Jan 27, 2024
0bde40c
Do not normalize http request or server headers
heyams Jan 27, 2024
833a53f
Revert debug
heyams Jan 27, 2024
ce59702
Support telemetry processor
heyams Jan 30, 2024
d4ed187
Address comments
heyams Jan 30, 2024
9442172
Remove description
heyams Jan 30, 2024
cb4a2b9
Fix naming
heyams Jan 30, 2024
30ffce7
Update licenses
heyams Jan 30, 2024
625bbad
Clean up log
heyams Jan 30, 2024
98a2cdb
Add a comment
heyams Jan 30, 2024
c100908
Fix test
heyams Jan 30, 2024
fc41cc8
Track pekko feature
heyams Jan 30, 2024
42e5719
Fix spotless
heyams Jan 30, 2024
a529656
Comments
heyams Feb 5, 2024
171c5e9
Merge branch 'main' into stable-http-semconv
heyams Feb 5, 2024
b79e571
Add a smoke test to delete existing log attribute
heyams Feb 6, 2024
b57ff39
Merge branch 'stable-http-semconv' of https://github.com/microsoft/Ap…
heyams Feb 6, 2024
6f0ebf4
Merge branch 'main' into stable-http-semconv
heyams Feb 6, 2024
c53ec47
Fix license
heyams Feb 7, 2024
6963d1c
Wildfly tests run forever
heyams Feb 7, 2024
cd0d341
Merge branch 'main' into stable-http-semconv
heyams Feb 12, 2024
c39d85e
Fix merge conflicts
heyams Feb 12, 2024
24da3ce
Comments
heyams Feb 13, 2024
bf792f8
Comments
heyams Feb 14, 2024
4c105b2
Merge branch 'main' into stable-http-semconv
heyams Feb 14, 2024
46416a3
Update license
heyams Feb 14, 2024
3d2bfa4
Add a todo
heyams Feb 15, 2024
af69a3b
Fix server span
heyams Feb 15, 2024
26b3e5d
Enable wildfly tests
heyams Feb 16, 2024
43abe9b
Bump OTEL to 2.1.0
heyams Feb 16, 2024
ae6daf1
Fix todos
heyams Feb 16, 2024
7cbf204
Remove debug logging
heyams Feb 16, 2024
9a42de2
Fix spotless
heyams Feb 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ jobs:
distribution: temurin
java-version: 17

- run: |
mvn -version
# double quotes are needed on Windows (https://stackoverflow.com/a/16349133/295416)
mvn install:install-file -Dfile="azure-monitor-opentelemetry-exporter-1.0.0-beta.16.jar" \
-DpomFile="azure-monitor-opentelemetry-exporter-1.0.0-beta.16.pom" \
-DgroupId="com.azure" \
-DartifactId="azure-monitor-opentelemetry-exporter" \
-Dversion="1.0.0-beta.16"

- name: Assemble
uses: gradle/gradle-build-action@v2
with:
Expand Down Expand Up @@ -129,6 +138,15 @@ jobs:
distribution: temurin
java-version: 17

- run: |
mvn -version
# double quotes are needed on Windows (https://stackoverflow.com/a/16349133/295416)
mvn install:install-file -Dfile="azure-monitor-opentelemetry-exporter-1.0.0-beta.16.jar" \
-DpomFile="azure-monitor-opentelemetry-exporter-1.0.0-beta.16.pom" \
-DgroupId="com.azure" \
-DartifactId="azure-monitor-opentelemetry-exporter" \
-Dversion="1.0.0-beta.16"

- name: Test
uses: gradle/gradle-build-action@v2
with:
Expand Down Expand Up @@ -169,6 +187,15 @@ jobs:
distribution: temurin
java-version: 17

- run: |
mvn -version
# double quotes are needed on Windows (https://stackoverflow.com/a/16349133/295416)
mvn install:install-file -Dfile="azure-monitor-opentelemetry-exporter-1.0.0-beta.16.jar" \
-DpomFile="azure-monitor-opentelemetry-exporter-1.0.0-beta.16.pom" \
-DgroupId="com.azure" \
-DartifactId="azure-monitor-opentelemetry-exporter" \
-Dversion="1.0.0-beta.16"

- name: Test
uses: gradle/gradle-build-action@v2
with:
Expand Down
1 change: 0 additions & 1 deletion agent/agent-bootstrap/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ dependencies {
// needed to access io.opentelemetry.instrumentation.api.aisdk.MicrometerUtil
// TODO (heya) remove this when updating to upstream micrometer instrumentation
compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")
compileOnly("io.opentelemetry:opentelemetry-semconv")
compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv")
}
2 changes: 1 addition & 1 deletion agent/agent-tooling/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
implementation(project(":agent:agent-profiler:agent-diagnostics"))
implementation(project(":etw:java"))

implementation("com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.15")
implementation("com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.16")
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap")
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling")
compileOnly("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-servlet-common-bootstrap")
Expand Down
4 changes: 1 addition & 3 deletions agent/agent-tooling/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ com.azure:azure-core-http-netty:1.13.11=runtimeClasspath
com.azure:azure-core:1.45.1=runtimeClasspath
com.azure:azure-identity:1.11.1=runtimeClasspath
com.azure:azure-json:1.1.0=runtimeClasspath
com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.15=runtimeClasspath
com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.16=runtimeClasspath
com.azure:azure-sdk-bom:1.2.19=runtimeClasspath
com.azure:azure-storage-blob:12.25.1=runtimeClasspath
com.azure:azure-storage-common:12.24.1=runtimeClasspath
Expand All @@ -22,9 +22,7 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.16.1=runtimeClasspath
com.fasterxml.jackson:jackson-bom:2.16.1=runtimeClasspath
com.fasterxml.woodstox:woodstox-core:6.5.1=runtimeClasspath
com.github.oshi:oshi-core:6.4.10=runtimeClasspath
com.github.spotbugs:spotbugs-annotations:4.8.3=runtimeClasspath
com.github.stephenc.jcip:jcip-annotations:1.0-1=runtimeClasspath
com.google.code.findbugs:jsr305:3.0.2=runtimeClasspath
com.google.errorprone:error_prone_annotations:2.24.1=runtimeClasspath
com.google.guava:guava-bom:33.0.0-jre=runtimeClasspath
com.microsoft.azure:msal4j-persistence-extension:1.2.0=runtimeClasspath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public Map<String, String> apply(ConfigProperties otelConfig) {
Configuration configuration = FirstEntryPoint.getConfiguration();

Map<String, String> properties = new HashMap<>();
properties.put("otel.semconv-stability.opt-in", "http,jvm");

heyams marked this conversation as resolved.
Show resolved Hide resolved
properties.put(
"applicationinsights.internal.micrometer.step.millis",
Long.toString(SECONDS.toMillis(configuration.metricIntervalSeconds)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.monitor.opentelemetry.exporter.implementation.AiSemanticAttributes;
import com.microsoft.applicationinsights.agent.internal.configuration.Configuration;
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.trace.Span;
import io.opentelemetry.context.Context;
Expand Down Expand Up @@ -39,9 +40,11 @@ public Context onStart(Context context, R request, Attributes startAttributes) {

Context newContext = context;

String target = startAttributes.get(SemanticAttributes.HTTP_TARGET);
String path =
getStableAttribute(
startAttributes, SemanticAttributes.URL_PATH, SemanticAttributes.HTTP_TARGET);

String connectionStringOverride = getConnectionStringOverride(target);
String connectionStringOverride = getConnectionStringOverride(path);
if (connectionStringOverride != null) {
newContext = newContext.with(AiContextKeys.CONNECTION_STRING, connectionStringOverride);
// InheritedConnectionStringSpanProcessor will stamp connection string attribute from the
Expand All @@ -51,7 +54,7 @@ public Context onStart(Context context, R request, Attributes startAttributes) {
span.setAttribute(AiSemanticAttributes.INTERNAL_CONNECTION_STRING, connectionStringOverride);
}

String roleNameOverride = getRoleNameOverride(target);
String roleNameOverride = getRoleNameOverride(path);
if (roleNameOverride != null) {
newContext = newContext.with(AiContextKeys.ROLE_NAME, roleNameOverride);
// InheritedRoleNameSpanProcessor will stamp role name attribute from the
Expand Down Expand Up @@ -89,4 +92,13 @@ private String getRoleNameOverride(String target) {
}
return null;
}

private static <T> T getStableAttribute(
Attributes attributes, AttributeKey<T> stable, AttributeKey<T> old) {
T value = attributes.get(stable);
if (value != null) {
return value;
}
return attributes.get(old);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@
import com.microsoft.applicationinsights.agent.internal.processors.ExporterWithLogProcessor;
import com.microsoft.applicationinsights.agent.internal.processors.ExporterWithSpanProcessor;
import com.microsoft.applicationinsights.agent.internal.processors.LogExporterWithAttributeProcessor;
import com.microsoft.applicationinsights.agent.internal.processors.MySpanData;
import com.microsoft.applicationinsights.agent.internal.processors.SpanExporterWithAttributeProcessor;
import com.microsoft.applicationinsights.agent.internal.profiler.triggers.AlertTriggerSpanProcessor;
import com.microsoft.applicationinsights.agent.internal.sampling.SamplingOverrides;
import com.microsoft.applicationinsights.agent.internal.telemetry.BatchItemProcessor;
import com.microsoft.applicationinsights.agent.internal.telemetry.MetricFilter;
import com.microsoft.applicationinsights.agent.internal.telemetry.TelemetryClient;
import com.microsoft.applicationinsights.agent.internal.telemetry.TelemetryObservers;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.common.AttributesBuilder;
import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder;
import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer;
import io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizerProvider;
Expand All @@ -63,14 +60,11 @@
import io.opentelemetry.sdk.metrics.export.PeriodicMetricReaderBuilder;
import io.opentelemetry.sdk.metrics.internal.view.AiViewRegistry;
import io.opentelemetry.sdk.trace.SdkTracerProviderBuilder;
import io.opentelemetry.sdk.trace.data.SpanData;
import io.opentelemetry.sdk.trace.export.BatchSpanProcessor;
import io.opentelemetry.sdk.trace.export.SpanExporter;
import io.opentelemetry.semconv.SemanticAttributes;
import java.io.File;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -595,10 +589,6 @@ private static SpanExporter wrapSpanExporter(
"Not an expected ProcessorType: " + processorConfig.type);
}
}

// this is temporary until semantic attributes stabilize and we make breaking change
// then can use java.util.functions.Predicate<Attributes>
spanExporter = new BackCompatHttpUrlProcessor(spanExporter);
}

return spanExporter;
Expand Down Expand Up @@ -758,47 +748,4 @@ private static SdkMeterProviderBuilder configureMetrics(
}
return builder.registerMetricReader(metricReader);
}

private static class BackCompatHttpUrlProcessor implements SpanExporter {

private final SpanExporter delegate;

private BackCompatHttpUrlProcessor(SpanExporter delegate) {
this.delegate = delegate;
}

@Override
public CompletableResultCode export(Collection<SpanData> spans) {
List<SpanData> copy = new ArrayList<>();
for (SpanData span : spans) {
copy.add(addBackCompatHttpUrl(span));
}
return delegate.export(copy);
}

private static SpanData addBackCompatHttpUrl(SpanData span) {
Attributes attributes = span.getAttributes();
if (attributes.get(SemanticAttributes.HTTP_URL) != null) {
// already has http.url
return span;
}
String httpUrl = SpanDataMapper.getHttpUrlFromServerSpan(attributes);
if (httpUrl == null) {
return span;
}
AttributesBuilder builder = attributes.toBuilder();
builder.put(SemanticAttributes.HTTP_URL, httpUrl);
return new MySpanData(span, builder.build());
}

@Override
public CompletableResultCode flush() {
return delegate.flush();
}

@Override
public CompletableResultCode shutdown() {
return delegate.shutdown();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public CompletableResultCode export(Collection<SpanData> spans) {
if (instrumentationScopeName.startsWith("azure-")) {
instrumentationScopeName = AZURE_OPENTELEMETRY;
}
statsbeatModule.getInstrumentationStatsbeat().addInstrumentation(instrumentationScopeName);
statsbeatModule.getInstrumentationStatsbeat().addInstrumentation(span);
}
return delegate.export(spans);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@
import com.azure.monitor.opentelemetry.exporter.implementation.utils.TempDirs;
import com.microsoft.applicationinsights.agent.internal.configuration.Configuration;
import com.microsoft.applicationinsights.agent.internal.httpclient.LazyHttpClient;
import io.opentelemetry.sdk.autoconfigure.spi.internal.DefaultConfigProperties;
import io.opentelemetry.sdk.common.CompletableResultCode;
import io.opentelemetry.sdk.resources.Resource;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -340,8 +338,7 @@ public void populateDefaults(AbstractTelemetryBuilder telemetryBuilder, Resource
for (Map.Entry<String, String> entry : globalProperties.entrySet()) {
telemetryBuilder.addProperty(entry.getKey(), entry.getValue());
}
ResourceParser.updateRoleNameAndInstance(
telemetryBuilder, resource, DefaultConfigProperties.create(Collections.emptyMap()));
new ResourceParser().updateRoleNameAndInstance(telemetryBuilder, resource);
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import java.util.Set;

enum MetricView {
HTTP_CLIENT_VIEW("http.client.duration", httpClientDurationAttributeKeys(), false),
HTTP_SERVER_VIEW("http.server.duration", httpServerDurationAttributeKeys(), true),
HTTP_CLIENT_VIEW("http.client.request.duration", httpClientDurationAttributeKeys(), false),
HTTP_SERVER_VIEW("http.server.request.duration", httpServerDurationAttributeKeys(), true),
RPC_CLIENT_VIEW("rpc.client.duration", rpcClientDurationAttributeKeys(), false),
RPC_SERVER_VIEW("rpc.server.duration", rpcServerDurationAttributeKeys(), false);

Expand Down Expand Up @@ -41,23 +41,23 @@ boolean isCaptureSynthetic() {

private static Set<AttributeKey<?>> httpClientDurationAttributeKeys() {
Set<AttributeKey<?>> view = new HashSet<>(3);
view.add(SemanticAttributes.HTTP_STATUS_CODE);
view.add(SemanticAttributes.NET_PEER_NAME);
view.add(SemanticAttributes.NET_PEER_PORT);
view.add(SemanticAttributes.HTTP_RESPONSE_STATUS_CODE);
view.add(SemanticAttributes.SERVER_ADDRESS);
view.add(SemanticAttributes.SERVER_PORT);
return view;
}

private static Set<AttributeKey<?>> httpServerDurationAttributeKeys() {
Set<AttributeKey<?>> view = new HashSet<>(1);
view.add(SemanticAttributes.HTTP_STATUS_CODE);
view.add(SemanticAttributes.HTTP_RESPONSE_STATUS_CODE);
return view;
}

private static Set<AttributeKey<?>> rpcClientDurationAttributeKeys() {
Set<AttributeKey<?>> view = new HashSet<>(3);
view.add(SemanticAttributes.RPC_SYSTEM);
view.add(SemanticAttributes.NET_PEER_NAME);
view.add(SemanticAttributes.NET_PEER_PORT);
view.add(SemanticAttributes.SERVER_ADDRESS);
view.add(SemanticAttributes.SERVER_PORT);
return view;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void generateHttpClientMetrics() {
.satisfiesExactly(
metric ->
assertThat(metric)
.hasName("http.client.duration")
.hasName("http.client.request.duration")
.hasUnit("ms")
.hasHistogramSatisfying(
histogram ->
Expand All @@ -123,9 +123,10 @@ void generateHttpClientMetrics() {
point
.hasSum(150 /* millis */)
.hasAttributesSatisfying(
equalTo(SemanticAttributes.NET_PEER_NAME, "localhost"),
equalTo(SemanticAttributes.NET_PEER_PORT, 1234),
equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200))
equalTo(SemanticAttributes.SERVER_ADDRESS, "localhost"),
equalTo(SemanticAttributes.SERVER_PORT, 1234),
equalTo(
SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, 200))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand Down Expand Up @@ -158,10 +159,8 @@ void generateRpcClientMetrics() {

Attributes responseAttributes1 =
Attributes.builder()
.put(SemanticAttributes.NET_PEER_NAME, "example.com")
.put(SemanticAttributes.NET_PEER_IP, "127.0.0.1")
.put(SemanticAttributes.NET_PEER_PORT, 8080)
.put(SemanticAttributes.NET_TRANSPORT, "ip_tcp")
.put(SemanticAttributes.SERVER_ADDRESS, "example.com")
.put(SemanticAttributes.SERVER_PORT, 8080)
.build();

Context parent =
Expand Down Expand Up @@ -202,8 +201,8 @@ void generateRpcClientMetrics() {
.hasAttributesSatisfying(
equalTo(SemanticAttributes.RPC_SYSTEM, "grpc"),
equalTo(
SemanticAttributes.NET_PEER_NAME, "example.com"),
equalTo(SemanticAttributes.NET_PEER_PORT, 8080))
SemanticAttributes.SERVER_ADDRESS, "example.com"),
equalTo(SemanticAttributes.SERVER_PORT, 8080))
.hasExemplarsSatisfying(
exemplar ->
exemplar
Expand Down Expand Up @@ -259,7 +258,7 @@ void generateHttpServerMetrics() {
Collection<MetricData> metricDataCollection = metricReader.collectAllMetrics();
MetricData target = null;
for (MetricData metricData : metricDataCollection) {
if ("http.server.duration".equals(metricData.getName())) {
if ("http.server.request.duration".equals(metricData.getName())) {
target = metricData;
System.out.println("metric: " + metricData);
}
Expand All @@ -269,7 +268,7 @@ void generateHttpServerMetrics() {
.satisfies(
metric ->
assertThat(metric)
.hasName("http.server.duration")
.hasName("http.server.request.duration")
.hasUnit("ms")
.hasHistogramSatisfying(
histogram ->
Expand All @@ -278,7 +277,8 @@ void generateHttpServerMetrics() {
point
.hasSum(150 /* millis */)
.hasAttributesSatisfying(
equalTo(SemanticAttributes.HTTP_STATUS_CODE, 200),
equalTo(
SemanticAttributes.HTTP_RESPONSE_STATUS_CODE, 200),
equalTo(
AttributeKey.booleanKey(
"applicationinsights.internal.is_synthetic"),
Expand Down