diff --git a/CHANGELOG.md b/CHANGELOG.md index 39d0323f210..606a8897799 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # CHANGELOG +# Version 3.1.0 +* Capture http method in the operation name [#1679](https://github.com/microsoft/ApplicationInsights-Java/pull/1679) + # Version 3.0.4-BETA.2 * Enable users to override iKey, cloud role name and cloud role instance per telemetry [#1630](https://github.com/microsoft/ApplicationInsights-Java/pull/1630). * Fix duplicate headers [#1640](https://github.com/microsoft/ApplicationInsights-Java/pull/1640). diff --git a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/OpenTelemetryConfigurer.java b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/OpenTelemetryConfigurer.java index f294a9fc0ad..0ca273d31e9 100644 --- a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/OpenTelemetryConfigurer.java +++ b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/OpenTelemetryConfigurer.java @@ -54,8 +54,8 @@ public void configure(SdkTracerProviderBuilder tracerProvider) { if (currExporter == null) { currExporter = processorConfig.type == ProcessorType.attribute ? - new ExporterWithAttributeProcessor(processorConfig, new Exporter(telemetryClient, config.preview.httpMethodInOperationName)) : - new ExporterWithSpanProcessor(processorConfig, new Exporter(telemetryClient, config.preview.httpMethodInOperationName)); + new ExporterWithAttributeProcessor(processorConfig, new Exporter(telemetryClient)) : + new ExporterWithSpanProcessor(processorConfig, new Exporter(telemetryClient)); } else { currExporter = processorConfig.type == ProcessorType.attribute ? @@ -67,7 +67,7 @@ public void configure(SdkTracerProviderBuilder tracerProvider) { tracerProvider.addSpanProcessor(SimpleSpanProcessor.create(currExporter)); } else { - tracerProvider.addSpanProcessor(SimpleSpanProcessor.create(new Exporter(telemetryClient, config.preview.httpMethodInOperationName))); + tracerProvider.addSpanProcessor(SimpleSpanProcessor.create(new Exporter(telemetryClient))); } } } diff --git a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/configuration/Configuration.java b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/configuration/Configuration.java index eff9fa8eb4f..f3f33ddda5b 100644 --- a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/configuration/Configuration.java +++ b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/configuration/Configuration.java @@ -136,6 +136,7 @@ public static class LoggingInstrumentation { public static class MicrometerInstrumentation { public boolean enabled = true; // this is just here to detect if using this old undocumented setting in order to give a helpful error message + @Deprecated public int reportingIntervalSeconds = 60; } @@ -176,7 +177,8 @@ public static class PreviewConfiguration { // ignoreRemoteParentNotSampled is currently needed // because .NET SDK always propagates trace flags "00" (not sampled) public boolean ignoreRemoteParentNotSampled = true; - // TODO consider turning this on by default in 3.1.0 + // this is just here to detect if using this old setting in order to give a helpful message + @Deprecated public boolean httpMethodInOperationName; public LiveMetrics liveMetrics = new LiveMetrics(); diff --git a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/configuration/ConfigurationBuilder.java b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/configuration/ConfigurationBuilder.java index 4ca69f44f22..5b759a91452 100644 --- a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/configuration/ConfigurationBuilder.java +++ b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/wasbootstrap/configuration/ConfigurationBuilder.java @@ -95,6 +95,10 @@ public static Configuration create(Path agentJarPath, RpConfiguration rpConfigur " (and note that metricIntervalSeconds applies to all auto-collected metrics," + " not only micrometer)")); } + if (config.preview.httpMethodInOperationName) { + configurationWarnMessages.add(new ConfigurationWarnMessage( + "\"httpMethodInOperationName\" preview setting is now the (one and only) default behavior")); + } overlayEnvVars(config); applySamplingPercentageRounding(config); // rp configuration should always be last (so it takes precedence) diff --git a/agent/exporter/src/main/java/com/microsoft/applicationinsights/agent/Exporter.java b/agent/exporter/src/main/java/com/microsoft/applicationinsights/agent/Exporter.java index feedefc23a1..b9a560fafa8 100644 --- a/agent/exporter/src/main/java/com/microsoft/applicationinsights/agent/Exporter.java +++ b/agent/exporter/src/main/java/com/microsoft/applicationinsights/agent/Exporter.java @@ -128,11 +128,8 @@ public class Exporter implements SpanExporter { private final TelemetryClient telemetryClient; - private final boolean httpMethodInOperationName; - - public Exporter(TelemetryClient telemetryClient, boolean httpMethodInOperationName) { + public Exporter(TelemetryClient telemetryClient) { this.telemetryClient = telemetryClient; - this.httpMethodInOperationName = httpMethodInOperationName; } /** @@ -623,7 +620,7 @@ private void exportRequest(SpanData span) { private String getTelemetryName(SpanData span) { String name = span.getName(); - if (!httpMethodInOperationName || !name.startsWith("/")) { + if (!name.startsWith("/")) { return name; } String httpMethod = span.getAttributes().get(SemanticAttributes.HTTP_METHOD); diff --git a/gradle.properties b/gradle.properties index 2adc90724d0..d7963a0e034 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ // Project properties -version=3.0.4-BETA.3 +version=3.1.0 group=com.microsoft.azure \ No newline at end of file diff --git a/test/smoke/appServers/global-resources/azuresdk_applicationinsights.json b/test/smoke/appServers/global-resources/azuresdk_applicationinsights.json index 52e6ec51411..547cfd88fe4 100644 --- a/test/smoke/appServers/global-resources/azuresdk_applicationinsights.json +++ b/test/smoke/appServers/global-resources/azuresdk_applicationinsights.json @@ -1,7 +1,6 @@ { "connectionString": "InstrumentationKey=00000000-0000-0000-0000-0FEEDDADBEEF;IngestionEndpoint=http://host.docker.internal:6060/", "preview": { - "httpMethodInOperationName": true, "instrumentation": { "azureSdk": { "enabled": true diff --git a/test/smoke/appServers/global-resources/customdimensions_applicationinsights.json b/test/smoke/appServers/global-resources/customdimensions_applicationinsights.json index 3288a62594e..83ca43508a1 100644 --- a/test/smoke/appServers/global-resources/customdimensions_applicationinsights.json +++ b/test/smoke/appServers/global-resources/customdimensions_applicationinsights.json @@ -4,8 +4,5 @@ "test": "value", "home": "${HOME}", "service.version": "123" - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/custominstrumentation_applicationinsights.json b/test/smoke/appServers/global-resources/custominstrumentation_applicationinsights.json index f3c2270aa81..e16dde7c3d9 100644 --- a/test/smoke/appServers/global-resources/custominstrumentation_applicationinsights.json +++ b/test/smoke/appServers/global-resources/custominstrumentation_applicationinsights.json @@ -1,7 +1,6 @@ { "connectionString": "InstrumentationKey=00000000-0000-0000-0000-0FEEDDADBEEF;IngestionEndpoint=http://host.docker.internal:6060/", "preview": { - "httpMethodInOperationName": true, "customInstrumentation": [ { "className": "com.microsoft.applicationinsights.smoketestapp.TargetObject", diff --git a/test/smoke/appServers/global-resources/default_applicationinsights.json b/test/smoke/appServers/global-resources/default_applicationinsights.json index 3e59bbb814f..386eae55ff2 100644 --- a/test/smoke/appServers/global-resources/default_applicationinsights.json +++ b/test/smoke/appServers/global-resources/default_applicationinsights.json @@ -3,8 +3,5 @@ "role": { "name": "testrolename", "instance": "testroleinstance" - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/disabled_cassandra_applicationinsights.json b/test/smoke/appServers/global-resources/disabled_cassandra_applicationinsights.json index 58a97618f11..1f6b0d14be0 100644 --- a/test/smoke/appServers/global-resources/disabled_cassandra_applicationinsights.json +++ b/test/smoke/appServers/global-resources/disabled_cassandra_applicationinsights.json @@ -4,8 +4,5 @@ "cassandra": { "enabled": false } - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/disabled_jdbc_applicationinsights.json b/test/smoke/appServers/global-resources/disabled_jdbc_applicationinsights.json index 63fadc5f6a4..541f83b5d31 100644 --- a/test/smoke/appServers/global-resources/disabled_jdbc_applicationinsights.json +++ b/test/smoke/appServers/global-resources/disabled_jdbc_applicationinsights.json @@ -4,8 +4,5 @@ "jdbc": { "enabled": false } - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/disabled_jms_applicationinsights.json b/test/smoke/appServers/global-resources/disabled_jms_applicationinsights.json index ebb9cdadce5..1d53fcd5d45 100644 --- a/test/smoke/appServers/global-resources/disabled_jms_applicationinsights.json +++ b/test/smoke/appServers/global-resources/disabled_jms_applicationinsights.json @@ -4,8 +4,5 @@ "jms": { "enabled": false } - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/disabled_kafka_applicationinsights.json b/test/smoke/appServers/global-resources/disabled_kafka_applicationinsights.json index 70031cfeb07..5b8515f26e7 100644 --- a/test/smoke/appServers/global-resources/disabled_kafka_applicationinsights.json +++ b/test/smoke/appServers/global-resources/disabled_kafka_applicationinsights.json @@ -4,8 +4,5 @@ "kafka": { "enabled": false } - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/disabled_micrometer_applicationinsights.json b/test/smoke/appServers/global-resources/disabled_micrometer_applicationinsights.json index 800a1b05448..aaf7541913a 100644 --- a/test/smoke/appServers/global-resources/disabled_micrometer_applicationinsights.json +++ b/test/smoke/appServers/global-resources/disabled_micrometer_applicationinsights.json @@ -6,7 +6,6 @@ } }, "preview": { - "httpMethodInOperationName": true, "metricIntervalSeconds": 5 } } diff --git a/test/smoke/appServers/global-resources/disabled_mongo_applicationinsights.json b/test/smoke/appServers/global-resources/disabled_mongo_applicationinsights.json index 4b6b4968013..265c8870d77 100644 --- a/test/smoke/appServers/global-resources/disabled_mongo_applicationinsights.json +++ b/test/smoke/appServers/global-resources/disabled_mongo_applicationinsights.json @@ -4,8 +4,5 @@ "mongo": { "enabled": false } - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/disabled_redis_applicationinsights.json b/test/smoke/appServers/global-resources/disabled_redis_applicationinsights.json index 6679a0d9cd1..7f794da3b25 100644 --- a/test/smoke/appServers/global-resources/disabled_redis_applicationinsights.json +++ b/test/smoke/appServers/global-resources/disabled_redis_applicationinsights.json @@ -4,8 +4,5 @@ "redis": { "enabled": false } - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/disabled_springscheduling_applicationinsights.json b/test/smoke/appServers/global-resources/disabled_springscheduling_applicationinsights.json index 63101c2de88..ea4a9cade9d 100644 --- a/test/smoke/appServers/global-resources/disabled_springscheduling_applicationinsights.json +++ b/test/smoke/appServers/global-resources/disabled_springscheduling_applicationinsights.json @@ -4,8 +4,5 @@ "springScheduling": { "enabled": false } - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/fastheartbeat_applicationinsights.json b/test/smoke/appServers/global-resources/fastheartbeat_applicationinsights.json index cec64ea819a..2b5f34ff085 100644 --- a/test/smoke/appServers/global-resources/fastheartbeat_applicationinsights.json +++ b/test/smoke/appServers/global-resources/fastheartbeat_applicationinsights.json @@ -2,8 +2,5 @@ "connectionString": "InstrumentationKey=00000000-0000-0000-0000-0FEEDDADBEEF;IngestionEndpoint=http://host.docker.internal:6060/", "heartbeat": { "intervalSeconds": 30 - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/fastmetrics_applicationinsights.json b/test/smoke/appServers/global-resources/fastmetrics_applicationinsights.json index f70f73ef5bf..373ec4d40e4 100644 --- a/test/smoke/appServers/global-resources/fastmetrics_applicationinsights.json +++ b/test/smoke/appServers/global-resources/fastmetrics_applicationinsights.json @@ -2,8 +2,5 @@ "connectionString": "InstrumentationKey=00000000-0000-0000-0000-0FEEDDADBEEF;IngestionEndpoint=http://host.docker.internal:6060/", "preview": { "metricIntervalSeconds": 5 - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/logging_applicationinsights.json b/test/smoke/appServers/global-resources/logging_applicationinsights.json index 636d4ac7867..3b23c3e8a1a 100644 --- a/test/smoke/appServers/global-resources/logging_applicationinsights.json +++ b/test/smoke/appServers/global-resources/logging_applicationinsights.json @@ -4,8 +4,5 @@ "logging": { "level": "warn" } - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/micrometer_applicationinsights.json b/test/smoke/appServers/global-resources/micrometer_applicationinsights.json index 01ddfd0eb3b..373ec4d40e4 100644 --- a/test/smoke/appServers/global-resources/micrometer_applicationinsights.json +++ b/test/smoke/appServers/global-resources/micrometer_applicationinsights.json @@ -1,7 +1,6 @@ { "connectionString": "InstrumentationKey=00000000-0000-0000-0000-0FEEDDADBEEF;IngestionEndpoint=http://host.docker.internal:6060/", "preview": { - "httpMethodInOperationName": true, "metricIntervalSeconds": 5 } } diff --git a/test/smoke/appServers/global-resources/opentelemetryapisupport_applicationinsights.json b/test/smoke/appServers/global-resources/opentelemetryapisupport_applicationinsights.json index 161fedd1271..28f26b78b7d 100644 --- a/test/smoke/appServers/global-resources/opentelemetryapisupport_applicationinsights.json +++ b/test/smoke/appServers/global-resources/opentelemetryapisupport_applicationinsights.json @@ -5,7 +5,6 @@ "instance": "testroleinstance" }, "preview": { - "httpMethodInOperationName": true, "openTelemetryApiSupport": true } } diff --git a/test/smoke/appServers/global-resources/sampling_applicationinsights.json b/test/smoke/appServers/global-resources/sampling_applicationinsights.json index 9cc0b48c7ce..edc57eb3f0a 100644 --- a/test/smoke/appServers/global-resources/sampling_applicationinsights.json +++ b/test/smoke/appServers/global-resources/sampling_applicationinsights.json @@ -2,8 +2,5 @@ "connectionString": "InstrumentationKey=00000000-0000-0000-0000-0FEEDDADBEEF;IngestionEndpoint=http://host.docker.internal:6060/", "sampling": { "percentage": 50 - }, - "preview": { - "httpMethodInOperationName": true } } diff --git a/test/smoke/appServers/global-resources/telemetryfiltering2_applicationinsights.json b/test/smoke/appServers/global-resources/telemetryfiltering2_applicationinsights.json index 54a0d61a1d6..aa0a9d6af52 100644 --- a/test/smoke/appServers/global-resources/telemetryfiltering2_applicationinsights.json +++ b/test/smoke/appServers/global-resources/telemetryfiltering2_applicationinsights.json @@ -4,7 +4,6 @@ "percentage": 50 }, "preview": { - "httpMethodInOperationName": true, "sampling": { "overrides": [ { diff --git a/test/smoke/appServers/global-resources/telemetryfiltering_applicationinsights.json b/test/smoke/appServers/global-resources/telemetryfiltering_applicationinsights.json index 68f567ec2be..20cf172ef99 100644 --- a/test/smoke/appServers/global-resources/telemetryfiltering_applicationinsights.json +++ b/test/smoke/appServers/global-resources/telemetryfiltering_applicationinsights.json @@ -4,7 +4,6 @@ "percentage": 100 }, "preview": { - "httpMethodInOperationName": true, "sampling": { "overrides": [ { diff --git a/test/smoke/appServers/global-resources/telemetryprocessors_applicationinsights.json b/test/smoke/appServers/global-resources/telemetryprocessors_applicationinsights.json index 4ee5c9139ef..dbfbae04b8b 100644 --- a/test/smoke/appServers/global-resources/telemetryprocessors_applicationinsights.json +++ b/test/smoke/appServers/global-resources/telemetryprocessors_applicationinsights.json @@ -1,7 +1,6 @@ { "connectionString": "InstrumentationKey=00000000-0000-0000-0000-0FEEDDADBEEF;IngestionEndpoint=http://host.docker.internal:6060/", "preview": { - "httpMethodInOperationName": true, "processors" : [ { "type": "attribute",