From a4b013dd6be44e6d5e8f3b95ca68224f1a6dbce6 Mon Sep 17 00:00:00 2001 From: vivek-shrikhande <65864138+vivek-shrikhande@users.noreply.github.com> Date: Mon, 7 Jun 2021 14:24:35 +0530 Subject: [PATCH 1/7] feat: Set normalized urls as Transaction names --- CHANGELOG.asciidoc | 58 ++-- CONTRIBUTING.md | 8 +- Jenkinsfile | 2 +- apm-agent-api/pom.xml | 2 +- apm-agent-attach/pom.xml | 2 +- .../co/elastic/apm/attach/JvmDiscoverer.java | 62 +++- .../co/elastic/apm/attach/RemoteAttacher.java | 3 +- .../elastic/apm/attach/JvmDiscovererTest.java | 76 ++++- apm-agent-benchmarks/pom.xml | 7 +- .../agent/benchmark/ProfilerBenchmark.java | 2 - apm-agent-core/pom.xml | 56 +++- .../co/elastic/apm/agent/bci/AgentMain.java | 307 ++++++++--------- .../apm/agent/bci/ElasticApmAgent.java | 20 +- .../apm/agent/bci/HelperClassManager.java | 70 +--- .../elastic/apm/agent/bci/IndyBootstrap.java | 4 +- .../bci/IndyPluginClassLoaderFactory.java | 109 +++++++ .../co/elastic/apm/agent/bci/SFAgentUtil.java | 197 +++++++++++ .../elastic/apm/agent/bci/SFConfigInfo.java | 58 ++++ .../co/elastic/apm/agent/bci/SFTagInfo.java | 58 ++++ .../agent/bci/TracerAwareInstrumentation.java | 52 +-- .../apm/agent/bci/VisibleForAdvice.java | 7 +- .../bci/bytebuddy/ErrorLoggingListener.java | 6 +- .../MinimumClassFileVersionValidator.java | 26 +- .../SoftlyReferencingTypePoolCache.java | 2 +- .../classloading/IndyPluginClassLoader.java | 6 +- .../TraceMethodInstrumentation.java | 5 + .../apm/agent/collections/WeakMapCleaner.java | 2 +- .../ApmServerConfigurationSource.java | 2 +- ...cutorServiceShutdownLifecycleListener.java | 42 +++ .../apm/agent/impl/ElasticApmTracer.java | 15 +- .../agent/impl/ElasticApmTracerBuilder.java | 2 +- .../elastic/apm/agent/impl/GlobalTracer.java | 25 +- .../impl/circuitbreaker/CircuitBreaker.java | 2 +- .../apm/agent/impl/context/Destination.java | 2 +- .../impl/context/web/WebConfiguration.java | 9 +- .../agent/logging/LoggingConfiguration.java | 34 +- .../apm/agent/metrics/MetricRegistry.java | 24 +- .../elastic/apm/agent/metrics/MetricSet.java | 19 +- .../agent/metrics/builtin/CGroupMetrics.java | 308 ++++++++++++++++++ .../report/AbstractIntakeApiHandler.java | 59 +++- .../apm/agent/report/ApmServerClient.java | 30 +- .../agent/report/ApmServerHealthChecker.java | 4 +- .../apm/agent/report/ApmServerReporter.java | 41 +-- .../report/IntakeV2ReportingEventHandler.java | 38 ++- .../co/elastic/apm/agent/report/Reporter.java | 7 +- .../agent/report/ReporterConfiguration.java | 17 +- .../apm/agent/report/ReportingEvent.java | 50 ++- .../report/serialize/DslJsonSerializer.java | 21 +- .../serialize/MetricRegistryReporter.java | 71 ++++ .../serialize/MetricRegistrySerializer.java | 19 +- .../report/serialize/PayloadSerializer.java | 5 +- .../report/ssl/TLSFallbackSSLSocket.java | 35 +- .../DependencyInjectingServiceLoader.java | 13 +- .../elastic/apm/agent/util/ExecutorUtils.java | 81 +++-- .../co/elastic/apm/agent/util/IOUtils.java | 5 +- .../co/elastic/apm/agent/util/Version.java | 3 + ...lastic.apm.agent.context.LifecycleListener | 2 + .../agent/AbstractInstrumentationTest.java | 40 +-- .../co/elastic/apm/agent/MockReporter.java | 127 ++++---- .../java/co/elastic/apm/agent/MockTracer.java | 71 ++-- .../elastic/apm/agent/bci/AgentMainTest.java | 3 +- .../apm/agent/bci/InstrumentationTest.java | 110 ++++++- .../TraceMethodInstrumentationTest.java | 2 +- .../AdviceInSubpackageInstrumentation.java | 5 - .../agent/configuration/SpyConfiguration.java | 6 +- .../apm/agent/impl/ElasticApmTracerTest.java | 40 +++ .../apm/agent/impl/SpanTypeBreakdownTest.java | 26 +- .../agent/logging/JulBridgeLoggerTest.java | 9 +- .../agent/matcher/WildcardMatcherTest.java | 284 +++------------- .../apm/agent/metrics/MetricRegistryTest.java | 108 +++++- .../metrics/builtin/CGroupMetricsTest.java | 132 ++++++++ .../objectpool/TestObjectPoolFactory.java | 16 + .../objectpool/impl/BookkeeperObjectPool.java | 5 + .../ApmServerClientProxySupportTest.java | 268 +++++++++++++++ .../apm/agent/report/ApmServerClientTest.java | 80 ++++- .../IntakeV2ReportingEventHandlerTest.java | 17 +- .../serialize/MetricSetSerializationTest.java | 6 +- .../elastic/apm/agent/util/IOUtilsTest.java | 22 +- .../src/test/java/specs/TestJsonSpec.java | 47 +++ .../json-specs/sql_signature_examples.json | 146 +++++++++ .../json-specs/sql_token_examples.json | 3 +- .../json-specs/wildcard_matcher_tests.json | 194 +++++++++++ apm-agent-core/src/test/resources/proc/cgroup | 2 + .../src/test/resources/proc/cgroup2 | 2 + .../src/test/resources/proc/cgroup2_only_0 | 1 + .../test/resources/proc/cgroup2_only_memory | 1 + .../proc/limited/memory/memory.limit_in_bytes | 1 + .../resources/proc/limited/memory/memory.stat | 40 +++ .../proc/limited/memory/memory.usage_in_bytes | 1 + .../proc/sys_cgroup2/slice/memory.current | 1 + .../proc/sys_cgroup2/slice/memory.max | 1 + .../proc/sys_cgroup2/slice/memory.stat | 40 +++ .../slice/memory.current | 1 + .../sys_cgroup2_unlimited/slice/memory.max | 1 + .../sys_cgroup2_unlimited/slice/memory.stat | 40 +++ .../slice/memory.current | 1 + .../slice/memory.max | 1 + .../slice/memory.stat | 40 +++ .../unlimited/memory/memory.limit_in_bytes | 1 + .../proc/unlimited/memory/memory.stat | 40 +++ .../unlimited/memory/memory.usage_in_bytes | 1 + .../src/test/resources/specs/api_key.feature | 8 +- .../resources/squid/squid_basic-auth.conf | 41 +++ .../test/resources/squid/squid_no-auth.conf | 38 +++ .../src/test/resources/squid/squid_passwd | 2 + ....properties => test.elasticapm.properties} | 0 ...st.elasticapm.with-service-name.properties | 1 + apm-agent-plugin-sdk/pom.xml | 2 +- .../agent/sdk/ElasticApmInstrumentation.java | 51 +++ .../agent/sdk/state/GlobalThreadLocal.java | 8 + .../agent/sdk/weakmap/WeakMapSupplier.java | 10 + .../apm-apache-httpclient-plugin/pom.xml | 2 +- .../ApacheHttpAsyncClientInstrumentation.java | 37 +-- ...ttpAsyncClientRedirectInstrumentation.java | 23 +- .../ApacheHttpClientInstrumentation.java | 58 ++-- .../BaseApacheHttpClientInstrumentation.java | 31 +- ...LegacyApacheHttpClientInstrumentation.java | 72 ++-- .../helper/ApacheHttpAsyncClientHelper.java | 58 +++- .../ApacheHttpAsyncClientHelperImpl.java | 88 ----- .../helper/FutureCallbackWrapper.java | 4 +- .../HttpAsyncRequestProducerWrapper.java | 4 +- .../helper/RequestHeaderAccessor.java | 3 + ...cyApacheHttpClientInstrumentationTest.java | 6 +- apm-agent-plugins/apm-api-plugin/pom.xml | 2 +- .../agent/plugin/api/ApiInstrumentation.java | 5 + .../api/CaptureSpanInstrumentation.java | 4 + .../CaptureTransactionInstrumentation.java | 4 + .../plugin/api/TracedInstrumentation.java | 4 + .../plugin/api/SpanInstrumentationTest.java | 15 +- .../co/elastic/apm/api/AnnotationApiTest.java | 1 - .../BlockingQueueContextPropagationTest.java | 10 +- .../api/ElasticApmApiInstrumentationTest.java | 20 +- .../apm-asynchttpclient-plugin/pom.xml | 2 +- ...bstractAsyncHttpClientInstrumentation.java | 159 ++++----- .../{helper => }/RequestHeaderSetter.java | 9 +- .../apm-bootdelegation-plugin/pom.xml | 2 +- ...pDelegationClassLoaderInstrumentation.java | 5 + apm-agent-plugins/apm-dubbo-plugin/pom.xml | 2 +- .../dubbo/AbstractDubboInstrumentation.java | 5 + .../AbstractDubboInstrumentationTest.java | 160 --------- .../AlibabaDubboInstrumentationTest.java | 150 --------- .../dubbo/ApacheDubboInstrumentationTest.java | 228 ------------- .../dubbo/api/impl/DubboTestApiImpl.java | 156 --------- .../apm-error-logging-plugin/pom.xml | 2 +- ...ctLoggerErrorCapturingInstrumentation.java | 5 + ...stractErrorLoggingInstrumentationTest.java | 12 +- .../apm-es-restclient-plugin-5_6/pom.xml | 2 +- .../apm-es-restclient-plugin-6_4/pom.xml | 2 +- .../apm-es-restclient-plugin-7_1/pom.xml | 2 +- .../apm-es-restclient-plugin-common/pom.xml | 2 +- ...lasticsearchRestClientInstrumentation.java | 5 + .../AbstractEsClientInstrumentationTest.java | 14 +- .../apm-es-restclient-plugin/pom.xml | 2 +- apm-agent-plugins/apm-grails-plugin/pom.xml | 2 +- .../GrailsTransactionNameInstrumentation.java | 5 + .../apm-grpc/apm-grpc-plugin/pom.xml | 2 +- .../apm/agent/grpc/BaseInstrumentation.java | 23 +- .../agent/grpc/ChannelInstrumentation.java | 40 +-- .../grpc/ClientCallImplInstrumentation.java | 125 ++----- .../GrpcHelperImpl.java => GrpcHelper.java} | 134 ++++++-- .../ServerCallHandlerInstrumentation.java | 47 +-- .../agent/grpc/ServerCallInstrumentation.java | 23 +- .../ServerCallListenerInstrumentation.java | 95 ++---- .../apm/agent/grpc/helper/GrpcHelper.java | 181 ---------- ...AbstractGrpcClientInstrumentationTest.java | 16 +- .../grpc/AbstractGrpcContextHeadersTest.java | 8 +- ...AbstractGrpcServerInstrumentationTest.java | 11 +- .../grpc/testapp/AbstractGrpcAppTest.java | 3 +- .../apm-grpc/apm-grpc-test-1.6.1/pom.xml | 2 +- apm-agent-plugins/apm-grpc/pom.xml | 2 +- .../apm-hibernate-search-plugin-5_x/pom.xml | 2 +- .../v5_x/HibernateSearch5Instrumentation.java | 5 + .../apm-hibernate-search-plugin-6_x/pom.xml | 2 +- .../v6_x/HibernateSearch6Instrumentation.java | 5 + .../pom.xml | 2 +- .../apm-hibernate-search-plugin/pom.xml | 2 +- apm-agent-plugins/apm-httpclient-core/pom.xml | 2 +- .../http/client/HttpClientHelperTest.java | 1 - ...AbstractHttpClientInstrumentationTest.java | 30 +- .../apm-java-concurrent-plugin/pom.xml | 2 +- .../concurrent/ExecutorInstrumentation.java | 6 +- .../ForkJoinTaskInstrumentation.java | 5 - .../apm/agent/concurrent/JavaConcurrent.java | 4 +- ...leCallableForkJoinTaskInstrumentation.java | 5 - .../AsyncTraceMethodInstrumentationTest.java | 2 +- .../agent/concurrent/ScopeManagementTest.java | 22 +- apm-agent-plugins/apm-jaxrs-plugin/pom.xml | 2 +- .../JaxRsTransactionNameInstrumentation.java | 5 + ...xRsTransactionNameInstrumentationTest.java | 32 +- apm-agent-plugins/apm-jaxws-plugin/pom.xml | 2 +- .../JaxWsTransactionNameInstrumentation.java | 5 + apm-agent-plugins/apm-jdbc-plugin/pom.xml | 2 +- .../apm/agent/jdbc/JdbcInstrumentation.java | 5 - .../apm/agent/jdbc/signature/ScannerTest.java | 54 ++- .../jdbc/signature/SignatureParserTest.java | 64 +++- .../src/test/resources/signature_tests.json | 144 -------- .../apm-jdk-httpclient-plugin/pom.xml | 42 +++ .../AbstractHttpClientInstrumentation.java | 59 ++++ .../HttpClientAsyncInstrumentation.java | 92 ++++++ .../httpclient/HttpClientInstrumentation.java | 83 +++++ .../HttpClientRequestPropertyAccessor.java | 45 +++ .../HttpRequestHeadersInstrumentation.java | 75 +++++ ...ic.apm.agent.sdk.ElasticApmInstrumentation | 3 + .../HttpClientAsyncInstrumentationTest.java | 54 +++ .../HttpClientInstrumentationTest.java | 63 ++++ apm-agent-plugins/apm-jms-plugin/pom.xml | 2 +- .../apm/agent/jms/BaseJmsInstrumentation.java | 5 + .../apm/agent/jms/JmsInstrumentationIT.java | 2 - .../apm/agent/jms/spring/SpringJmsTest.java | 1 - apm-agent-plugins/apm-jmx-plugin/pom.xml | 2 +- .../apm/agent/jmx/JmxMetricTrackerTest.java | 9 +- apm-agent-plugins/apm-jsf-plugin/pom.xml | 2 +- .../jsf/JsfLifecycleInstrumentation.java | 5 + .../apm-kafka-base-plugin/pom.xml | 2 +- .../agent/kafka/BaseKafkaInstrumentation.java | 5 + .../apm/agent/kafka/KafkaLegacyClientIT.java | 1 - .../apm-kafka-headers-plugin/pom.xml | 2 +- .../co/elastic/apm/agent/kafka/KafkaIT.java | 1 - .../apm/agent/kafka/KafkaLegacyBrokerIT.java | 1 - apm-agent-plugins/apm-kafka-plugin/pom.xml | 2 +- .../apm-log-correlation-plugin/pom.xml | 2 +- .../agent/mdc/MdcActivationListenerTest.java | 4 + .../apm-log-shipper-plugin/pom.xml | 2 +- .../log/shipper/ApmServerLogShipper.java | 6 +- .../log/shipper/ApmServerLogShipperTest.java | 42 ++- .../apm-micrometer-plugin/pom.xml | 30 ++ .../micrometer/MicrometerInstrumentation.java | 85 +++++ .../MicrometerMeterRegistrySerializer.java | 199 +++++++++++ .../micrometer/MicrometerMetricsReporter.java | 111 +++++++ .../apm/agent/micrometer}/package-info.java | 9 +- ...ic.apm.agent.sdk.ElasticApmInstrumentation | 1 + .../MicrometerInstrumentationTest.java | 65 ++++ .../MicrometerMetricsReporterTest.java | 238 ++++++++++++++ .../apm-mongoclient-plugin/pom.xml | 2 +- .../MongoClientInstrumentation.java | 5 + ...bstractMongoClientInstrumentationTest.java | 18 +- apm-agent-plugins/apm-okhttp-plugin/pom.xml | 2 +- .../AbstractOkHttp3ClientInstrumentation.java | 5 + .../AbstractOkHttpClientInstrumentation.java | 5 + .../apm-opentracing-plugin/pom.xml | 2 +- .../OpenTracingBridgeInstrumentation.java | 5 + apm-agent-plugins/apm-process-plugin/pom.xml | 2 +- .../process/BaseProcessInstrumentation.java | 5 - .../CommonsExecAsyncInstrumentation.java | 5 - .../apm/agent/process/ProcessHelperTest.java | 1 + .../apm-profiling-plugin/pom.xml | 2 +- .../profiler/ProfilingConfiguration.java | 33 +- .../apm/agent/profiler/ProfilingFactory.java | 23 +- .../apm/agent/profiler/SamplingProfiler.java | 115 +++++-- .../profiler/asyncprofiler/AsyncProfiler.java | 23 +- .../profiler/collections/IntIntConsumer.java | 4 +- .../collections/LongLongConsumer.java | 4 +- .../libasyncProfiler-linux-arm.so | Bin 220552 -> 236152 bytes .../libasyncProfiler-linux-x64.so | Bin 259553 -> 271714 bytes .../libasyncProfiler-linux-x86.so | Bin 253580 -> 253732 bytes .../asyncprofiler/libasyncProfiler-macos.so | Bin 193512 -> 198640 bytes .../profiler/SamplingProfilerQueueTest.java | 8 +- .../profiler/SamplingProfilerReplay.java | 2 - .../agent/profiler/SamplingProfilerTest.java | 168 ++++++++-- .../asyncprofiler/AsyncProfilerTest.java | 64 ++++ .../apm-quartz-job-plugin/pom.xml | 2 +- .../JobTransactionNameInstrumentation.java | 5 + .../apm-jedis-2-tests/pom.xml | 2 +- .../jedis/Jedis2InstrumentationTest.java | 13 +- .../apm-jedis-3-tests/pom.xml | 2 +- .../apm-redis-plugin/apm-jedis-plugin/pom.xml | 2 +- .../redis/jedis/JedisInstrumentation.java | 5 + .../jedis/JedisSpanNameInstrumentation.java | 5 + .../jedis/Jedis1InstrumentationTest.java | 11 +- .../apm-lettuce-3-tests/pom.xml | 2 +- .../lettuce/Lettuce3InstrumentationTest.java | 11 +- .../apm-lettuce-plugin/pom.xml | 2 +- .../lettuce/Lettuce34Instrumentation.java | 5 + .../Lettuce5StartSpanInstrumentation.java | 4 + .../Lettuce5StopSpanInstrumentation.java | 5 + .../lettuce/Lettuce4InstrumentationTest.java | 25 +- .../lettuce/Lettuce5InstrumentationTest.java | 42 +-- .../apm-redis-plugin/apm-redis-common/pom.xml | 2 +- .../AbstractRedisInstrumentationTest.java | 2 + .../apm-redisson-plugin/pom.xml | 2 +- .../RedisConnectionInstrumentation.java | 5 + .../redisson/RedissonInstrumentationTest.java | 94 +++--- apm-agent-plugins/apm-redis-plugin/pom.xml | 2 +- .../apm-scala-concurrent-plugin/pom.xml | 2 +- .../concurrent/FutureInstrumentation.java | 5 + .../apm-scheduled-annotation-plugin/pom.xml | 2 +- ...heduledTransactionNameInstrumentation.java | 5 + .../scheduled/TimerTaskInstrumentation.java | 5 + ...ledTransactionNameInstrumentationTest.java | 16 +- .../TimerTaskInstrumentationTest.java | 95 +++--- apm-agent-plugins/apm-servlet-plugin/pom.xml | 2 +- .../AbstractServletInstrumentation.java | 5 - .../servlet/RequestDispatcherSpanType.java} | 31 +- .../apm/agent/servlet/ServletApiAdvice.java | 151 ++++++--- .../apm/agent/servlet/ServletGlobalState.java | 4 +- .../servlet/ServletTransactionHelper.java | 4 +- .../servlet/ServletInstrumentationTest.java | 131 +++++++- .../servlet/ServletTransactionHelperTest.java | 27 +- .../servlet/TestRequestBodyCapturing.java | 10 - .../apm-spring-resttemplate-plugin/pom.xml | 2 +- .../SpringRestTemplateInstrumentation.java | 5 + .../apm-spring-webmvc-plugin/pom.xml | 2 +- .../ExceptionHandlerInstrumentation.java | 5 + .../SpringServiceNameInstrumentation.java | 5 + .../SpringTransactionNameInstrumentation.java | 42 ++- .../webmvc/ViewRenderInstrumentation.java | 5 + ...ctExceptionHandlerInstrumentationTest.java | 2 +- ...tractViewRenderingInstrumentationTest.java | 2 +- .../apm-urlconnection-plugin/pom.xml | 2 +- .../HttpUrlConnectionInstrumentation.java | 5 - .../SSLContextInstrumentation.java | 5 - .../SSLContextInstrumentationTest.java | 2 +- apm-agent-plugins/pom.xml | 4 +- apm-opentracing/pom.xml | 2 +- .../OpenTracingBridgeCloseTest.java | 8 +- .../opentracing/OpenTracingBridgeTest.java | 8 +- cloudfoundry/index.yml | 1 + docs/configuration.asciidoc | 80 ++++- docs/metrics.asciidoc | 227 ++++++++++++- docs/setup-ssl.asciidoc | 34 ++ docs/setup.asciidoc | 10 +- docs/supported-technologies.asciidoc | 16 +- docs/troubleshooting.asciidoc | 33 +- elastic-apm-agent/pom.xml | 13 +- .../configuration/ConfigurationExporter.java | 30 +- .../ConfigurationExporterTest.java | 14 + .../pom.xml | 2 +- .../apm/servlet/tests/ServletApiTestApp.java | 23 ++ .../cdi-app/cdi-app-dependent/pom.xml | 2 +- .../cdi-app/cdi-app-standalone/pom.xml | 2 +- integration-tests/cdi-app/pom.xml | 2 +- .../external-plugin-test/pom.xml | 6 +- .../jsf-app/jsf-app-dependent/pom.xml | 2 +- .../jsf-app/jsf-app-standalone/pom.xml | 2 +- integration-tests/jsf-app/pom.xml | 2 +- integration-tests/pom.xml | 2 +- integration-tests/simple-webapp/pom.xml | 2 +- .../java/co/elastic/webapp/ErrorServlet.java | 42 +++ .../co/elastic/webapp/ForwardingServlet.java | 30 +- .../co/elastic/webapp/IncludingServlet.java | 17 +- .../src/main/webapp/WEB-INF/web.xml | 21 ++ integration-tests/soap-test/pom.xml | 2 +- integration-tests/spring-boot-1-5/pom.xml | 2 +- .../apm/spring/boot/SpringBoot1_5IT.java | 2 +- integration-tests/spring-boot-2/pom.xml | 2 +- .../spring-boot-2/spring-boot-2-base/pom.xml | 2 +- .../spring/boot/AbstractSpringBootTest.java | 5 +- .../spring-boot-2/spring-boot-2-jetty/pom.xml | 2 +- .../spring-boot-2-tomcat/pom.xml | 2 +- .../spring-boot-2-undertow/pom.xml | 2 +- mvnw | 0 mvnw.cmd | 0 pom.xml | 54 +-- scripts/jenkins/branch_creation.sh | 0 scripts/jenkins/build_docker.sh | 0 scripts/jenkins/check_maven.sh | 0 scripts/jenkins/docs_check.sh | 0 scripts/jenkins/docs_release_check/check.py | 0 scripts/jenkins/fetch_nexus_id.sh | 4 + scripts/jenkins/generate_release_notes_url.sh | 0 scripts/jenkins/is_major.sh | 0 scripts/jenkins/maven_artifact_url.sh | 0 scripts/jenkins/push_docker.sh | 0 scripts/jenkins/release_env.sh | 0 scripts/jenkins/run-benchmarks.sh | 0 scripts/jenkins/smoketests-01.sh | 0 scripts/jenkins/smoketests-02.sh | 0 scripts/jenkins/tags.sh | 12 + scripts/jenkins/update_cloudfoundry.sh | 0 369 files changed, 6906 insertions(+), 3350 deletions(-) create mode 100644 apm-agent-core/src/main/java/co/elastic/apm/agent/bci/IndyPluginClassLoaderFactory.java create mode 100644 apm-agent-core/src/main/java/co/elastic/apm/agent/bci/SFAgentUtil.java create mode 100644 apm-agent-core/src/main/java/co/elastic/apm/agent/bci/SFConfigInfo.java create mode 100644 apm-agent-core/src/main/java/co/elastic/apm/agent/bci/SFTagInfo.java create mode 100644 apm-agent-core/src/main/java/co/elastic/apm/agent/context/ExecutorServiceShutdownLifecycleListener.java create mode 100644 apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/CGroupMetrics.java create mode 100644 apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/MetricRegistryReporter.java create mode 100644 apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/CGroupMetricsTest.java create mode 100644 apm-agent-core/src/test/java/co/elastic/apm/agent/report/ApmServerClientProxySupportTest.java create mode 100644 apm-agent-core/src/test/java/specs/TestJsonSpec.java create mode 100644 apm-agent-core/src/test/resources/json-specs/sql_signature_examples.json rename apm-agent-plugins/apm-jdbc-plugin/src/test/resources/scanner_tests.json => apm-agent-core/src/test/resources/json-specs/sql_token_examples.json (99%) create mode 100644 apm-agent-core/src/test/resources/json-specs/wildcard_matcher_tests.json create mode 100644 apm-agent-core/src/test/resources/proc/cgroup create mode 100644 apm-agent-core/src/test/resources/proc/cgroup2 create mode 100644 apm-agent-core/src/test/resources/proc/cgroup2_only_0 create mode 100644 apm-agent-core/src/test/resources/proc/cgroup2_only_memory create mode 100644 apm-agent-core/src/test/resources/proc/limited/memory/memory.limit_in_bytes create mode 100644 apm-agent-core/src/test/resources/proc/limited/memory/memory.stat create mode 100644 apm-agent-core/src/test/resources/proc/limited/memory/memory.usage_in_bytes create mode 100644 apm-agent-core/src/test/resources/proc/sys_cgroup2/slice/memory.current create mode 100644 apm-agent-core/src/test/resources/proc/sys_cgroup2/slice/memory.max create mode 100644 apm-agent-core/src/test/resources/proc/sys_cgroup2/slice/memory.stat create mode 100644 apm-agent-core/src/test/resources/proc/sys_cgroup2_unlimited/slice/memory.current create mode 100644 apm-agent-core/src/test/resources/proc/sys_cgroup2_unlimited/slice/memory.max create mode 100644 apm-agent-core/src/test/resources/proc/sys_cgroup2_unlimited/slice/memory.stat create mode 100644 apm-agent-core/src/test/resources/proc/sys_cgroup2_unlimited_stat_different_order/slice/memory.current create mode 100644 apm-agent-core/src/test/resources/proc/sys_cgroup2_unlimited_stat_different_order/slice/memory.max create mode 100644 apm-agent-core/src/test/resources/proc/sys_cgroup2_unlimited_stat_different_order/slice/memory.stat create mode 100644 apm-agent-core/src/test/resources/proc/unlimited/memory/memory.limit_in_bytes create mode 100644 apm-agent-core/src/test/resources/proc/unlimited/memory/memory.stat create mode 100644 apm-agent-core/src/test/resources/proc/unlimited/memory/memory.usage_in_bytes create mode 100644 apm-agent-core/src/test/resources/squid/squid_basic-auth.conf create mode 100644 apm-agent-core/src/test/resources/squid/squid_no-auth.conf create mode 100644 apm-agent-core/src/test/resources/squid/squid_passwd rename apm-agent-core/src/test/resources/{elasticapm.properties => test.elasticapm.properties} (100%) create mode 100644 apm-agent-core/src/test/resources/test.elasticapm.with-service-name.properties delete mode 100644 apm-agent-plugins/apm-apache-httpclient-plugin/src/main/java/co/elastic/apm/agent/httpclient/helper/ApacheHttpAsyncClientHelperImpl.java rename apm-agent-plugins/apm-asynchttpclient-plugin/src/main/java/co/elastic/apm/agent/asynchttpclient/{helper => }/RequestHeaderSetter.java (84%) delete mode 100644 apm-agent-plugins/apm-dubbo-plugin/src/test/java/co/elastic/apm/agent/dubbo/AbstractDubboInstrumentationTest.java delete mode 100644 apm-agent-plugins/apm-dubbo-plugin/src/test/java/co/elastic/apm/agent/dubbo/AlibabaDubboInstrumentationTest.java delete mode 100644 apm-agent-plugins/apm-dubbo-plugin/src/test/java/co/elastic/apm/agent/dubbo/ApacheDubboInstrumentationTest.java delete mode 100644 apm-agent-plugins/apm-dubbo-plugin/src/test/java/co/elastic/apm/agent/dubbo/api/impl/DubboTestApiImpl.java rename apm-agent-plugins/apm-grpc/apm-grpc-plugin/src/main/java/co/elastic/apm/agent/grpc/{helper/GrpcHelperImpl.java => GrpcHelper.java} (68%) delete mode 100644 apm-agent-plugins/apm-grpc/apm-grpc-plugin/src/main/java/co/elastic/apm/agent/grpc/helper/GrpcHelper.java create mode 100644 apm-agent-plugins/apm-jdk-httpclient-plugin/pom.xml create mode 100644 apm-agent-plugins/apm-jdk-httpclient-plugin/src/main/java/co/elastic/apm/agent/httpclient/AbstractHttpClientInstrumentation.java create mode 100644 apm-agent-plugins/apm-jdk-httpclient-plugin/src/main/java/co/elastic/apm/agent/httpclient/HttpClientAsyncInstrumentation.java create mode 100644 apm-agent-plugins/apm-jdk-httpclient-plugin/src/main/java/co/elastic/apm/agent/httpclient/HttpClientInstrumentation.java create mode 100644 apm-agent-plugins/apm-jdk-httpclient-plugin/src/main/java/co/elastic/apm/agent/httpclient/HttpClientRequestPropertyAccessor.java create mode 100644 apm-agent-plugins/apm-jdk-httpclient-plugin/src/main/java/co/elastic/apm/agent/httpclient/HttpRequestHeadersInstrumentation.java create mode 100644 apm-agent-plugins/apm-jdk-httpclient-plugin/src/main/resources/META-INF/services/co.elastic.apm.agent.sdk.ElasticApmInstrumentation create mode 100644 apm-agent-plugins/apm-jdk-httpclient-plugin/src/test/java/co/elastic/apm/agent/httpclient/HttpClientAsyncInstrumentationTest.java create mode 100644 apm-agent-plugins/apm-jdk-httpclient-plugin/src/test/java/co/elastic/apm/agent/httpclient/HttpClientInstrumentationTest.java create mode 100644 apm-agent-plugins/apm-micrometer-plugin/pom.xml create mode 100644 apm-agent-plugins/apm-micrometer-plugin/src/main/java/co/elastic/apm/agent/micrometer/MicrometerInstrumentation.java create mode 100644 apm-agent-plugins/apm-micrometer-plugin/src/main/java/co/elastic/apm/agent/micrometer/MicrometerMeterRegistrySerializer.java create mode 100644 apm-agent-plugins/apm-micrometer-plugin/src/main/java/co/elastic/apm/agent/micrometer/MicrometerMetricsReporter.java rename apm-agent-plugins/{apm-asynchttpclient-plugin/src/main/java/co/elastic/apm/agent/asynchttpclient/helper => apm-micrometer-plugin/src/main/java/co/elastic/apm/agent/micrometer}/package-info.java (88%) create mode 100644 apm-agent-plugins/apm-micrometer-plugin/src/main/resources/META-INF/services/co.elastic.apm.agent.sdk.ElasticApmInstrumentation create mode 100644 apm-agent-plugins/apm-micrometer-plugin/src/test/java/co/elastic/apm/agent/micrometer/MicrometerInstrumentationTest.java create mode 100644 apm-agent-plugins/apm-micrometer-plugin/src/test/java/co/elastic/apm/agent/micrometer/MicrometerMetricsReporterTest.java mode change 100755 => 100644 apm-agent-plugins/apm-profiling-plugin/src/main/resources/asyncprofiler/libasyncProfiler-linux-arm.so mode change 100755 => 100644 apm-agent-plugins/apm-profiling-plugin/src/main/resources/asyncprofiler/libasyncProfiler-linux-x64.so mode change 100755 => 100644 apm-agent-plugins/apm-profiling-plugin/src/main/resources/asyncprofiler/libasyncProfiler-linux-x86.so mode change 100755 => 100644 apm-agent-plugins/apm-profiling-plugin/src/main/resources/asyncprofiler/libasyncProfiler-macos.so create mode 100644 apm-agent-plugins/apm-profiling-plugin/src/test/java/co/elastic/apm/agent/profiler/asyncprofiler/AsyncProfilerTest.java rename apm-agent-plugins/{apm-grpc/apm-grpc-plugin/src/main/java/co/elastic/apm/agent/grpc/helper/package-info.java => apm-servlet-plugin/src/main/java/co/elastic/apm/agent/servlet/RequestDispatcherSpanType.java} (58%) create mode 100644 docs/setup-ssl.asciidoc create mode 100644 integration-tests/simple-webapp/src/main/java/co/elastic/webapp/ErrorServlet.java rename apm-agent-plugins/apm-dubbo-plugin/src/test/java/co/elastic/apm/agent/dubbo/api/DubboTestApi.java => integration-tests/simple-webapp/src/main/java/co/elastic/webapp/ForwardingServlet.java (65%) rename apm-agent-plugins/apm-dubbo-plugin/src/test/java/co/elastic/apm/agent/dubbo/api/exception/BizException.java => integration-tests/simple-webapp/src/main/java/co/elastic/webapp/IncludingServlet.java (65%) mode change 100755 => 100644 mvnw mode change 100755 => 100644 mvnw.cmd mode change 100755 => 100644 scripts/jenkins/branch_creation.sh mode change 100755 => 100644 scripts/jenkins/build_docker.sh mode change 100755 => 100644 scripts/jenkins/check_maven.sh mode change 100755 => 100644 scripts/jenkins/docs_check.sh mode change 100755 => 100644 scripts/jenkins/docs_release_check/check.py create mode 100644 scripts/jenkins/fetch_nexus_id.sh mode change 100755 => 100644 scripts/jenkins/generate_release_notes_url.sh mode change 100755 => 100644 scripts/jenkins/is_major.sh mode change 100755 => 100644 scripts/jenkins/maven_artifact_url.sh mode change 100755 => 100644 scripts/jenkins/push_docker.sh mode change 100755 => 100644 scripts/jenkins/release_env.sh mode change 100755 => 100644 scripts/jenkins/run-benchmarks.sh mode change 100755 => 100644 scripts/jenkins/smoketests-01.sh mode change 100755 => 100644 scripts/jenkins/smoketests-02.sh create mode 100644 scripts/jenkins/tags.sh mode change 100755 => 100644 scripts/jenkins/update_cloudfoundry.sh diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index e2ae7ccec9..11357f8866 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -20,42 +20,54 @@ endif::[] === Unreleased -[[release-notes-1.18.0]] -==== 1.18.0 - YYYY/MM/DD +[[release-notes-1.19.0]] +==== 1.19.0 - YYYY/MM/DD [float] ===== Breaking changes [float] ===== Features -* Experimental support for runtime attachment now also for OSGi containers, JBoss, and WildFly -* New mitigation of OSGi bootdelegation errors (`NoClassDefFoundError`). - You can remove any `org.osgi.framework.bootdelegation` related configuration. - This release also removes the configuration option `boot_delegation_packages`. -* Overhaul of the `ExecutorService` instrumentation that avoids `ClassCastException` issues - {pull}1206[#1206] -* Support for `ForkJoinPool` and `ScheduledExecutorService` (see <>) -* Support for `ExecutorService#invokeAny` and `ExecutorService#invokeAll` -* Added support for `java.util.TimerTask` - {pull}1235[#1235] -* Add capturing of request body in Elasticsearch queries: `_msearch`, `_count`, `_msearch/template`, `_search/template`, `_rollup_search` - {pull}1222[#1222] -* Add <> flag -* Add experimental support for Scala Futures -* The agent now collects heap memory pools metrics - {pull}1228[#1228] [float] ===== Bug fixes -* Fixes error capturing for log4j2 loggers. Version 1.17.0 introduced a regression. -* Fixes `NullPointerException` related to JAX-RS and Quartz instrumentation - {pull}1249[#1249] -* Expanding k8s pod ID discovery to some formerly non-supported environments -* When `recording` is set to `false`, the agent will not send captured errors anymore. -* Fixes NPE in Dubbo instrumentation that occurs when the application is acting both as a provider and as a consumer - {pull}1260[#1260] -* Adding a delay by default what attaching the agent to Tomcat using the premain route to work around the JUL - deadlock issue - {pull}1262[#1262] -* Fixes missing `jboss.as:*` MBeans on JBoss - {pull}1257[#1257] -* Fixes a `NoClassDefFoundError` in the JMS instrumentation of `MessageListener` - {pull}1287[#1287] [[release-notes-1.x]] === Java Agent version 1.x +[[release-notes-1.18.0]] +==== 1.18.0 - 2020/09/08 + +[float] +===== Features +* Deprecating `ignore_urls` config in favour of <> to align + with other agents, while still allowing the old config name for backward compatibility - {pull}1315[#1315] +* Enabling instrumentation of classes compiled with Java 1.4. This is reverting the restriction of instrumenting only + bytecode of Java 1.5 or higher ({pull}320[#320]), which was added due to potential `VerifyError`. Such errors should be + avoided now by the usage of `TypeConstantAdjustment` - {pull}1317[#1317] +* Enabling agent to work without attempting any communication with APM server, by allowing setting `server_urls` with + an empty string - {pull}1295[#1295] +* Add <> - {pull}1303[#1303] +* Add `profiling_inferred_spans_lib_directory` option to override the default temp directory used for exporting the async-profiler library. + This is useful for server-hardened environments where `/tmp` is often configured with `noexec`, leading to `java.lang.UnsatisfiedLinkError` errors - {pull}1350[#1350] +* Create spans for Servlet dispatches to FORWARD, INCLUDE and ERROR - {pull}1212[#1212] +* Support JDK 11 HTTPClient - {pull}1307[#1307] +* Lazily create profiler temporary files {pull}1360[#1360] +* Convert the followings to Indy Plugins (see details in <>): gRPC, + AsyncHttpClient, Apache HttpClient +* The agent now collects cgroup memory metrics (see details in <>) +* Update async-profiler to 1.8.1 {pull}1382[#1382] + +[float] +===== Bug fixes +* Fixes a `NoClassDefFoundError` in the JMS instrumentation of `MessageListener` - {pull}1287[#1287] +* Fix `/ by zero` error message when setting `server_urls` with an empty string - {pull}1295[#1295] +* Fix `ClassNotFoundException` or `ClassCastException` in some cases where special log4j configurations are used - {pull}1322[#1322] +* Fix `NumberFormatException` when using early access Java version - {pull}1325[#1325] +* Fix `service_name` config being ignored when set to the same auto-discovered default value - {pull}1324[#1324] +* Fix service name error when updating a web app on a Servlet container - {pull}1326[#1326] +* Fix remote attach 'jps' executable not found when 'java' binary is symlinked ot a JRE - {pull}1352[#1352] + [[release-notes-1.18.0.rc1]] ==== 1.18.0.RC1 - 2020/07/22 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c1af778961..6309a641e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -79,7 +79,7 @@ These live templates can be pasted in Preferences > Editor > Live Templates > ot **`enter`** ```xml -