├── smoke-tests ├── apps │ ├── gRPC │ │ ├── .gitignore │ │ └── src │ │ │ ├── main │ │ │ ├── proto │ │ │ │ └── helloworld.proto │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── smoketestapp │ │ │ │ └── SpringBootApp.java │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ ├── HeartBeat │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── applicationinsights.json │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── HealthCheckServlet.java │ ├── ReadOnly │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── App.java │ ├── Statsbeat │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── logback-test.xml │ │ │ │ └── applicationinsights.json │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── HealthCheckServlet.java │ ├── JavaUtilLogging │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── applicationinsights.json │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── HealthCheckServlet.java │ ├── RoleNameOverrides │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── aks_applicationinsights.json │ │ │ ├── logback-test.xml │ │ │ └── overrides_applicationinsights.json │ ├── HttpPreaggregatedMetrics │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ ├── OtelResourceCustomMetric │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── applicationinsights.json │ ├── ConnectionStringOverrides │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ ├── DetectUnexpectedOtelMetrics │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ ├── InstrumentationKeyOverrides │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── logback-test.xml │ │ │ └── applicationinsights.json │ ├── OutOfMemoryWithDebugLevel │ │ └── build.gradle.kts │ ├── PreAggMetricsWithRoleNameOverridesAndSampling │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── logback-test.xml │ │ │ └── applicationinsights.json │ ├── Log4j1 │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── applicationinsights.json │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ ├── resources │ │ │ └── log4j.xml │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── HealthCheckServlet.java │ ├── Jedis │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── disabled_applicationinsights.json │ │ │ └── logback-test.xml │ ├── Micrometer │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── microsoft │ │ │ │ │ └── applicationinsights │ │ │ │ │ └── smoketestapp │ │ │ │ │ └── SpringBootApp.java │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ ├── namespace_applicationinsights.json │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── ActuatorMetrics │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── microsoft │ │ │ │ │ └── applicationinsights │ │ │ │ │ └── smoketestapp │ │ │ │ │ ├── SpringBootApp.java │ │ │ │ │ └── TestController.java │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── Logback │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── level_off_applicationinsights.json │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ ├── applicationinsights.json │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ ├── resources │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ ├── HealthCheckServlet.java │ │ │ └── LogbackWithSpanExceptionServlet.java │ ├── CoreAndFilter3x │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ ├── webapp │ │ │ └── doPageView.jsp │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── HealthCheckServlet.java │ ├── Lettuce │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── disabled_applicationinsights.json │ │ │ └── logback-test.xml │ ├── MongoDB │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── disabled_applicationinsights.json │ │ │ ├── unmasked_applicationinsights.json │ │ │ └── logback-test.xml │ ├── SamplingOverridesBackCompat │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── logback-test.xml │ │ │ └── applicationinsights2.json │ ├── BrowserSdkLoader │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ ├── applicationinsights.json │ │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── static │ │ │ │ └── test.html │ │ └── build.gradle.kts │ ├── Cassandra │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── disabled_applicationinsights.json │ │ │ └── logback-test.xml │ ├── CoreAndFilter3xUsingOld3xAgent │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── webapp │ │ │ └── doPageView.jsp │ ├── RateLimitedSampling │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── applicationinsights.json │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── HealthCheckServlet.java │ ├── WebAuto │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── SimpleServlet.java │ ├── AzureFunctions │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ ├── azure │ │ │ └── functions │ │ │ │ ├── worker │ │ │ │ └── handler │ │ │ │ │ ├── InvocationRequestHandler.java │ │ │ │ │ └── FunctionEnvironmentReloadRequestHandler.java │ │ │ │ └── rpc │ │ │ │ └── messages │ │ │ │ ├── InvocationRequest.java │ │ │ │ └── RpcTraceContext.java │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── TestController.java │ ├── VerifyAgentJar │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── SpringBootApp.java │ ├── WebFlux │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── SpringBootApp.java │ ├── CustomInstrumentation │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── logback-test.xml │ │ │ │ └── applicationinsights.json │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── SpringBootApp.java │ ├── PreferForwardedUrlScheme │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── SpringBootApp.java │ ├── DiagnosticExtension │ │ ├── MockExtension │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ └── com.microsoft.applicationinsights.diagnostics.DiagnosticEngineFactory │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ ├── logback-test.xml │ │ │ │ │ └── applicationinsights.json │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── smoketestapp │ │ │ │ └── SpringBootApp.java │ │ └── build.gradle.kts │ ├── Sampling │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── applicationinsights.json │ │ │ ├── applicationinsights-ingestion-sampling.json │ │ │ ├── applicationinsights-ingestion-sampling-disabled.json │ │ │ └── logback-test.xml │ ├── RuntimeAttach │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── applicationinsights.json │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── microsoft │ │ │ │ │ └── applicationinsights │ │ │ │ │ └── smoketestapp │ │ │ │ │ └── TestController.java │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── Log4j2 │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ ├── applicationinsights.json │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ ├── resources │ │ │ └── log4j2.xml │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── HealthCheckServlet.java │ ├── SpringScheduling │ │ ├── src │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ ├── applicationinsights.json │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── SamplingOverrides │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── logback-test.xml │ │ │ │ ├── applicationinsights-urlquery.json │ │ │ │ └── applicationinsights2.json │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── ExceptionSamplingOverridesServlet.java │ ├── JavaProfiler │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── applicationinsights-disabled.json │ │ │ │ └── applicationinsights-enabled.json │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ ├── TestController.java │ │ │ └── SpringBootApp.java │ ├── NonDaemonThreads │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ ├── SystemExit │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── SpringBootApp.java │ ├── InheritedAttributes │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── applicationinsights.json │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── SpringBootApp.java │ ├── AutoPerfCounters │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ ├── applicationinsights.json │ │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── smoketestapp │ │ │ │ └── HealthCheckServlet.java │ │ └── build.gradle.kts │ ├── SpringBootAuto1_3 │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ ├── RuntimeAttachWithDelayedConnectionString │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── applicationinsights.json │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── microsoft │ │ │ │ │ └── applicationinsights │ │ │ │ │ └── smoketestapp │ │ │ │ │ └── TestController.java │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── JMS │ │ ├── src │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ ├── controller_spans_enabled_applicationinsights.json │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── Kafka │ │ ├── src │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ ├── controller_spans_enabled_applicationinsights.json │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── AzureSdk │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ ├── controller_spans_enabled_applicationinsights.json │ │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ │ └── webapp │ │ │ │ └── WEB-INF │ │ │ │ └── jboss-deployment-structure.xml │ │ └── build.gradle.kts │ ├── HttpServer4xx │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ ├── httpserver4xx_applicationinsights.json │ │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── smoketestapp │ │ │ │ └── TestController.java │ │ └── build.gradle.kts │ ├── JettyNativeHandler │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ ├── SpringBoot │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ ├── controller_spans_enabled_applicationinsights.json │ │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ │ └── resources │ │ │ │ └── application.properties │ │ └── build.gradle.kts │ ├── Jdbc │ │ ├── src │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ ├── disabled_applicationinsights.json │ │ │ │ ├── unmasked_applicationinsights.json │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── LiveMetrics │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ ├── SpringCloudStream │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ ├── controller_spans_enabled_applicationinsights.json │ │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ │ ├── resources │ │ │ │ └── application.yaml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── smoketestapp │ │ │ │ ├── StreamsConfig.java │ │ │ │ ├── SpringBootApp.java │ │ │ │ ├── Greetings.java │ │ │ │ └── GreetingsListener.java │ │ └── build.gradle.kts │ ├── OpenTelemetryApiSupport │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── controller_spans_enabled_applicationinsights.json │ │ │ └── logback-test.xml │ ├── ClassicSdkLog4j1Interop2x │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── applicationinsights.json │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── HealthCheckServlet.java │ ├── ClassicSdkLog4j2Interop2x │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── applicationinsights.json │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ ├── resources │ │ │ └── log4j2.xml │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── HealthCheckServlet.java │ ├── ClassicSdkLogbackInterop2x │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ ├── applicationinsights.json │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ ├── resources │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── HealthCheckServlet.java │ ├── OpenTelemetryMetric │ │ ├── src │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ ├── applicationinsights.json │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── CustomDimensions │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ ├── applicationinsights.json │ │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── smoketestapp │ │ │ │ └── TestController.java │ │ └── build.gradle.kts │ ├── HttpHeaders │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ ├── HttpServer │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── TestController.java │ ├── SpringBootAuto │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── smokeTest │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── smoketestapp │ │ │ └── TestController.java │ ├── OpenTelemetryApiLogBridge │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ ├── Diagnostics │ │ ├── JfrFileReader │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── jfrfile │ │ │ │ └── JfrFileReader.java │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ ├── logback-test.xml │ │ │ │ │ └── applicationinsights.json │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── smoketestapp │ │ │ │ └── SpringBootApp.java │ │ └── build.gradle.kts │ ├── HttpClients │ │ ├── src │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── JmxMetric │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── smoketestapp │ │ │ │ └── TestController.java │ │ └── build.gradle.kts │ ├── OtlpMetrics │ │ └── src │ │ │ └── smokeTest │ │ │ └── resources │ │ │ ├── logback-test.xml │ │ │ └── applicationinsights.json │ ├── CoreAndFilter2x │ │ ├── src │ │ │ ├── smokeTest │ │ │ │ └── resources │ │ │ │ │ └── logback-test.xml │ │ │ └── main │ │ │ │ ├── webapp │ │ │ │ ├── doPageView.jsp │ │ │ │ └── WEB-INF │ │ │ │ │ └── web.xml │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── smoketestapp │ │ │ │ └── HealthCheckServlet.java │ │ └── build.gradle.kts │ ├── ClassicSdkWebInterop2x │ │ ├── src │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── ClassicSdkWebInterop3x │ │ ├── src │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── build.gradle.kts │ ├── TelemetryProcessors │ │ ├── src │ │ │ └── smokeTest │ │ │ │ └── resources │ │ │ │ ├── logback-test.xml │ │ │ │ └── applicationinsights-delete-existing-attribute.json │ │ └── build.gradle.kts │ └── ClassicSdkWebInterop3xUsingOld3xAgent │ │ ├── src │ │ └── smokeTest │ │ │ └── resources │ │ │ └── logback-test.xml │ │ └── build.gradle.kts └── framework │ └── src │ └── main │ ├── resources │ └── default_applicationinsights.json │ └── java │ └── com │ └── microsoft │ └── applicationinsights │ └── smoketest │ ├── fakeingestion │ └── ProfilerState.java │ ├── schemav2 │ ├── Domain.java │ ├── DataPointType.java │ └── Base.java │ ├── Environment.java │ └── TargetUri.java ├── perf-tests ├── settings.gradle ├── applicationinsights.json └── gradle │ └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitattributes ├── .github ├── scripts │ ├── get-version.sh │ ├── update-version.sh │ └── draft-change-log-entries.sh ├── PULL_REQUEST_TEMPLATE.md ├── workflows │ ├── build-daily.yml │ ├── build-daily-no-build-cache.yml │ └── build.yml ├── CODEOWNERS └── ISSUE_TEMPLATE │ └── feature_request.md ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── docs ├── intellij-debug-smoke-test-part-1.png └── intellij-debug-smoke-test-part-2.png ├── agent ├── agent-tooling │ └── src │ │ ├── test │ │ ├── resources │ │ │ ├── applicationinsights_NoRole.json │ │ │ ├── applicationinsights_with_utf8_bom.json │ │ │ ├── applicationinsights-rp.json │ │ │ ├── applicationinsights_statsbeatdisabledenv.json │ │ │ ├── applicationinsights_aadauth.json │ │ │ ├── applicationinsights_aadauthenv.json │ │ │ └── logback-test.xml │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── agent │ │ │ └── internal │ │ │ ├── logbackpatch │ │ │ └── FileNamePatternTest.java │ │ │ └── diagnostics │ │ │ └── DiagnosticsTestHelper.java │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ ├── io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider │ │ │ ├── io.opentelemetry.sdk.autoconfigure.spi.metrics.ConfigurableMetricExporterProvider │ │ │ └── io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider │ │ └── java │ │ ├── com │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── agent │ │ │ └── internal │ │ │ ├── configuration │ │ │ └── GcReportingLevel.java │ │ │ ├── profiler │ │ │ ├── upload │ │ │ │ ├── UploadListener.java │ │ │ │ └── UploadFailedException.java │ │ │ └── ProfileTypes.java │ │ │ ├── perfcounter │ │ │ ├── PerformanceCounter.java │ │ │ └── JmxAttributeData.java │ │ │ ├── diagnostics │ │ │ └── DiagnosticsValueFinder.java │ │ │ └── init │ │ │ └── AiContextKeys.java │ │ └── io │ │ └── opentelemetry │ │ └── sdk │ │ └── metrics │ │ ├── ViewBuilderAccessor.java │ │ └── internal │ │ └── view │ │ └── UserAgents.java ├── agent │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── inst │ │ │ └── META-INF │ │ │ └── services │ │ │ └── io.opentelemetry.javaagent.slf4j.spi.SLF4JServiceProvider │ └── jar_contents.regex ├── instrumentation │ ├── azure-functions-worker-stub │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── azure │ │ │ └── functions │ │ │ ├── rpc │ │ │ └── messages │ │ │ │ ├── InvocationRequest.java │ │ │ │ └── RpcTraceContext.java │ │ │ └── worker │ │ │ └── handler │ │ │ └── InvocationRequestHandler.java │ └── applicationinsights-web-2.3 │ │ └── src │ │ └── main │ │ └── java │ │ └── io │ │ └── opentelemetry │ │ └── javaagent │ │ └── instrumentation │ │ └── applicationinsightsweb │ │ └── MoreJava8BytecodeBridge.java ├── agent-gc-monitor │ ├── gc-monitor-api │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── gcmonitor │ │ │ ├── GcEventConsumer.java │ │ │ ├── garbagecollectors │ │ │ └── GarbageCollectorStats.java │ │ │ ├── UnableToMonitorMemoryException.java │ │ │ └── GcMonitorFactory.java │ ├── gc-monitor-tests │ │ ├── src │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── gcmonitortests │ │ │ │ └── GcNotPresentException.java │ │ └── build.gradle.kts │ └── gc-monitor-core │ │ └── build.gradle.kts ├── agent-profiler │ ├── agent-diagnostics-api │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── diagnostics │ │ │ │ ├── Diagnosis.java │ │ │ │ ├── DiagnosisResult.java │ │ │ │ └── DiagnosticEngineFactory.java │ │ └── build.gradle.kts │ ├── agent-alerting │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── microsoft │ │ │ │ │ └── applicationinsights │ │ │ │ │ └── alerting │ │ │ │ │ ├── package-info.java │ │ │ │ │ └── analysis │ │ │ │ │ ├── aggregations │ │ │ │ │ └── windowed │ │ │ │ │ │ └── BucketData.java │ │ │ │ │ └── TimeSource.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── alerting │ │ │ │ └── TestTimeSource.java │ │ └── build.gradle.kts │ ├── agent-diagnostics │ │ └── src │ │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── microsoft │ │ │ └── applicationinsights │ │ │ └── diagnostics │ │ │ └── collection │ │ │ ├── cores │ │ │ ├── CoreCounter.java │ │ │ └── RuntimeCoreCounter.java │ │ │ ├── calibration │ │ │ ├── Calibrator.java │ │ │ └── Calibration.java │ │ │ └── libos │ │ │ ├── net │ │ │ ├── TcpStatsReader.java │ │ │ └── GlobalNetworkStats.java │ │ │ ├── process │ │ │ ├── ThisPidSupplier.java │ │ │ ├── ProcessInfo.java │ │ │ ├── ProcessDumper.java │ │ │ └── ProcessIoStats.java │ │ │ ├── kernel │ │ │ ├── GlobalDiskStats.java │ │ │ └── KernelStatsReader.java │ │ │ ├── TwoStepUpdatable.java │ │ │ ├── UnsupportedPlatformException.java │ │ │ ├── hardware │ │ │ └── MemoryInfoReader.java │ │ │ ├── os │ │ │ └── linux │ │ │ │ ├── cgroups │ │ │ │ ├── CGroupCpuUsageReader.java │ │ │ │ ├── CGroupCpuUserReader.java │ │ │ │ └── CGroupCpuSystemReader.java │ │ │ │ └── DiskNames.java │ │ │ ├── OperatingSystem.java │ │ │ └── OperatingSystemInteractionException.java │ ├── agent-alerting-api │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── microsoft │ │ │ │ └── applicationinsights │ │ │ │ └── alerting │ │ │ │ └── config │ │ │ │ └── AlertMetricType.java │ │ └── build.gradle.kts │ └── agent-diagnostics-jfr │ │ └── build.gradle.kts ├── agent-bootstrap │ └── build.gradle.kts └── runtime-attach │ └── build.gradle.kts ├── .gitignore ├── licenses ├── commons-codec-1.20.0.jar │ └── META-INF │ │ └── NOTICE.txt ├── commons-lang3-3.18.0.jar │ └── META-INF │ │ └── NOTICE.txt ├── commons-text-1.14.0.jar │ └── META-INF │ │ └── NOTICE.txt └── jackson-datatype-jsr310-2.20.1.jar │ └── META-INF │ ├── LICENSE │ └── NOTICE ├── .config └── tsaoptions.json ├── etw ├── java │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── microsoft │ │ └── applicationinsights │ │ └── agent │ │ └── internal │ │ └── diagnostics │ │ └── etw │ │ ├── events │ │ └── model │ │ │ ├── IpaEtwEvent.java │ │ │ └── IpaEtwEventId.java │ │ └── ApplicationInsightsEtwException.java └── etw-testapp │ └── build.gradle.kts ├── classic-sdk ├── core │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── microsoft │ │ └── applicationinsights │ │ ├── TelemetryConfiguration.java │ │ ├── telemetry │ │ ├── Preconditions.java │ │ └── SeverityLevel.java │ │ └── internal │ │ └── schemav2 │ │ ├── DataPointType.java │ │ ├── DependencyKind.java │ │ ├── SeverityLevel.java │ │ └── PageViewData.java └── web │ ├── build.gradle.kts │ └── src │ └── main │ └── java │ └── com │ └── microsoft │ └── applicationinsights │ └── web │ └── internal │ └── ThreadContext.java ├── CODE_OF_CONDUCT.md ├── gradle.properties ├── README.md └── .devcontainer └── devcontainer.json /smoke-tests/apps/gRPC/.gitignore: -------------------------------------------------------------------------------- 1 | /src/generated/ 2 | -------------------------------------------------------------------------------- /perf-tests/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'perf-test' 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | 3 | *.bat text eol=crlf 4 | *.cmd text eol=crlf 5 | -------------------------------------------------------------------------------- /smoke-tests/apps/HeartBeat/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/ReadOnly/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/Statsbeat/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /perf-tests/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectionStringConfiguredAtRuntime": true 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/JavaUtilLogging/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/RoleNameOverrides/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpPreaggregatedMetrics/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/OtelResourceCustomMetric/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/ConnectionStringOverrides/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/DetectUnexpectedOtelMetrics/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/InstrumentationKeyOverrides/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/OutOfMemoryWithDebugLevel/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /.github/scripts/get-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | grep -Po "version=\K[0-9]+.[0-9]+.[0-9]+" gradle.properties 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/PreAggMetricsWithRoleNameOverridesAndSampling/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ApplicationInsights-Java/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.github/scripts/update-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | version=$1 4 | 5 | sed -i "s/version=.*/version=$version/" gradle.properties 6 | -------------------------------------------------------------------------------- /docs/intellij-debug-smoke-test-part-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ApplicationInsights-Java/HEAD/docs/intellij-debug-smoke-test-part-1.png -------------------------------------------------------------------------------- /docs/intellij-debug-smoke-test-part-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ApplicationInsights-Java/HEAD/docs/intellij-debug-smoke-test-part-2.png -------------------------------------------------------------------------------- /smoke-tests/apps/RoleNameOverrides/src/smokeTest/resources/aks_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "sampling": { 3 | "percentage": 100 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /perf-tests/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ApplicationInsights-Java/HEAD/perf-tests/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /smoke-tests/apps/OtelResourceCustomMetric/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "sampling": { 3 | "percentage": 100 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j1/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("log4j:log4j:1.2.17") 7 | } 8 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/test/resources/applicationinsights_NoRole.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000" 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/Jedis/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("redis.clients:jedis:2+") 7 | } 8 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/test/resources/applicationinsights_with_utf8_bom.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000" 3 | } 4 | -------------------------------------------------------------------------------- /smoke-tests/apps/Micrometer/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | management.metrics.export.azuremonitor.instrumentation-key=00000000-0000-0000-0000-000000000000 2 | -------------------------------------------------------------------------------- /smoke-tests/apps/ActuatorMetrics/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | management.metrics.export.azuremonitor.instrumentation-key=00000000-0000-0000-0000-000000000000 2 | -------------------------------------------------------------------------------- /smoke-tests/apps/Logback/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("ch.qos.logback:logback-classic") 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter3x/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation(project(":classic-sdk:core")) 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/Lettuce/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("io.lettuce:lettuce-core:5.2.2.RELEASE") 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/MongoDB/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.mongodb:mongodb-driver:3.11.0") 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/SamplingOverridesBackCompat/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.hsqldb:hsqldb:2.5.1") 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/BrowserSdkLoader/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "preview": { 3 | "browserSdkLoader": 4 | { 5 | "enabled": true 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/Cassandra/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("com.datastax.cassandra:cassandra-driver-core:3.8.0") 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter3xUsingOld3xAgent/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation(project(":classic-sdk:core")) 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/RateLimitedSampling/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.apache.httpcomponents:httpclient:4.5.7") 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/WebAuto/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("com.microsoft.azure:applicationinsights-web-auto:2.6.4") 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Gradle 2 | /.gradle/ 3 | /buildSrc/.gradle/ 4 | /perf-tests/.gradle/ 5 | /buildSrc/.kotlin/ 6 | build/ 7 | 8 | # Intellij 9 | /.idea/ 10 | 11 | # VSCode 12 | /.vscode/ 13 | bin/ 14 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureFunctions/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/VerifyAgentJar/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/WebFlux/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-webflux:2.5.12") 7 | } 8 | -------------------------------------------------------------------------------- /agent/agent/src/main/resources/inst/META-INF/services/io.opentelemetry.javaagent.slf4j.spi.SLF4JServiceProvider: -------------------------------------------------------------------------------- 1 | com.microsoft.applicationinsights.agent.shadow.ch.qos.logback.classic.spi.LogbackServiceProvider 2 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/test/resources/applicationinsights-rp.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectionString": "InstrumentationKey=11111111-1111-1111-1111-111111111111", 3 | "sampling": { 4 | "percentage": 9.9 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /smoke-tests/apps/CustomInstrumentation/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | } 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/PreferForwardedUrlScheme/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | } 8 | -------------------------------------------------------------------------------- /agent/instrumentation/azure-functions-worker-stub/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | } 4 | 5 | // this module is needed since the azure functions worker artifact is not available in maven central 6 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider: -------------------------------------------------------------------------------- 1 | com.azure.monitor.opentelemetry.autoconfigure.implementation.AzureMonitorSpanExporterProvider 2 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.metrics.ConfigurableMetricExporterProvider: -------------------------------------------------------------------------------- 1 | com.azure.monitor.opentelemetry.autoconfigure.implementation.AzureMonitorMetricExporterProvider 2 | -------------------------------------------------------------------------------- /smoke-tests/apps/DiagnosticExtension/MockExtension/src/main/resources/META-INF/services/com.microsoft.applicationinsights.diagnostics.DiagnosticEngineFactory: -------------------------------------------------------------------------------- 1 | com.microsoft.applicationinsights.smoketestextension.MockDiagnosticEngineFactory -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/resources/META-INF/services/io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider: -------------------------------------------------------------------------------- 1 | com.azure.monitor.opentelemetry.autoconfigure.implementation.AzureMonitorLogRecordExporterProvider 2 | -------------------------------------------------------------------------------- /smoke-tests/apps/Sampling/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation(project(":classic-sdk:core")) 7 | implementation("org.apache.httpcomponents:httpclient:4.5.7") 8 | } 9 | -------------------------------------------------------------------------------- /licenses/commons-codec-1.20.0.jar/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Apache Commons Codec 2 | Copyright 2002-2025 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (https://www.apache.org/). 6 | -------------------------------------------------------------------------------- /licenses/commons-lang3-3.18.0.jar/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Apache Commons Lang 2 | Copyright 2001-2025 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (https://www.apache.org/). 6 | -------------------------------------------------------------------------------- /licenses/commons-text-1.14.0.jar/META-INF/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Apache Commons Text 2 | Copyright 2014-2025 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (https://www.apache.org/). 6 | -------------------------------------------------------------------------------- /smoke-tests/apps/RuntimeAttach/src/main/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /smoke-tests/apps/Sampling/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 50 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /smoke-tests/framework/src/main/resources/default_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /agent/agent-gc-monitor/gc-monitor-api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | } 4 | 5 | dependencies { 6 | implementation("org.slf4j:slf4j-api") 7 | implementation("com.google.errorprone:error_prone_annotations") 8 | } 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j2/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.apache.logging.log4j:log4j-api:2.17.1") 7 | implementation("org.apache.logging.log4j:log4j-core:2.17.1") 8 | } 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringScheduling/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Fix # . 2 | 3 | 4 | For significant contributions please make sure you have completed the following items: 5 | 6 | - [ ] Design discussion issue # 7 | - [ ] Changes in public surface reviewed 8 | - [ ] CHANGELOG.md updated 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/SamplingOverrides/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.hsqldb:hsqldb:2.5.1") 7 | 8 | smokeTestImplementation("org.awaitility:awaitility:4.2.0") 9 | } 10 | -------------------------------------------------------------------------------- /smoke-tests/apps/JavaProfiler/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | testImplementation(project(":smoke-tests:framework")) 7 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 8 | } 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/Micrometer/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | implementation("io.micrometer:micrometer-core:1.4.1") 8 | } 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/RateLimitedSampling/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling" : { 7 | "requestsPerSecond": 0.5 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /smoke-tests/apps/Sampling/src/smokeTest/resources/applicationinsights-ingestion-sampling.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/test/resources/applicationinsights_statsbeatdisabledenv.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000", 3 | "preview": { 4 | "statsbeat": { 5 | "disabled": false 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/NonDaemonThreads/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | implementation("com.squareup.okhttp3:okhttp:3.12.1") 8 | } 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/SystemExit/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | implementation("io.opentelemetry:opentelemetry-api:1.12.0") 8 | } 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/InheritedAttributes/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | 8 | implementation(project(":classic-sdk:web")) 9 | } 10 | -------------------------------------------------------------------------------- /smoke-tests/apps/RuntimeAttach/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation(project(":agent:runtime-attach")) 7 | 8 | implementation("org.springframework.boot:spring-boot-starter-web:2.2.0.RELEASE") 9 | } 10 | -------------------------------------------------------------------------------- /smoke-tests/apps/AutoPerfCounters/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "metricIntervalSeconds": 5 10 | } 11 | -------------------------------------------------------------------------------- /smoke-tests/apps/ActuatorMetrics/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | implementation("org.springframework.boot:spring-boot-starter-actuator:2.5.12") 8 | } 9 | -------------------------------------------------------------------------------- /.github/workflows/build-daily.yml: -------------------------------------------------------------------------------- 1 | name: Build (daily) 2 | 3 | on: 4 | schedule: 5 | # strange schedule to reduce the risk of DDOS GitHub infra 6 | - cron: "24 3 * * *" 7 | workflow_dispatch: 8 | 9 | jobs: 10 | common: 11 | uses: ./.github/workflows/build-common.yml 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/HeartBeat/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "heartbeat": { 10 | "intervalSeconds": 5 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringBootAuto1_3/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:1.3.8.RELEASE") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /agent/agent-gc-monitor/gc-monitor-tests/src/test/java/com/microsoft/gcmonitortests/GcNotPresentException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.gcmonitortests; 5 | 6 | public class GcNotPresentException extends Exception {} 7 | -------------------------------------------------------------------------------- /smoke-tests/apps/RuntimeAttachWithDelayedConnectionString/src/main/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectionStringConfiguredAtRuntime": true, 3 | "role": { 4 | "name": "testrolename", 5 | "instance": "testroleinstance" 6 | }, 7 | "sampling": { 8 | "percentage": 100 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /perf-tests/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/JMS/src/smokeTest/resources/controller_spans_enabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "captureControllerSpans": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/Kafka/src/smokeTest/resources/controller_spans_enabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "captureControllerSpans": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureSdk/src/smokeTest/resources/controller_spans_enabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "captureControllerSpans": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpServer4xx/src/smokeTest/resources/httpserver4xx_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "captureHttpServer4xxAsError": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/JettyNativeHandler/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter:2.5.12") 7 | 8 | // jetty 10 is compiled against Java 11 9 | implementation("org.eclipse.jetty:jetty-server:9.4.49.v20220914") 10 | } 11 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j1/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "level": "warn" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringBoot/src/smokeTest/resources/controller_spans_enabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "captureControllerSpans": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/JMS/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "jms": { 11 | "enabled": false 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Jdbc/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "jdbc": { 11 | "enabled": false 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.config/tsaoptions.json: -------------------------------------------------------------------------------- 1 | { 2 | "instanceUrl" : "https://msazure.visualstudio.com", 3 | "areaPath" : "One\\TelReachSDKTeam", 4 | "projectName" : "One", 5 | "iterationPath" : "One", 6 | "notificationAliases": [ 7 | "appinsightsjavahelp@microsoft.com" 8 | ], 9 | "ignoreBranchName" : true 10 | } -------------------------------------------------------------------------------- /smoke-tests/apps/JavaUtilLogging/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "level": "warn" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Jedis/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "redis": { 11 | "enabled": false 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Kafka/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "kafka": { 11 | "enabled": false 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Lettuce/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "redis": { 11 | "enabled": false 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/LiveMetrics/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | smokeTestImplementation("org.awaitility:awaitility:4.2.0") 7 | implementation("log4j:log4j:1.2.17") 8 | implementation("io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:1.22.1") 9 | } 10 | -------------------------------------------------------------------------------- /smoke-tests/apps/Logback/src/smokeTest/resources/level_off_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "level": "off" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/MongoDB/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "mongo": { 11 | "enabled": false 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringCloudStream/src/smokeTest/resources/controller_spans_enabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "captureControllerSpans": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureSdk/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "azureSdk": { 11 | "enabled": false 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Cassandra/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "cassandra": { 11 | "enabled": false 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j1/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "enabled": "false" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j2/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "enabled": "false" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Logback/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "enabled": "false" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/OpenTelemetryApiSupport/src/smokeTest/resources/controller_spans_enabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "captureControllerSpans": true 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLog4j1Interop2x/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "level": "warn" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLog4j2Interop2x/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "level": "warn" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLogbackInterop2x/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "level": "warn" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/JMS/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | implementation("org.springframework.boot:spring-boot-starter-activemq:2.5.12") 8 | implementation("org.apache.httpcomponents:httpclient:4.5.13") 9 | } 10 | -------------------------------------------------------------------------------- /smoke-tests/apps/JavaUtilLogging/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "enabled": "false" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/RuntimeAttachWithDelayedConnectionString/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation(project(":agent:runtime-attach")) 7 | implementation(project(":classic-sdk:core")) 8 | 9 | implementation("org.springframework.boot:spring-boot-starter-web:2.2.0.RELEASE") 10 | } 11 | -------------------------------------------------------------------------------- /agent/agent-gc-monitor/gc-monitor-api/src/main/java/com/microsoft/gcmonitor/GcEventConsumer.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.gcmonitor; 5 | 6 | import java.util.function.Consumer; 7 | 8 | public interface GcEventConsumer extends Consumer {} 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/OpenTelemetryMetric/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "customDimensions": { 10 | "tag1": "abc", 11 | "tag2": "def", 12 | "service.version": "123" 13 | } 14 | } -------------------------------------------------------------------------------- /smoke-tests/apps/SpringScheduling/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "springScheduling": { 11 | "enabled": false 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflows/build-daily-no-build-cache.yml: -------------------------------------------------------------------------------- 1 | name: Build (daily, --no-build-cache) 2 | 3 | on: 4 | schedule: 5 | # strange schedule to reduce the risk of DDOS GitHub infra 6 | - cron: "48 4 * * *" 7 | workflow_dispatch: 8 | 9 | jobs: 10 | common: 11 | uses: ./.github/workflows/build-common.yml 12 | with: 13 | no-build-cache: true 14 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics-api/src/main/java/com/microsoft/applicationinsights/diagnostics/Diagnosis.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics; 5 | 6 | /** Interface used as a marker for all Diagnoses. */ 7 | public interface Diagnosis {} 8 | -------------------------------------------------------------------------------- /smoke-tests/apps/CustomDimensions/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "customDimensions": { 10 | "test": "value", 11 | "home": "${HOME}", 12 | "service.version": "123" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Sampling/src/smokeTest/resources/applicationinsights-ingestion-sampling-disabled.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "sampling": { 11 | "ingestionSamplingEnabled": false 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-alerting/src/main/java/com/microsoft/applicationinsights/alerting/package-info.java: -------------------------------------------------------------------------------- 1 | package com.microsoft.applicationinsights.alerting; 2 | 3 | /* 4 | Provides an alert service that monitors incoming telemetry (currently CPU and MEMORY supported). 5 | When a metrics rolling average moves above a configured threshold, an alert is issued. 6 | */ 7 | -------------------------------------------------------------------------------- /smoke-tests/apps/Jdbc/src/smokeTest/resources/unmasked_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "jdbc": { 11 | "masking": { 12 | "enabled": false 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /etw/java/src/main/java/com/microsoft/applicationinsights/agent/internal/diagnostics/etw/events/model/IpaEtwEvent.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.diagnostics.etw.events.model; 5 | 6 | public interface IpaEtwEvent { 7 | IpaEtwEventId id(); 8 | } 9 | -------------------------------------------------------------------------------- /smoke-tests/apps/MongoDB/src/smokeTest/resources/unmasked_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "mongo": { 11 | "masking": { 12 | "enabled": false 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /agent/agent-gc-monitor/gc-monitor-core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | } 4 | 5 | dependencies { 6 | compileOnly("com.google.auto.service:auto-service") 7 | annotationProcessor("com.google.auto.service:auto-service") 8 | 9 | implementation(project(":agent:agent-gc-monitor:gc-monitor-api")) 10 | implementation("org.slf4j:slf4j-api") 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Jdbc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.hsqldb:hsqldb:2.3.6") // 2.4.0+ requires Java 8+ 7 | implementation("mysql:mysql-connector-java:5.1.49") 8 | implementation("org.postgresql:postgresql:42.2.16.jre7") 9 | implementation("com.microsoft.sqlserver:mssql-jdbc:8.4.1.jre8") 10 | } 11 | -------------------------------------------------------------------------------- /smoke-tests/apps/Micrometer/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "micrometer": { 11 | "enabled": false 12 | } 13 | }, 14 | "metricIntervalSeconds": 5 15 | } 16 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/configuration/GcReportingLevel.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.configuration; 5 | 6 | public enum GcReportingLevel { 7 | NONE, 8 | TENURED_ONLY, 9 | ALL 10 | } 11 | -------------------------------------------------------------------------------- /smoke-tests/apps/ActuatorMetrics/src/smokeTest/resources/disabled_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "micrometer": { 11 | "enabled": false 12 | } 13 | }, 14 | "metricIntervalSeconds": 5 15 | } 16 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/cores/CoreCounter.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.cores; 5 | 6 | public interface CoreCounter { 7 | 8 | int getCoreCount(); 9 | } 10 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j2/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "level": "warn" 12 | } 13 | }, 14 | "preview": { 15 | "captureLog4jMarker": true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/Micrometer/src/smokeTest/resources/namespace_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "micrometer": { 11 | "namespace": "testNamespace" 12 | } 13 | }, 14 | "metricIntervalSeconds": 5 15 | } 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/gRPC/src/main/proto/helloworld.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package example; 4 | 5 | service Greeter { 6 | rpc SayHello (Request) returns (Response) { 7 | } 8 | 9 | rpc Conversation (stream Response) returns (stream Response) { 10 | } 11 | } 12 | 13 | message Request { 14 | string name = 1; 15 | } 16 | 17 | message Response { 18 | string message = 1; 19 | } 20 | -------------------------------------------------------------------------------- /smoke-tests/apps/InheritedAttributes/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "inheritedAttributes": [ 11 | { 12 | "key": "tenant", 13 | "type": "string" 14 | } 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /agent/agent-gc-monitor/gc-monitor-tests/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | } 4 | 5 | dependencies { 6 | testImplementation(project(":agent:agent-gc-monitor:gc-monitor-core")) 7 | testImplementation(project(":agent:agent-gc-monitor:gc-monitor-api")) 8 | 9 | testImplementation("org.junit.jupiter:junit-jupiter") 10 | testImplementation("org.assertj:assertj-core") 11 | } 12 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/calibration/Calibrator.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.calibration; 5 | 6 | public interface Calibrator { 7 | 8 | Calibration calibrate(); 9 | } 10 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/net/TcpStatsReader.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.net; 5 | 6 | public interface TcpStatsReader { 7 | 8 | TcpStats getTcpStats(); 9 | } 10 | -------------------------------------------------------------------------------- /licenses/jackson-datatype-jsr310-2.20.1.jar/META-INF/LICENSE: -------------------------------------------------------------------------------- 1 | This copy of Jackson JSON processor Java 8 Date/Time module is licensed under the 2 | Apache (Software) License, version 2.0 ("the License"). 3 | See the License for details about distribution rights, and the 4 | specific rights regarding derivative works. 5 | 6 | You may obtain a copy of the License at: 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-alerting-api/src/main/java/com/microsoft/applicationinsights/alerting/config/AlertMetricType.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.alerting.config; 5 | 6 | public enum AlertMetricType { 7 | CPU, 8 | MEMORY, 9 | PERIODIC, 10 | MANUAL, 11 | REQUEST; 12 | } 13 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/test/resources/applicationinsights_aadauth.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000", 3 | "authentication": { 4 | "enabled": true, 5 | "type": "SAMI", 6 | "clientId": "123xyz", 7 | "tenantId": "tenant123", 8 | "clientSecret": "clientsecret123", 9 | "authorityHost": "https://test.com/microsoft/" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpHeaders/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | // this dependency is needed to make wildfly happy 10 | implementation("org.reactivestreams:reactive-streams:1.0.3") 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpServer/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | // this dependency is needed to make wildfly happy 10 | implementation("org.reactivestreams:reactive-streams:1.0.3") 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpServer4xx/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | // this dependency is needed to make wildfly happy 10 | implementation("org.reactivestreams:reactive-streams:1.0.3") 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringBootAuto/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | // this dependency is needed to make wildfly happy 10 | implementation("org.reactivestreams:reactive-streams:1.0.3") 11 | } 12 | -------------------------------------------------------------------------------- /agent/agent/jar_contents.regex: -------------------------------------------------------------------------------- 1 | com/ 2 | com/microsoft/ 3 | com/microsoft/applicationinsights/ 4 | com/microsoft/applicationinsights/agent/.* 5 | io/ 6 | io/opentelemetry/ 7 | io/opentelemetry/javaagent/.* 8 | META-INF/ 9 | META-INF/MANIFEST\.MF 10 | LICENSE 11 | NOTICE 12 | ai\.sdk-version\.properties 13 | applicationinsights-java-etw-provider-x86-64\.dll 14 | applicationinsights-java-etw-provider-x86\.dll 15 | inst/.* -------------------------------------------------------------------------------- /smoke-tests/apps/CustomDimensions/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | // this dependency is needed to make wildfly happy 10 | implementation("org.reactivestreams:reactive-streams:1.0.3") 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringScheduling/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | // this dependency is needed to make wildfly happy 10 | implementation("org.reactivestreams:reactive-streams:1.0.3") 11 | } 12 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/test/resources/applicationinsights_aadauthenv.json: -------------------------------------------------------------------------------- 1 | { 2 | "connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000", 3 | "authentication": { 4 | "enabled": false, 5 | "type": "CLIENTSECRET", 6 | "clientId": "123xyz", 7 | "tenantId": "tenant123", 8 | "clientSecret": "clientsecret123", 9 | "authorityHost": "https://test.com/microsoft/" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/BrowserSdkLoader/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.1.7.RELEASE") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | // this dependency is needed to make wildfly happy 10 | implementation("org.reactivestreams:reactive-streams:1.0.3") 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/BrowserSdkLoader/src/main/resources/static/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Hello 7 | 11 | 12 | 13 |

h1 s

14 |

hello hello

15 | 16 | 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringCloudStream/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | stream: 4 | kafka: 5 | binder: 6 | brokers: ${KAFKA}:9092 7 | bindings: 8 | greetings-in: 9 | destination: greetings 10 | contentType: application/json 11 | greetings-out: 12 | destination: greetings 13 | contentType: application/json 14 | -------------------------------------------------------------------------------- /smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/fakeingestion/ProfilerState.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketest.fakeingestion; 5 | 6 | public enum ProfilerState { 7 | unconfigured, 8 | configuredEnabled, 9 | configuredDisabled, 10 | manualprofile 11 | } 12 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /classic-sdk/core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | id("ai.publish-conventions") 4 | } 5 | 6 | base.archivesName.set("applicationinsights-core") 7 | 8 | dependencies { 9 | compileOnly("com.github.spotbugs:spotbugs-annotations") 10 | } 11 | 12 | tasks { 13 | jar { 14 | manifest { 15 | attributes("Automatic-Module-Name" to "com.microsoft.applicationinsights") 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /smoke-tests/apps/AutoPerfCounters/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("com.microsoft.azure:applicationinsights-web:2.6.4") { 7 | // applicationinsights-core is embedded in applicationinsights-web 8 | // and duplicate class files produces lots of warning messages on jetty 9 | exclude("com.microsoft.azure", "applicationinsights-core") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics-api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | } 4 | 5 | // Allows publishing this library to the local host ONLY if -Ppublish-diagnostics is provided 6 | if (project.properties.containsKey("publish-diagnostics")) { 7 | apply(plugin = "ai.publish-conventions") 8 | } 9 | 10 | dependencies { 11 | implementation(project(":agent:agent-profiler:agent-alerting-api")) 12 | } 13 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/process/ThisPidSupplier.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.process; 5 | 6 | import java.util.function.Supplier; 7 | 8 | public interface ThisPidSupplier extends Supplier {} 9 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/profiler/upload/UploadListener.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.profiler.upload; 5 | 6 | @FunctionalInterface 7 | public interface UploadListener { 8 | void onUpload(ServiceProfilerIndex serviceProfilerIndex); 9 | } 10 | -------------------------------------------------------------------------------- /smoke-tests/apps/JMS/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/OpenTelemetryApiLogBridge/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | implementation("io.opentelemetry:opentelemetry-api:1.27.0") 10 | implementation("io.opentelemetry.semconv:opentelemetry-semconv") 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringCloudStream/src/main/java/com/microsoft/applicationinsights/smoketestapp/StreamsConfig.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.cloud.stream.annotation.EnableBinding; 7 | 8 | @EnableBinding(GreetingsStreams.class) 9 | public class StreamsConfig {} 10 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureSdk/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | // want to test with one of the earliest version supported, and not managed version used in agent 10 | implementation("com.azure:azure-core:1.39.0") 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureSdk/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Jdbc/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Jedis/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Kafka/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Lettuce/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j1/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j2/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Logback/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "instrumentation": { 10 | "logging": { 11 | "level": "warn" 12 | } 13 | }, 14 | "preview": { 15 | "captureLogbackCodeAttributes": true, 16 | "captureLogbackMarker": true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /smoke-tests/apps/Logback/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/MongoDB/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/ReadOnly/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Sampling/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/WebAuto/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/WebFlux/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/gRPC/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/schemav2/Domain.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketest.schemav2; 5 | 6 | /** Data contract class Domain. */ 7 | public abstract class Domain { 8 | /** Initializes a new instance of the Domain class. */ 9 | public Domain() {} 10 | } 11 | -------------------------------------------------------------------------------- /smoke-tests/apps/Cassandra/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Diagnostics/JfrFileReader/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | java 3 | } 4 | 5 | dependencies { 6 | compileOnly("org.gradle.jfr.polyfill:jfr-polyfill:1.0.0") 7 | } 8 | 9 | java { 10 | toolchain { 11 | languageVersion.set(JavaLanguageVersion.of(21)) 12 | } 13 | } 14 | 15 | tasks.withType().configureEach { 16 | with(options) { 17 | release.set(11) 18 | compilerArgs.add("-Werror") 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /smoke-tests/apps/Diagnostics/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/HeartBeat/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpClients/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpHeaders/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpServer/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpServer4xx/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/JmxMetric/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/LiveMetrics/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Micrometer/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/OtlpMetrics/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/RuntimeAttach/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringBoot/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Statsbeat/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SystemExit/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/ActuatorMetrics/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/AutoPerfCounters/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureFunctions/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/BrowserSdkLoader/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter2x/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter3x/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/CustomDimensions/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/JavaUtilLogging/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/JettyNativeHandler/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/NonDaemonThreads/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/RoleNameOverrides/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SamplingOverrides/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringBootAuto/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringBootAuto1_3/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringCloudStream/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringScheduling/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/VerifyAgentJar/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkWebInterop2x/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkWebInterop3x/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/CustomInstrumentation/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/DiagnosticExtension/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/OpenTelemetryApiSupport/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/OpenTelemetryMetric/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/RateLimitedSampling/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/TelemetryProcessors/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.github/scripts/draft-change-log-entries.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | prior_version=$1 4 | 5 | echo "### Enhancements" 6 | echo 7 | echo 8 | echo "### Bug fixes" 9 | echo 10 | 11 | git log --reverse \ 12 | --author='^(?!dependabot\[bot\] )' \ 13 | --perl-regexp \ 14 | --pretty=format:"* %s" \ 15 | $prior_version..HEAD \ 16 | | sed -E 's,\(#([0-9]+)\)$,\n ([#\1](https://github.com/microsoft/ApplicationInsights-Java/pull/\1)),' 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLog4j1Interop2x/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLog4j2Interop2x/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLogbackInterop2x/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/ConnectionStringOverrides/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/DetectUnexpectedOtelMetrics/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpPreaggregatedMetrics/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/InstrumentationKeyOverrides/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/OpenTelemetryApiLogBridge/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/PreferForwardedUrlScheme/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/SamplingOverridesBackCompat/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter3xUsingOld3xAgent/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /classic-sdk/web/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | id("ai.publish-conventions") 4 | } 5 | 6 | base.archivesName.set("applicationinsights-web") 7 | 8 | dependencies { 9 | api(project(":classic-sdk:core")) 10 | compileOnly("javax.servlet:javax.servlet-api:3.0.1") 11 | } 12 | 13 | tasks { 14 | jar { 15 | manifest { 16 | attributes("Automatic-Module-Name" to "com.microsoft.applicationinsights.web") 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureSdk/src/main/webapp/WEB-INF/jboss-deployment-structure.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkWebInterop3x/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation(project(":classic-sdk:web")) 7 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 8 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 9 | } 10 | // this dependency is needed to make wildfly happy 11 | implementation("org.reactivestreams:reactive-streams:1.0.3") 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkWebInterop3xUsingOld3xAgent/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/CustomInstrumentation/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "customInstrumentation": [ 11 | { 12 | "className": "com.microsoft.applicationinsights.smoketestapp.TestController", 13 | "methodName": "run" 14 | } 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureFunctions/src/main/java/com/microsoft/azure/functions/worker/handler/InvocationRequestHandler.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.functions.worker.handler; 5 | 6 | import com.microsoft.azure.functions.rpc.messages.InvocationRequest; 7 | 8 | public class InvocationRequestHandler { 9 | 10 | public void execute(InvocationRequest request) {} 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/RuntimeAttachWithDelayedConnectionString/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/kernel/GlobalDiskStats.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.kernel; 5 | 6 | public interface GlobalDiskStats { 7 | 8 | long getTotalWrite(); 9 | 10 | long getTotalRead(); 11 | 12 | long getTotalIo(); 13 | } 14 | -------------------------------------------------------------------------------- /smoke-tests/apps/Kafka/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 7 | implementation("org.springframework.kafka:spring-kafka:2.3.1.RELEASE") 8 | implementation("com.fasterxml.jackson.core:jackson-databind:2.10.0") 9 | implementation("org.apache.httpcomponents:httpclient:4.5.13") 10 | implementation("org.testcontainers:testcontainers-kafka") 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/PreAggMetricsWithRoleNameOverridesAndSampling/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/Environment.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketest; 5 | 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface Environment { 11 | 12 | EnvironmentValue value(); 13 | } 14 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkWebInterop3xUsingOld3xAgent/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation(project(":classic-sdk:web")) 7 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 8 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 9 | } 10 | // this dependency is needed to make wildfly happy 11 | implementation("org.reactivestreams:reactive-streams:1.0.3") 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/TelemetryProcessors/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | // this dependency is needed to make wildfly happy 10 | implementation("org.reactivestreams:reactive-streams:1.0.3") 11 | implementation("io.opentelemetry:opentelemetry-api:1.31.0") 12 | } 13 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/net/GlobalNetworkStats.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.net; 5 | 6 | import java.math.BigInteger; 7 | 8 | public interface GlobalNetworkStats { 9 | BigInteger getTotalWrite(); 10 | 11 | BigInteger getTotalReceived(); 12 | } 13 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureFunctions/src/main/java/com/microsoft/azure/functions/worker/handler/FunctionEnvironmentReloadRequestHandler.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.functions.worker.handler; 5 | 6 | public class FunctionEnvironmentReloadRequestHandler { 7 | 8 | // calling this stub will trigger the azure functions initialization instrumentation 9 | public void execute() {} 10 | } 11 | -------------------------------------------------------------------------------- /smoke-tests/apps/Diagnostics/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation(project(":smoke-tests:apps:Diagnostics:JfrFileReader")) 7 | implementation(project(":agent:agent-profiler:agent-diagnostics-api")) 8 | implementation(project(":agent:agent-profiler:agent-alerting-api")) 9 | testImplementation(project(":smoke-tests:framework")) 10 | implementation("org.springframework.boot:spring-boot-starter-web:2.1.7.RELEASE") 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j2/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/perfcounter/PerformanceCounter.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.perfcounter; 5 | 6 | import com.microsoft.applicationinsights.agent.internal.telemetry.TelemetryClient; 7 | 8 | public interface PerformanceCounter { 9 | 10 | void report(TelemetryClient telemetryClient); 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter2x/src/main/webapp/doPageView.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.microsoft.applicationinsights.TelemetryClient"%> 2 | 3 | <%@page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%> 4 | 5 | 6 | 7 | 8 | Simple Telemetry 9 | 10 | 11 |

trackPageView Test

12 | <% 13 | TelemetryClient tc = new TelemetryClient(); 14 | tc.trackPageView("doPageView"); 15 | %> 16 | 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter3x/src/main/webapp/doPageView.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.microsoft.applicationinsights.TelemetryClient"%> 2 | 3 | <%@page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%> 4 | 5 | 6 | 7 | 8 | Simple Telemetry 9 | 10 | 11 |

trackPageView Test

12 | <% 13 | TelemetryClient tc = new TelemetryClient(); 14 | tc.trackPageView("doPageView"); 15 | %> 16 | 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/DiagnosticExtension/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role" : { 3 | "name" : "testrolename", 4 | "instance" : "testroleinstance" 5 | }, 6 | "sampling" : { 7 | "percentage" : 100 8 | }, 9 | "preview" : { 10 | "profiler" : { 11 | "enabled" : true, 12 | "memoryTriggeredSettings" : "DIAGNOSTIC_PROFILE", 13 | "cpuTriggeredSettings" : "DIAGNOSTIC_PROFILE", 14 | "enableDiagnostics" : true 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/TwoStepUpdatable.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos; 5 | 6 | public interface TwoStepUpdatable { 7 | 8 | void poll() throws OperatingSystemInteractionException; 9 | 10 | void update() throws OperatingSystemInteractionException; 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/DiagnosticExtension/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | implementation(project(":agent:agent-profiler:agent-diagnostics-api")) 7 | implementation(project(":agent:agent-profiler:agent-alerting-api")) 8 | implementation(project(":smoke-tests:apps:DiagnosticExtension:MockExtension")) 9 | testImplementation(project(":smoke-tests:framework")) 10 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") 11 | } 12 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/UnsupportedPlatformException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos; 5 | 6 | public class UnsupportedPlatformException extends RuntimeException { 7 | 8 | public UnsupportedPlatformException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter3xUsingOld3xAgent/src/main/webapp/doPageView.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.microsoft.applicationinsights.TelemetryClient"%> 2 | 3 | <%@page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%> 4 | 5 | 6 | 7 | 8 | Simple Telemetry 9 | 10 | 11 |

trackPageView Test

12 | <% 13 | TelemetryClient tc = new TelemetryClient(); 14 | tc.trackPageView("doPageView"); 15 | %> 16 | 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/JavaProfiler/src/smokeTest/resources/applicationinsights-disabled.json: -------------------------------------------------------------------------------- 1 | { 2 | "role" : { 3 | "name" : "testrolename", 4 | "instance" : "testroleinstance" 5 | }, 6 | "sampling" : { 7 | "percentage" : 100 8 | }, 9 | "preview" : { 10 | "profiler" : { 11 | "enabled" : false 12 | } 13 | }, 14 | "internal": { 15 | "statsbeat": { 16 | "disabledAll": false, 17 | "shortIntervalSeconds": 5, 18 | "longIntervalSeconds": 5 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /smoke-tests/apps/JavaProfiler/src/smokeTest/resources/applicationinsights-enabled.json: -------------------------------------------------------------------------------- 1 | { 2 | "role" : { 3 | "name" : "testrolename", 4 | "instance" : "testroleinstance" 5 | }, 6 | "sampling" : { 7 | "percentage" : 100 8 | }, 9 | "preview" : { 10 | "profiler" : { 11 | "enabled" : true 12 | } 13 | }, 14 | "internal": { 15 | "statsbeat": { 16 | "disabledAll": false, 17 | "shortIntervalSeconds": 5, 18 | "longIntervalSeconds": 5 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-alerting/src/main/java/com/microsoft/applicationinsights/alerting/analysis/aggregations/windowed/BucketData.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.alerting.analysis.aggregations.windowed; 5 | 6 | /** A data type that can be aggregated by WindowedAggregation */ 7 | public interface BucketData { 8 | /** Applies new sample to buckets data */ 9 | void update(U sample); 10 | } 11 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-alerting-api/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | } 4 | 5 | // Allows publishing this library to the local host ONLY if -Ppublish-diagnostics is provided 6 | if (project.properties.containsKey("publish-diagnostics")) { 7 | apply(plugin = "ai.publish-conventions") 8 | } 9 | 10 | dependencies { 11 | compileOnly("com.azure:azure-json") 12 | compileOnly("com.google.auto.value:auto-value-annotations") 13 | annotationProcessor("com.google.auto.value:auto-value") 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Logback/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/profiler/upload/UploadFailedException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.profiler.upload; 5 | 6 | class UploadFailedException extends Exception { 7 | UploadFailedException(Exception cause) { 8 | super(cause); 9 | } 10 | 11 | UploadFailedException(String message) { 12 | super(message); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | // Project properties 2 | version=3.7.6 3 | 4 | org.gradle.parallel=true 5 | org.gradle.caching=true 6 | 7 | org.gradle.priority=low 8 | 9 | # Gradle default for MaxMetaspaceSize is 256m which causes issues with our build 10 | # (see https://docs.gradle.org/current/userguide/build_environment.html#sec:configuring_jvm_memory) 11 | org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m 12 | 13 | # org.gradle.warning.mode=fail 14 | 15 | # Workaround https://youtrack.jetbrains.com/issue/KT-34862 16 | kotlin.incremental=false 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureFunctions/src/main/java/com/microsoft/azure/functions/rpc/messages/InvocationRequest.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.functions.rpc.messages; 5 | 6 | public class InvocationRequest { 7 | 8 | public RpcTraceContext getTraceContext() { 9 | throw new UnsupportedOperationException(); 10 | } 11 | 12 | public String getInvocationId() { 13 | throw new UnsupportedOperationException(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics-api/src/main/java/com/microsoft/applicationinsights/diagnostics/DiagnosisResult.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics; 5 | 6 | /** Represents the result of a diagnosis process, including reporting failures. */ 7 | public interface DiagnosisResult { 8 | 9 | T getDiagnosis(); 10 | 11 | boolean succeeded(); 12 | 13 | String getErrorMessage(); 14 | } 15 | -------------------------------------------------------------------------------- /classic-sdk/core/src/main/java/com/microsoft/applicationinsights/TelemetryConfiguration.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights; 5 | 6 | // this class is required for interop with versions of the Java agent prior to 3.4.0 7 | class TelemetryConfiguration { 8 | 9 | // this method is required for interop with versions of the Java agent prior to 3.4.0 10 | boolean isTrackingDisabled() { 11 | return false; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-alerting/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | } 4 | 5 | dependencies { 6 | compileOnly("com.google.auto.value:auto-value-annotations") 7 | annotationProcessor("com.google.auto.value:auto-value") 8 | 9 | implementation(project(":agent:agent-profiler:agent-alerting-api")) 10 | implementation("org.slf4j:slf4j-api") 11 | implementation("com.azure:azure-json") 12 | 13 | testImplementation("org.junit.jupiter:junit-jupiter") 14 | testImplementation("org.assertj:assertj-core") 15 | } 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter2x/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | // 0.9.3 is the oldest version with trackDependency() 7 | // 2.2.0 is the oldest version with CloudContext 8 | implementation("com.microsoft.azure:applicationinsights-web:2.2.0") { 9 | // applicationinsights-core is embedded in applicationinsights-web 10 | // and duplicate class files produces lots of warning messages on jetty 11 | exclude("com.microsoft.azure", "applicationinsights-core") 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /smoke-tests/apps/Diagnostics/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role" : { 3 | "name" : "testrolename", 4 | "instance" : "testroleinstance" 5 | }, 6 | "sampling" : { 7 | "percentage" : 100 8 | }, 9 | "preview" : { 10 | "profiler" : { 11 | "enabled" : true, 12 | "memoryTriggeredSettings" : "DIAGNOSTIC_PROFILE", 13 | "cpuTriggeredSettings" : "DIAGNOSTIC_PROFILE", 14 | "manualTriggeredSettings" : "DIAGNOSTIC_PROFILE", 15 | "enableDiagnostics" : true 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /smoke-tests/apps/InheritedAttributes/src/smokeTest/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/diagnostics/DiagnosticsValueFinder.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.diagnostics; 5 | 6 | import java.util.function.Function; 7 | import javax.annotation.Nullable; 8 | 9 | public interface DiagnosticsValueFinder { 10 | 11 | String getName(); 12 | 13 | String getValue(@Nullable Function envVarsFunction); 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLogbackInterop2x/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 00000000-0000-0000-0000-0FEEDDADBEEF 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/RoleNameOverrides/src/smokeTest/resources/overrides_applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "roleNameOverrides": [ 11 | { 12 | "httpPathPrefix": "/RoleNameOverrides/app2", 13 | "roleName": "app2" 14 | }, 15 | { 16 | "httpPathPrefix": "/RoleNameOverrides/app3", 17 | "roleName": "app3" 18 | } 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /agent/instrumentation/azure-functions-worker-stub/src/main/java/com/microsoft/azure/functions/rpc/messages/InvocationRequest.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.functions.rpc.messages; 5 | 6 | public class InvocationRequest { 7 | 8 | public RpcTraceContext getTraceContext() { 9 | throw new UnsupportedOperationException(); 10 | } 11 | 12 | public String getInvocationId() { 13 | throw new UnsupportedOperationException(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/OtlpMetrics/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "metricIntervalSeconds": 5, 10 | "customDimensions": { 11 | "tag1": "abc", 12 | "tag2": "def", 13 | "service.version": "123" 14 | }, 15 | "internal": { 16 | "statsbeat": { 17 | "disabledAll": false, 18 | "shortIntervalSeconds": 5, 19 | "longIntervalSeconds": 5 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /classic-sdk/web/src/main/java/com/microsoft/applicationinsights/web/internal/ThreadContext.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.web.internal; 5 | 6 | import javax.annotation.Nullable; 7 | 8 | public final class ThreadContext { 9 | 10 | @Nullable 11 | public static RequestTelemetryContext getRequestTelemetryContext() { 12 | // Javaagent provides implementation 13 | return null; 14 | } 15 | 16 | private ThreadContext() {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/JavaProfiler/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @GetMapping("/") 13 | public String root() { 14 | return "OK"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/process/ProcessInfo.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.process; 5 | 6 | import java.util.Map; 7 | 8 | public interface ProcessInfo extends Comparable { 9 | 10 | String getName(); 11 | 12 | int getPid(); 13 | 14 | String getUid(); 15 | 16 | Map getMetaData(); 17 | } 18 | -------------------------------------------------------------------------------- /agent/agent-bootstrap/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | id("ai.sdk-version-file") 4 | } 5 | 6 | dependencies { 7 | // needed to access io.opentelemetry.instrumentation.api.aisdk.MicrometerUtil 8 | // TODO (heya) remove this when updating to upstream micrometer instrumentation 9 | compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api") 10 | compileOnly("io.opentelemetry.semconv:opentelemetry-semconv") 11 | compileOnly("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-incubator") 12 | } 13 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/profiler/ProfileTypes.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.profiler; 5 | 6 | enum ProfileTypes { 7 | PROFILE, 8 | 9 | // Same as profile with some potentially sensitive data removed, such as environment variables 10 | PROFILE_WITHOUT_ENV_DATA, 11 | 12 | // Enables the events needed to perform a performance diagnosis 13 | DIAGNOSTIC_PROFILE 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLog4j2Interop2x/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringBoot/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("com.microsoft.azure:applicationinsights-spring-boot-starter:2.6.4") 7 | 8 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 9 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 10 | } 11 | 12 | // this dependency is needed to make wildfly happy 13 | implementation("org.reactivestreams:reactive-streams:1.0.3") 14 | implementation("org.apache.httpcomponents:httpclient:4.5.13") 15 | } 16 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | ##################################################### 2 | # 3 | # List of approvers and maintainers 4 | # 5 | ##################################################### 6 | # 7 | # Learn about CODEOWNERS file format: 8 | # https://help.github.com/en/articles/about-code-owners 9 | # 10 | 11 | * @harsimar @jeanbisutti @rajkumar-rangaraj @ramthi @trask @xiang17 12 | /agent/agent-profiler @harsimar @jeanbisutti @johnoliver @rajkumar-rangaraj @ramthi @trask @xiang17 13 | /agent/agent-gc-monitor @harsimar @jeanbisutti @johnoliver @rajkumar-rangaraj @ramthi @trask @xiang17 14 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/hardware/MemoryInfoReader.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.hardware; 5 | 6 | import com.microsoft.applicationinsights.diagnostics.collection.libos.TwoStepUpdatable; 7 | import java.io.Closeable; 8 | 9 | public interface MemoryInfoReader extends TwoStepUpdatable, Closeable { 10 | MemoryInfo getMemoryInfo(); 11 | } 12 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/kernel/KernelStatsReader.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.kernel; 5 | 6 | import com.microsoft.applicationinsights.diagnostics.collection.libos.OperatingSystemInteractionException; 7 | 8 | public interface KernelStatsReader { 9 | 10 | KernelCounters getCounters() throws OperatingSystemInteractionException; 11 | } 12 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/java/io/opentelemetry/sdk/metrics/ViewBuilderAccessor.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package io.opentelemetry.sdk.metrics; 5 | 6 | import io.opentelemetry.sdk.metrics.internal.view.AttributesProcessor; 7 | 8 | public class ViewBuilderAccessor { 9 | 10 | public static void add(ViewBuilder viewBuilder, AttributesProcessor attributeProcessor) { 11 | viewBuilder.addAttributesProcessor(attributeProcessor); 12 | } 13 | 14 | private ViewBuilderAccessor() {} 15 | } 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/SamplingOverridesBackCompat/src/smokeTest/resources/applicationinsights2.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 50, 8 | "overrides": [ 9 | { 10 | "attributes": [ 11 | { 12 | "key": "http.url", 13 | "value": ".*/login", 14 | "matchType": "regexp" 15 | } 16 | ], 17 | "percentage": 100, 18 | "id": "capture all login telemetry" 19 | } 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | workflow_dispatch: 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | common: 16 | uses: ./.github/workflows/build-common.yml 17 | 18 | required-status-check: 19 | needs: 20 | - common 21 | runs-on: ubuntu-latest 22 | if: always() 23 | steps: 24 | - if: needs.common.result != 'success' 25 | run: exit 1 26 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics-jfr/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | } 4 | 5 | // Allows publishing this library to the local host ONLY if -Ppublish-diagnostics is provided 6 | if (project.properties.containsKey("publish-diagnostics")) { 7 | apply(plugin = "ai.publish-conventions") 8 | } 9 | 10 | dependencies { 11 | compileOnly("org.gradle.jfr.polyfill:jfr-polyfill:1.0.2") 12 | compileOnly("com.azure:azure-json") 13 | compileOnly("com.google.auto.service:auto-service") 14 | annotationProcessor("com.google.auto.service:auto-service") 15 | } 16 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/cores/RuntimeCoreCounter.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.cores; 5 | 6 | public class RuntimeCoreCounter implements CoreCounter { 7 | 8 | private static final int AVAILABLE_CORES = Runtime.getRuntime().availableProcessors(); 9 | 10 | @Override 11 | public int getCoreCount() { 12 | return AVAILABLE_CORES; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/process/ProcessDumper.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.process; 5 | 6 | import java.util.List; 7 | 8 | public interface ProcessDumper { 9 | 10 | Iterable all(boolean includeSelf); 11 | 12 | Process thisProcess(); 13 | 14 | void poll(); 15 | 16 | void closeProcesses(List exclusions); 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/JavaProfiler/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringBootApp.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/SamplingOverrides/src/smokeTest/resources/applicationinsights-urlquery.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 50, 8 | "overrides": [ 9 | { 10 | "telemetryType": "request", 11 | "attributes": [ 12 | { 13 | "key": "http.target", 14 | "value": "/SamplingOverrides/test?query", 15 | "matchType": "strict" 16 | } 17 | ], 18 | "percentage": 100 19 | } 20 | ] 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /smoke-tests/apps/DiagnosticExtension/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringBootApp.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/TelemetryProcessors/src/smokeTest/resources/applicationinsights-delete-existing-attribute.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "processors": [ 11 | { 12 | "type": "attribute", 13 | "actions": [ 14 | { 15 | "key": "toBeDeletedAttributeKey", 16 | "action": "delete" 17 | } 18 | ], 19 | "id": "attributes/delete" 20 | } 21 | ] 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /smoke-tests/apps/VerifyAgentJar/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringBootApp.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/WebFlux/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | 12 | public static void main(String[] args) { 13 | 14 | SpringApplication.run(SpringBootApp.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /classic-sdk/core/src/main/java/com/microsoft/applicationinsights/telemetry/Preconditions.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.telemetry; 5 | 6 | import javax.annotation.Nullable; 7 | 8 | final class Preconditions { 9 | 10 | public static void checkArgument(boolean expression, @Nullable Object errorMessage) { 11 | if (!expression) { 12 | throw new IllegalArgumentException(String.valueOf(errorMessage)); 13 | } 14 | } 15 | 16 | private Preconditions() {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/Micrometer/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | 12 | public static void main(String[] args) { 13 | 14 | SpringApplication.run(SpringBootApp.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringCloudStream/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringBootApp.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/SystemExit/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | 12 | public static void main(String[] args) { 13 | 14 | SpringApplication.run(SpringBootApp.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /agent/agent-gc-monitor/gc-monitor-api/src/main/java/com/microsoft/gcmonitor/garbagecollectors/GarbageCollectorStats.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.gcmonitor.garbagecollectors; 5 | 6 | /** Statistics available for a GarbageCollector. */ 7 | public interface GarbageCollectorStats { 8 | 9 | /** The number of collections that have been performed. */ 10 | long getCollectionCount(); 11 | 12 | /** The amount of execution time this collector has accumulated. */ 13 | long getCollectionTime(); 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/ActuatorMetrics/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | 12 | public static void main(String[] args) { 13 | 14 | SpringApplication.run(SpringBootApp.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/CustomInstrumentation/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringBootApp.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/PreferForwardedUrlScheme/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(SpringBootApp.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | Describe what the problem you have encountered; e.g I'm always frustrated when [...] 9 | 10 | **Describe the solution you would like** 11 | Describe what you want to happen. 12 | 13 | **Describe alternatives you have considered** 14 | Describe any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/InheritedAttributes/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | 12 | public static void main(String[] args) { 13 | 14 | SpringApplication.run(SpringBootApp.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/SamplingOverrides/src/smokeTest/resources/applicationinsights2.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 50, 8 | "overrides": [ 9 | { 10 | "telemetryType": "request", 11 | "attributes": [ 12 | { 13 | "key": "http.url", 14 | "value": ".*/login", 15 | "matchType": "regexp" 16 | } 17 | ], 18 | "percentage": 100, 19 | "id": "capture all login telemetry" 20 | } 21 | ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /smoke-tests/apps/Statsbeat/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "customDimensions": { 10 | "tag1": "abc", 11 | "tag2": "def", 12 | "service.version": "123" 13 | }, 14 | "preview": { 15 | "statsbeat": { 16 | "disabled": false 17 | } 18 | }, 19 | "internal": { 20 | "statsbeat": { 21 | "disabledAll": false, 22 | "shortIntervalSeconds": 5, 23 | "longIntervalSeconds": 5 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /smoke-tests/apps/PreAggMetricsWithRoleNameOverridesAndSampling/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 50 8 | }, 9 | "preview": { 10 | "roleNameOverrides": [ 11 | { 12 | "httpPathPrefix": "/PreAggMetricsWithRoleNameOverridesAndSampling/app2", 13 | "roleName": "app2" 14 | }, 15 | { 16 | "httpPathPrefix": "/PreAggMetricsWithRoleNameOverridesAndSampling/app3", 17 | "roleName": "app3" 18 | } 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /etw/java/src/main/java/com/microsoft/applicationinsights/agent/internal/diagnostics/etw/events/model/IpaEtwEventId.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.diagnostics.etw.events.model; 5 | 6 | public enum IpaEtwEventId { 7 | CRITICAL(1), 8 | ERROR(2), 9 | WARN(3), 10 | INFO(4), 11 | VERBOSE(5); 12 | 13 | private final int idValue; 14 | 15 | private IpaEtwEventId(int idValue) { 16 | this.idValue = idValue; 17 | } 18 | 19 | public int value() { 20 | return idValue; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /classic-sdk/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/DataPointType.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.internal.schemav2; 5 | 6 | @SuppressWarnings( 7 | "MemberName") // naming convention intentionally differs from checkstyle for consistency 8 | public enum DataPointType { 9 | Measurement(0), 10 | Aggregation(1); 11 | 12 | private final int id; 13 | 14 | public int getValue() { 15 | return id; 16 | } 17 | 18 | DataPointType(int id) { 19 | this.id = id; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /classic-sdk/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/DependencyKind.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.internal.schemav2; 5 | 6 | @SuppressWarnings( 7 | "MemberName") // naming convention intentionally differs from checkstyle for consistency 8 | public enum DependencyKind { 9 | SQL(0), 10 | Http(1), 11 | Other(2); 12 | 13 | private final int id; 14 | 15 | public int getValue() { 16 | return id; 17 | } 18 | 19 | DependencyKind(int id) { 20 | this.id = id; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j1/src/main/resources/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /agent/agent-gc-monitor/gc-monitor-api/src/main/java/com/microsoft/gcmonitor/UnableToMonitorMemoryException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.gcmonitor; 5 | 6 | public class UnableToMonitorMemoryException extends Exception { 7 | 8 | public UnableToMonitorMemoryException(Exception cause) { 9 | super(cause); 10 | } 11 | 12 | public UnableToMonitorMemoryException(String message, Exception cause) { 13 | super(message, cause); 14 | } 15 | 16 | public UnableToMonitorMemoryException(String message) { 17 | super(message); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/test/java/com/microsoft/applicationinsights/agent/internal/logbackpatch/FileNamePatternTest.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.logbackpatch; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class FileNamePatternTest { 11 | 12 | @Test 13 | public void test() { 14 | assertThat(FileNamePattern.escapeDirectory("/test%20-test/filename%i.log")) 15 | .isEqualTo("/test\\%20-test/filename%i.log"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/JmxMetric/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @GetMapping("/") 13 | public String root() { 14 | return "OK"; 15 | } 16 | 17 | @GetMapping("/test") 18 | public String test() { 19 | return "OK!"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/java/io/opentelemetry/sdk/metrics/internal/view/UserAgents.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package io.opentelemetry.sdk.metrics.internal.view; 5 | 6 | import io.opentelemetry.api.common.Attributes; 7 | import io.opentelemetry.semconv.UserAgentAttributes; 8 | 9 | final class UserAgents { 10 | 11 | static boolean isBot(Attributes attributes) { 12 | String userAgent = attributes.get(UserAgentAttributes.USER_AGENT_ORIGINAL); 13 | return userAgent != null && userAgent.contains("AlwaysOn"); 14 | } 15 | 16 | private UserAgents() {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/ActuatorMetrics/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @GetMapping("/") 13 | public String root() { 14 | return "OK"; 15 | } 16 | 17 | @GetMapping("/test") 18 | public String test() { 19 | return "OK!"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureFunctions/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @GetMapping("/") 13 | public String root() { 14 | return "OK"; 15 | } 16 | 17 | @GetMapping("/test") 18 | public String test() { 19 | return "OK!"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /smoke-tests/apps/CustomDimensions/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @GetMapping("/") 13 | public String root() { 14 | return "OK"; 15 | } 16 | 17 | @GetMapping("/test") 18 | public String test() { 19 | return "OK!"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /smoke-tests/apps/RuntimeAttach/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @GetMapping("/") 13 | public String root() { 14 | return "OK"; 15 | } 16 | 17 | @GetMapping("/test") 18 | public String test() { 19 | return "OK!"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringBootAuto/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @GetMapping("/") 13 | public String root() { 14 | return "OK"; 15 | } 16 | 17 | @GetMapping("/test") 18 | public String test() { 19 | return "OK!"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /smoke-tests/apps/WebAuto/src/main/java/com/microsoft/applicationinsights/smoketestapp/SimpleServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | @WebServlet("/*") 12 | public class SimpleServlet extends HttpServlet { 13 | 14 | @Override 15 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 16 | } 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/InstrumentationKeyOverrides/src/smokeTest/resources/applicationinsights.json: -------------------------------------------------------------------------------- 1 | { 2 | "role": { 3 | "name": "testrolename", 4 | "instance": "testroleinstance" 5 | }, 6 | "sampling": { 7 | "percentage": 100 8 | }, 9 | "preview": { 10 | "instrumentationKeyOverrides": [ 11 | { 12 | "httpPathPrefix": "/InstrumentationKeyOverrides/app2", 13 | "instrumentationKey": "12345678-0000-0000-0000-0FEEDDADBEEF" 14 | }, 15 | { 16 | "httpPathPrefix": "/InstrumentationKeyOverrides/app3", 17 | "instrumentationKey": "87654321-0000-0000-0000-0FEEDDADBEEF" 18 | } 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /smoke-tests/apps/Diagnostics/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | 9 | @SpringBootApplication 10 | public class SpringBootApp { 11 | public static void main(String[] args) { 12 | System.setProperty("applicationinsights.debug.retainJfrFile", "true"); 13 | SpringApplication.run(SpringBootApp.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/AzureFunctions/src/main/java/com/microsoft/azure/functions/rpc/messages/RpcTraceContext.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.functions.rpc.messages; 5 | 6 | import java.util.Map; 7 | 8 | public class RpcTraceContext { 9 | 10 | public Map getAttributesMap() { 11 | throw new UnsupportedOperationException(); 12 | } 13 | 14 | public String getTraceParent() { 15 | throw new UnsupportedOperationException(); 16 | } 17 | 18 | public String getTraceState() { 19 | throw new UnsupportedOperationException(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-alerting/src/main/java/com/microsoft/applicationinsights/alerting/analysis/TimeSource.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.alerting.analysis; 5 | 6 | import java.time.Instant; 7 | 8 | /** Source of time that may be overridden for tests. */ 9 | public abstract class TimeSource { 10 | public abstract Instant getNow(); 11 | 12 | public static final TimeSource DEFAULT = 13 | new TimeSource() { 14 | @Override 15 | public Instant getNow() { 16 | return Instant.now(); 17 | } 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-alerting/src/test/java/com/microsoft/applicationinsights/alerting/TestTimeSource.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.alerting; 5 | 6 | import com.microsoft.applicationinsights.alerting.analysis.TimeSource; 7 | import java.time.Instant; 8 | 9 | class TestTimeSource extends TimeSource { 10 | 11 | private Instant now = Instant.ofEpochMilli(0); 12 | 13 | @Override 14 | public Instant getNow() { 15 | return now; 16 | } 17 | 18 | void increment(int milliseconds) { 19 | this.now = now.plusMillis(milliseconds); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /smoke-tests/apps/ReadOnly/src/main/java/com/microsoft/applicationinsights/smoketestapp/App.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import java.io.IOException; 7 | import java.util.logging.Logger; 8 | 9 | // Spring boot doesn't support read-only containers 10 | // (https://github.com/spring-projects/spring-boot/issues/8578) 11 | public class App { 12 | 13 | private static final Logger logger = Logger.getLogger("smoketestapp"); 14 | 15 | public static void main(String[] args) throws IOException { 16 | logger.info("hello"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /smoke-tests/apps/RuntimeAttachWithDelayedConnectionString/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | public class TestController { 11 | 12 | @GetMapping("/") 13 | public String root() { 14 | return "OK"; 15 | } 16 | 17 | @GetMapping("/test") 18 | public String test() { 19 | return "OK!"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringCloudStream/src/main/java/com/microsoft/applicationinsights/smoketestapp/Greetings.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | public class Greetings { 7 | 8 | private final long timestamp; 9 | private final String message; 10 | 11 | public Greetings(long timestamp, String message) { 12 | this.timestamp = timestamp; 13 | this.message = message; 14 | } 15 | 16 | public long getTimestamp() { 17 | return timestamp; 18 | } 19 | 20 | public String getMessage() { 21 | return message; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/calibration/Calibration.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.calibration; 5 | 6 | public class Calibration { 7 | public static final double UNKNOWN = -1; 8 | private final double contextSwitchingRate; 9 | 10 | public Calibration(double contextSwitchingRate) { 11 | this.contextSwitchingRate = contextSwitchingRate; 12 | } 13 | 14 | public double getContextSwitchingRate() { 15 | return contextSwitchingRate; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/test/java/com/microsoft/applicationinsights/agent/internal/diagnostics/DiagnosticsTestHelper.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.diagnostics; 5 | 6 | public class DiagnosticsTestHelper { 7 | private DiagnosticsTestHelper() {} 8 | 9 | public static void setIsAppSvcAttachForLoggingPurposes(boolean appSvcAttachForLoggingPurposes) { 10 | DiagnosticsHelper.setAppSvcRpIntegratedAuto(appSvcAttachForLoggingPurposes); 11 | } 12 | 13 | public static void reset() { 14 | setIsAppSvcAttachForLoggingPurposes(false); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /agent/instrumentation/azure-functions-worker-stub/src/main/java/com/microsoft/azure/functions/rpc/messages/RpcTraceContext.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.functions.rpc.messages; 5 | 6 | import java.util.Map; 7 | 8 | public class RpcTraceContext { 9 | 10 | public Map getAttributesMap() { 11 | throw new UnsupportedOperationException(); 12 | } 13 | 14 | public String getTraceParent() { 15 | throw new UnsupportedOperationException(); 16 | } 17 | 18 | public String getTraceState() { 19 | throw new UnsupportedOperationException(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /classic-sdk/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/SeverityLevel.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.internal.schemav2; 5 | 6 | @SuppressWarnings( 7 | "MemberName") // naming convention intentionally differs from checkstyle for consistency 8 | public enum SeverityLevel { 9 | Verbose(0), 10 | Information(1), 11 | Warning(2), 12 | Error(3), 13 | Critical(4); 14 | 15 | private final int id; 16 | 17 | public int getValue() { 18 | return id; 19 | } 20 | 21 | SeverityLevel(int id) { 22 | this.id = id; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Application Insights for Java 2 | 3 | See the [official documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable?tabs=java). 4 | 5 | ## If you need to build locally or want to contribute 6 | 7 | See [CONTRIBUTING.md](CONTRIBUTING.md). 8 | 9 | ## Microsoft Open Source Code of Conduct 10 | 11 | This project has adopted the 12 | [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more 13 | information see the 14 | [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 15 | or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) 16 | with any additional questions or comments. 17 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/init/AiContextKeys.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.init; 5 | 6 | import io.opentelemetry.context.ContextKey; 7 | 8 | public final class AiContextKeys { 9 | 10 | public static final ContextKey CONNECTION_STRING = 11 | ContextKey.named("applicationinsights.internal.connection_string"); 12 | 13 | public static final ContextKey ROLE_NAME = 14 | ContextKey.named("applicationinsights.internal.role_name"); 15 | 16 | private AiContextKeys() {} 17 | } 18 | -------------------------------------------------------------------------------- /agent/instrumentation/azure-functions-worker-stub/src/main/java/com/microsoft/azure/functions/worker/handler/InvocationRequestHandler.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.azure.functions.worker.handler; 5 | 6 | import com.microsoft.azure.functions.rpc.messages.InvocationRequest; 7 | 8 | public class InvocationRequestHandler { 9 | 10 | public void execute(InvocationRequest request) { 11 | verifyCurrentContext(); 12 | } 13 | 14 | // this doesn't exist in the real worker artifact 15 | // it only exists for testing the instrumentation 16 | protected void verifyCurrentContext() {} 17 | } 18 | -------------------------------------------------------------------------------- /etw/etw-testapp/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | id("org.springframework.boot" version "2.5.12") 4 | id("war") 5 | } 6 | 7 | dependencies { 8 | compileOnly("javax.servlet:javax.servlet-api:4.0.1") 9 | // TODO (trask) ETW: is this project really needed? if so, need to restore devtest configuration 10 | // compileOnly(project(path:":agent:agent", configuration:"devtest")) 11 | compileOnly(project(path: ":agent:agent")) 12 | 13 | implementation("org.springframework.boot:spring-boot-starter-web:3.5.7") { 14 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 15 | } 16 | implementation("org.apache.commons:commons-lang3:3.20.0") 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/schemav2/DataPointType.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketest.schemav2; 5 | 6 | import com.google.gson.annotations.SerializedName; 7 | 8 | /** Enum DataPointType. */ 9 | public enum DataPointType { 10 | @SerializedName("Measurement") 11 | MEASUREMENT(0), 12 | @SerializedName("Aggregation") 13 | AGGREGATION(1); 14 | 15 | private final int id; 16 | 17 | public int getValue() { 18 | return id; 19 | } 20 | 21 | DataPointType(int id) { 22 | this.id = id; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /classic-sdk/core/src/main/java/com/microsoft/applicationinsights/telemetry/SeverityLevel.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.telemetry; 5 | 6 | /** Enum SeverityLevel. */ 7 | @SuppressWarnings( 8 | "MemberName") // naming convention intentionally differs from checkstyle for consistency 9 | public enum SeverityLevel { 10 | Verbose(0), 11 | Information(1), 12 | Warning(2), 13 | Error(3), 14 | Critical(4); 15 | 16 | private final int id; 17 | 18 | public int getValue() { 19 | return id; 20 | } 21 | 22 | SeverityLevel(int id) { 23 | this.id = id; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /smoke-tests/apps/OpenTelemetryMetric/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | implementation("io.opentelemetry:opentelemetry-api:1.12.0") 10 | 11 | smokeTestImplementation("org.mock-server:mockserver-netty:5.15.0:shaded") 12 | smokeTestImplementation("org.awaitility:awaitility:4.2.0") 13 | smokeTestImplementation("io.opentelemetry.proto:opentelemetry-proto:0.14.0-alpha") 14 | } 15 | 16 | configurations.all { 17 | resolutionStrategy.force("io.opentelemetry:opentelemetry-api:1.12.0") 18 | } 19 | -------------------------------------------------------------------------------- /agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/perfcounter/JmxAttributeData.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.perfcounter; 5 | 6 | /** 7 | * Represents JMX data of an Attribute The display name The name of the attribute The type of the 8 | * attribute. 9 | */ 10 | public final class JmxAttributeData { 11 | public final String metricName; 12 | public final String attribute; 13 | 14 | public JmxAttributeData(String metricName, String attribute) { 15 | this.attribute = attribute; 16 | this.metricName = metricName; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/process/ProcessIoStats.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.process; 5 | 6 | import com.microsoft.applicationinsights.diagnostics.collection.libos.TwoStepUpdatable; 7 | import java.io.Closeable; 8 | import java.math.BigInteger; 9 | 10 | public interface ProcessIoStats extends TwoStepUpdatable, Closeable { 11 | BigInteger getIoRead(); 12 | 13 | BigInteger getIoWrite(); 14 | 15 | BigInteger getDiskRead(); 16 | 17 | BigInteger getDiskWrite(); 18 | } 19 | -------------------------------------------------------------------------------- /agent/instrumentation/applicationinsights-web-2.3/src/main/java/io/opentelemetry/javaagent/instrumentation/applicationinsightsweb/MoreJava8BytecodeBridge.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package io.opentelemetry.javaagent.instrumentation.applicationinsightsweb; 5 | 6 | import io.opentelemetry.api.trace.Span; 7 | import io.opentelemetry.context.Context; 8 | import javax.annotation.Nullable; 9 | 10 | public class MoreJava8BytecodeBridge { 11 | 12 | @Nullable 13 | public static Span spanFromContextOrNull(Context context) { 14 | return Span.fromContextOrNull(context); 15 | } 16 | 17 | private MoreJava8BytecodeBridge() {} 18 | } 19 | -------------------------------------------------------------------------------- /smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/TargetUri.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketest; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Target(ElementType.METHOD) 13 | public @interface TargetUri { 14 | String value(); 15 | 16 | /** The number of times to call the target uri. */ 17 | int callCount() default 1; 18 | 19 | String userAgent() default ""; 20 | } 21 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkWebInterop2x/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("com.microsoft.azure:applicationinsights-web:2.6.4") { 7 | // applicationinsights-core is embedded in applicationinsights-web 8 | // and duplicate class files produces lots of warning messages on jetty 9 | exclude("com.microsoft.azure", "applicationinsights-core") 10 | } 11 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 12 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 13 | } 14 | // this dependency is needed to make wildfly happy 15 | implementation("org.reactivestreams:reactive-streams:1.0.3") 16 | } 17 | -------------------------------------------------------------------------------- /smoke-tests/apps/JmxMetric/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.springframework.boot:spring-boot-starter-web:2.5.12") { 7 | exclude("org.springframework.boot", "spring-boot-starter-tomcat") 8 | } 9 | // this dependency is needed to make wildfly happy 10 | implementation("org.reactivestreams:reactive-streams:1.0.3") 11 | 12 | implementation("org.weakref:jmxutils:1.22") 13 | 14 | // spring modules 15 | smokeTestImplementation("org.mock-server:mockserver-netty:5.15.0:shaded") 16 | smokeTestImplementation("org.awaitility:awaitility:4.2.0") 17 | smokeTestImplementation("io.opentelemetry.proto:opentelemetry-proto:0.14.0-alpha") 18 | } 19 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics-api/src/main/java/com/microsoft/applicationinsights/diagnostics/DiagnosticEngineFactory.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics; 5 | 6 | import java.util.concurrent.ScheduledExecutorService; 7 | 8 | /** 9 | * Factory to be invoked to create a DiagnosticEngine. This factory will be service loaded by the 10 | * agent and invoked. It is up to the provider of a DiagnosticEngine to provide a service loader for 11 | * this interface. 12 | */ 13 | public interface DiagnosticEngineFactory { 14 | DiagnosticEngine create(ScheduledExecutorService executorService); 15 | } 16 | -------------------------------------------------------------------------------- /licenses/jackson-datatype-jsr310-2.20.1.jar/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | # Jackson JSON processor 2 | 3 | Jackson is a high-performance, Free/Open Source JSON processing library. 4 | It was originally written by Tatu Saloranta (tatu.saloranta@iki.fi), and has 5 | been in development since 2007. 6 | It is currently developed by a community of developers. 7 | 8 | ## Licensing 9 | 10 | Jackson components are licensed under Apache (Software) License, version 2.0, 11 | as per accompanying LICENSE file. 12 | 13 | ## Credits 14 | 15 | A list of contributors may be found from CREDITS file, which is included 16 | in some artifacts (usually source distributions); but is always available 17 | from the source code management (SCM) system project uses. 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpServer/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.http.HttpServletResponse; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @RestController 11 | public class TestController { 12 | 13 | @GetMapping("/") 14 | public String root() { 15 | return "OK"; 16 | } 17 | 18 | @GetMapping("/test") 19 | public String test(HttpServletResponse response) { 20 | return "OK!"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringCloudStream/src/main/java/com/microsoft/applicationinsights/smoketestapp/GreetingsListener.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import org.springframework.cloud.stream.annotation.StreamListener; 7 | import org.springframework.messaging.handler.annotation.Payload; 8 | import org.springframework.stereotype.Component; 9 | 10 | @Component 11 | public class GreetingsListener { 12 | 13 | @StreamListener(GreetingsStreams.INPUT) 14 | public void handleGreetings(@Payload Greetings greetings) { 15 | System.out.println("Received greetings: " + greetings); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/os/linux/cgroups/CGroupCpuUsageReader.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.os.linux.cgroups; 5 | 6 | @SuppressWarnings( 7 | "checkstyle:AbbreviationAsWordInName") // CGroup is the standard abbreviation for Control Group 8 | public class CGroupCpuUsageReader extends CGroupValueReader { 9 | // total CPU usage (in nanoseconds) consumed by all tasks in this cgroup 10 | public CGroupCpuUsageReader() { 11 | super("/sys/fs/cgroup/cpu,cpuacct/cpuacct.usage"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /smoke-tests/apps/gRPC/src/main/java/com/microsoft/applicationinsights/smoketestapp/SpringBootApp.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import io.grpc.ServerBuilder; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | 10 | @SpringBootApplication 11 | public class SpringBootApp { 12 | 13 | public static void main(String[] args) throws Exception { 14 | 15 | ServerBuilder.forPort(10203).addService(new HelloworldImpl()).build().start(); 16 | 17 | SpringApplication.run(SpringBootApp.class, args); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/OperatingSystem.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos; 5 | 6 | public enum OperatingSystem { 7 | MAC_OS(false), 8 | LINUX(true), 9 | WINDOWS(false), 10 | SOLARIS(false), 11 | UNKNOWN(false); 12 | 13 | private final boolean supportsDiagnostics; 14 | 15 | OperatingSystem(boolean supportsDiagnostics) { 16 | this.supportsDiagnostics = supportsDiagnostics; 17 | } 18 | 19 | public boolean supportsDiagnostics() { 20 | return supportsDiagnostics; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/os/linux/cgroups/CGroupCpuUserReader.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.os.linux.cgroups; 5 | 6 | @SuppressWarnings( 7 | "checkstyle:AbbreviationAsWordInName") // CGroup is the standard abbreviation for Control Group 8 | public class CGroupCpuUserReader extends CGroupValueReader { 9 | // total user CPU time (in nanoseconds) consumed by all tasks in this cgroup 10 | public CGroupCpuUserReader() { 11 | super("/sys/fs/cgroup/cpu,cpuacct/cpuacct.usage_user"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter2x/src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | ApplicationInsightsWebFilter 8 | com.microsoft.applicationinsights.web.internal.WebRequestTrackingFilter 9 | 10 | 11 | 12 | ApplicationInsightsWebFilter 13 | /* 14 | 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringCloudStream/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-jar") 3 | } 4 | 5 | dependencies { 6 | // TODO (trask) do these need versions? 7 | implementation("org.springframework.boot:spring-boot-starter-web:2.2.0.RELEASE") 8 | implementation("org.springframework.cloud:spring-cloud-stream:2.2.1.RELEASE") 9 | implementation("org.springframework.cloud:spring-cloud-starter-stream-kafka:2.2.1.RELEASE") 10 | implementation("org.springframework.kafka:spring-kafka:2.3.1.RELEASE") 11 | implementation("org.springframework:spring-tx:5.2.0.RELEASE") 12 | implementation("org.springframework.cloud:spring-cloud-stream-binder-kafka:2.2.1.RELEASE") 13 | implementation("org.testcontainers:testcontainers-kafka") 14 | } 15 | -------------------------------------------------------------------------------- /smoke-tests/apps/Diagnostics/JfrFileReader/src/main/java/com/microsoft/applicationinsights/jfrfile/JfrFileReader.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.jfrfile; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | import java.nio.file.Path; 9 | import jdk.jfr.EventType; 10 | import jdk.jfr.consumer.RecordingFile; 11 | 12 | public class JfrFileReader { 13 | 14 | public static boolean hasEventOfType(Path jfrFile, String event) throws IOException { 15 | return new RecordingFile(jfrFile) 16 | .readEventTypes() 17 | .stream().map(EventType::getName) 18 | .anyMatch(event::equals); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/os/linux/cgroups/CGroupCpuSystemReader.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.os.linux.cgroups; 5 | 6 | @SuppressWarnings( 7 | "checkstyle:AbbreviationAsWordInName") // CGroup is the standard abbreviation for Control Group 8 | public class CGroupCpuSystemReader extends CGroupValueReader { 9 | // total system CPU time (in nanoseconds) consumed by all tasks in this cgroup 10 | public CGroupCpuSystemReader() { 11 | super("/sys/fs/cgroup/cpu,cpuacct/cpuacct.usage_sys"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/OperatingSystemInteractionException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos; 5 | 6 | public class OperatingSystemInteractionException extends Exception { 7 | 8 | public OperatingSystemInteractionException(String message, Throwable cause) { 9 | super(message, cause); 10 | } 11 | 12 | public OperatingSystemInteractionException(String message) { 13 | super(message); 14 | } 15 | 16 | public OperatingSystemInteractionException(Throwable cause) { 17 | super(cause); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /agent/agent-profiler/agent-diagnostics/src/main/java/com/microsoft/applicationinsights/diagnostics/collection/libos/os/linux/DiskNames.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.diagnostics.collection.libos.os.linux; 5 | 6 | import java.util.regex.Pattern; 7 | 8 | public class DiskNames { 9 | 10 | // e.g: md0, sda, hda, xvda1, nvme0n1 11 | private static final Pattern DISK_PATTERN = 12 | Pattern.compile("(md[0-9]+|sd[a-z]|hd[a-z]|xvd[a-z][0-9]|nvme[0-9]+n[0-9]+)"); 13 | 14 | public static boolean matchesDiskName(String name) { 15 | return DISK_PATTERN.matcher(name).matches(); 16 | } 17 | 18 | private DiskNames() {} 19 | } 20 | -------------------------------------------------------------------------------- /agent/runtime-attach/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.java-conventions") 3 | id("ai.publish-conventions") 4 | id("ai.sdk-version-file") 5 | } 6 | base.archivesName.set("applicationinsights-runtime-attach") 7 | 8 | val otelContribAlphaVersion: String by project 9 | val agent: Configuration by configurations.creating 10 | 11 | dependencies { 12 | implementation("io.opentelemetry.contrib:opentelemetry-runtime-attach-core") 13 | agent(project(":agent:agent", configuration = "shadow")) 14 | } 15 | 16 | tasks { 17 | jar { 18 | inputs.files(agent) 19 | from({ 20 | agent.singleFile 21 | }) 22 | manifest { 23 | attributes("Automatic-Module-Name" to "com.microsoft.applicationinsights.attach") 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /agent/agent-gc-monitor/gc-monitor-api/src/main/java/com/microsoft/gcmonitor/GcMonitorFactory.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.gcmonitor; 5 | 6 | import java.util.concurrent.ExecutorService; 7 | import javax.management.MBeanServerConnection; 8 | 9 | /** Service loader interface. */ 10 | public interface GcMonitorFactory { 11 | MemoryManagement monitorSelf(ExecutorService executorService, GcEventConsumer consumer) 12 | throws UnableToMonitorMemoryException; 13 | 14 | MemoryManagement monitor( 15 | MBeanServerConnection connection, ExecutorService executorService, GcEventConsumer consumer) 16 | throws UnableToMonitorMemoryException; 17 | } 18 | -------------------------------------------------------------------------------- /etw/java/src/main/java/com/microsoft/applicationinsights/agent/internal/diagnostics/etw/ApplicationInsightsEtwException.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.agent.internal.diagnostics.etw; 5 | 6 | public class ApplicationInsightsEtwException extends Exception { 7 | private static final long serialVersionUID = 6108441736100165651L; 8 | 9 | public ApplicationInsightsEtwException() { 10 | super(); 11 | } 12 | 13 | public ApplicationInsightsEtwException(String message) { 14 | super(message); 15 | } 16 | 17 | public ApplicationInsightsEtwException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /smoke-tests/apps/HeartBeat/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j1/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/Log4j2/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/Logback/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/Logback/src/main/java/com/microsoft/applicationinsights/smoketestapp/LogbackWithSpanExceptionServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | @WebServlet("/testWithSpanException") 12 | public class LogbackWithSpanExceptionServlet extends HttpServlet { 13 | 14 | protected void doGet(HttpServletRequest request, HttpServletResponse response) { 15 | throw new RuntimeException("Test Exception"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/Statsbeat/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /classic-sdk/core/src/main/java/com/microsoft/applicationinsights/internal/schemav2/PageViewData.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.internal.schemav2; 5 | 6 | import java.net.URI; 7 | 8 | public class PageViewData extends EventData { 9 | 10 | private URI uri; 11 | private long duration = 0; 12 | 13 | public PageViewData() {} 14 | 15 | public URI getUri() { 16 | return uri; 17 | } 18 | 19 | public void setUri(URI uri) { 20 | this.uri = uri; 21 | } 22 | 23 | public long getDuration() { 24 | return duration; 25 | } 26 | 27 | public void setDuration(long duration) { 28 | this.duration = duration; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpClients/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("ai.smoke-test-war") 3 | } 4 | 5 | dependencies { 6 | implementation("org.apache.httpcomponents:httpclient:4.5.13") 7 | implementation("org.apache.httpcomponents:httpasyncclient:4.1.4") 8 | implementation("commons-httpclient:commons-httpclient:3.1") 9 | implementation("com.squareup.okhttp3:okhttp:3.12.1") 10 | implementation("com.squareup.okhttp:okhttp:2.7.5") 11 | implementation("org.springframework:spring-webflux:5.2.3.RELEASE") // for testing netty client 12 | implementation("io.projectreactor.netty:reactor-netty:0.9.4.RELEASE") // needed for above 13 | // this dependency is needed to make wildfly happy 14 | implementation("com.fasterxml.jackson.core:jackson-databind:2.9.4") 15 | } 16 | -------------------------------------------------------------------------------- /smoke-tests/apps/RateLimitedSampling/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/AutoPerfCounters/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter2x/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/CoreAndFilter3x/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/JavaUtilLogging/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/schemav2/Base.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketest.schemav2; 5 | 6 | /** Data contract class Base. */ 7 | public abstract class Base { 8 | /** Backing field for property BaseType. */ 9 | private String baseType; 10 | 11 | /** Initializes a new instance of the Base class. */ 12 | public Base() {} 13 | 14 | /** Gets the BaseType property. */ 15 | public String getBaseType() { 16 | return this.baseType; 17 | } 18 | 19 | /** Sets the BaseType property. */ 20 | public void setBaseType(String value) { 21 | this.baseType = value; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Application Insights Java Development Environment", 3 | "image": "mcr.microsoft.com/devcontainers/base:bullseye", 4 | "features": { 5 | "ghcr.io/devcontainers/features/java:1": { 6 | "version": "17", 7 | "jdkDistro": "ms" 8 | }, 9 | "ghcr.io/devcontainers/features/docker-in-docker:2": {} 10 | }, 11 | "updateContentCommand": "./gradlew classes --no-daemon", 12 | "customizations": { 13 | "vscode": { 14 | "extensions": [ 15 | "vscjava.vscode-java-pack", 16 | "ms-vscode.vscode-json", 17 | "GitHub.copilot", 18 | "GitHub.copilot-chat" 19 | ] 20 | }, 21 | "settings": { 22 | "java.server.launchMode": "LightWeight" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /smoke-tests/apps/HttpServer4xx/src/main/java/com/microsoft/applicationinsights/smoketestapp/TestController.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.http.HttpServletResponse; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @RestController 11 | public class TestController { 12 | 13 | @GetMapping("/") 14 | public String root() { 15 | return "OK"; 16 | } 17 | 18 | @GetMapping("/test4xx") 19 | public String test4xx(HttpServletResponse response) { 20 | response.setStatus(400); 21 | return "Not OK!"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /smoke-tests/apps/SpringBoot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=SpringBootTest 2 | azure.application-insights.connection-string=InstrumentationKey=00000000-0000-0000-0000-cba987654321;IngestionEndpoint=http://non-existent-host 3 | azure.application-insights.logger.level=TRACE 4 | azure.application-insights.default-modules.ProcessPerformanceCountersModule.enabled=false 5 | azure.application-insights.default-modules.JvmPerformanceCountersModule.enabled=false 6 | azure.application-insights.heart-beat.enabled=false 7 | azure.application-insights.quick-pulse.enabled=false 8 | azure.application-insights.channel.in-process.developer-mode=true 9 | azure.application-insights.channel.in-process.flush-interval-in-seconds=1 10 | spring.mvc.favicon.enabled=false 11 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLog4j1Interop2x/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLog4j2Interop2x/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/ClassicSdkLogbackInterop2x/src/main/java/com/microsoft/applicationinsights/smoketestapp/HealthCheckServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | // this is used by the test infra in order to know when it's ok to start running the tests 12 | @WebServlet("") 13 | public class HealthCheckServlet extends HttpServlet { 14 | 15 | @Override 16 | protected void doGet(HttpServletRequest request, HttpServletResponse response) {} 17 | } 18 | -------------------------------------------------------------------------------- /smoke-tests/apps/SamplingOverrides/src/main/java/com/microsoft/applicationinsights/smoketestapp/ExceptionSamplingOverridesServlet.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | package com.microsoft.applicationinsights.smoketestapp; 5 | 6 | import javax.servlet.annotation.WebServlet; 7 | import javax.servlet.http.HttpServlet; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | @WebServlet("/trackException") 12 | public class ExceptionSamplingOverridesServlet extends HttpServlet { 13 | 14 | protected void doGet(HttpServletRequest request, HttpServletResponse response) { 15 | throw new RuntimeException("this is an expected exception"); 16 | } 17 | } 18 | --------------------------------------------------------------------------------