From b37db5885e8b4d41107169a6187c80a67874de03 Mon Sep 17 00:00:00 2001 From: Rafael Winterhalter Date: Thu, 28 Sep 2023 10:30:40 +0200 Subject: [PATCH] Move metrics and log reporting to ReportingTracer, and remove obsolete dependencies on core module. --- .../configuration/CoreConfiguration.java | 3 ++ .../ServerlessConfiguration.java | 10 ++++++ .../apm/agent/impl/ElasticApmTracer.java | 23 ++++++++++++ .../agent/impl/transaction/Transaction.java | 2 +- .../apm/agent/metrics/MetricCollector.java | 2 ++ .../apm/agent/metrics/MetricRegistry.java | 2 ++ .../elastic/apm/agent/metrics/MetricSet.java | 2 ++ .../metrics/builtin/AgentOverheadMetrics.java | 2 +- .../metrics/builtin/AgentReporterMetrics.java | 2 +- .../agent/metrics/builtin/CGroupMetrics.java | 4 +-- .../agent/metrics/builtin/JvmFdMetrics.java | 4 +-- .../agent/metrics/builtin/JvmGcMetrics.java | 4 +-- .../metrics/builtin/JvmMemoryMetrics.java | 4 +-- .../agent/metrics/builtin/SystemMetrics.java | 4 +-- .../agent/metrics/builtin/ThreadMetrics.java | 4 +-- .../report/serialize/DslJsonSerializer.java | 2 +- .../serialize/MetricRegistryReporter.java | 2 +- .../serialize/MetricRegistrySerializer.java | 2 +- .../apm/agent/impl/ElasticApmTracerTest.java | 2 +- .../apm/agent/impl/SpanTypeBreakdownTest.java | 2 +- .../apm/agent/metrics/MetricRegistryTest.java | 2 ++ .../builtin/AgentOverheadMetricsTest.java | 2 +- .../builtin/AgentReporterMetricsTest.java | 2 +- .../metrics/builtin/CGroupMetricsTest.java | 2 +- .../metrics/builtin/JvmFdMetricsTest.java | 2 +- .../metrics/builtin/JvmMemoryMetricsTest.java | 2 +- .../metrics/builtin/SystemMetricsTest.java | 2 +- .../metrics/builtin/ThreadMetricsTest.java | 2 +- .../serialize/MetricSetSerializationTest.java | 2 +- .../apm-ecs-logging-plugin/pom.xml | 7 ---- apm-agent-plugins/apm-jmx-plugin/pom.xml | 9 ----- .../co/elastic/apm/agent/jmx/JmxMetric.java | 3 +- .../apm/agent/jmx/JmxMetricTracker.java | 29 ++++++++------- .../apm/agent/jmx/JmxMetricTrackerTest.java | 2 +- ...ulLoggerErrorCapturingInstrumentation.java | 1 - .../AbstractJulEcsReformattingHelper.java | 6 ++-- .../jul/sending/JulLogSenderHandler.java | 10 +++--- .../Log4J1EcsReformattingHelper.java | 6 ++-- .../log4j1/sending/LogSenderAppender.java | 10 +++--- .../Log4j2_7PlusLogCorrelationHelper.java | 1 - .../Log4J2EcsReformattingHelper.java | 6 ++-- .../sending/Log4j2LogSenderAppender.java | 10 +++--- .../LogbackEcsReformattingHelper.java | 6 ++-- .../sending/LogbackLogSenderAppender.java | 10 +++--- .../AbstractEcsReformattingHelper.java | 36 ++++++++----------- apm-agent-plugins/apm-logging-plugin/pom.xml | 9 ----- .../micrometer/MicrometerMetricsReporter.java | 2 +- apm-agent-plugins/apm-servlet-plugin/pom.xml | 6 ---- .../apm-spring-webmvc-spring5/pom.xml | 6 ---- .../configuration/CoreConfiguration.java | 4 +++ .../ServerlessConfiguration.java | 5 +++ .../tracer/reporting}/DoubleSupplier.java | 2 +- .../apm/agent/tracer/reporting}/Labels.java | 6 +--- .../tracer/reporting/ReportingTracer.java | 21 +++++++++++ .../agent/tracer/reporting}/LabelsTest.java | 2 +- integration-tests/spring-boot-1-5/pom.xml | 7 ++++ 56 files changed, 176 insertions(+), 146 deletions(-) rename {apm-agent-core/src/main/java/co/elastic/apm/agent/metrics => apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting}/DoubleSupplier.java (94%) rename {apm-agent-core/src/main/java/co/elastic/apm/agent/metrics => apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting}/Labels.java (98%) rename {apm-agent-core/src/test/java/co/elastic/apm/agent/metrics => apm-agent-tracer/src/test/java/co/elastic/apm/agent/tracer/reporting}/LabelsTest.java (99%) diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/configuration/CoreConfiguration.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/configuration/CoreConfiguration.java index 7200f1ab4f..188949066f 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/configuration/CoreConfiguration.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/configuration/CoreConfiguration.java @@ -876,6 +876,7 @@ public ConfigurationOption getServiceNameConfig() { } @Nullable + @Override public String getServiceNodeName() { String nodeName = serviceNodeName.get(); if (nodeName == null || nodeName.trim().isEmpty()) { @@ -889,6 +890,7 @@ public long getDelayTracerStartMs() { } @Nullable + @Override public String getServiceVersion() { return serviceVersion.get(); } @@ -899,6 +901,7 @@ public String getHostname() { } @Nullable + @Override public String getEnvironment() { return environment.get(); } diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/configuration/ServerlessConfiguration.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/configuration/ServerlessConfiguration.java index 36875fbf04..7856019607 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/configuration/ServerlessConfiguration.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/configuration/ServerlessConfiguration.java @@ -22,11 +22,16 @@ import org.stagemonitor.configuration.ConfigurationOption; import org.stagemonitor.configuration.ConfigurationOptionProvider; +import javax.annotation.Nullable; + public class ServerlessConfiguration extends ConfigurationOptionProvider implements co.elastic.apm.agent.tracer.configuration.ServerlessConfiguration { public static final String SERVERLESS_CATEGORY = "Serverless"; private final boolean runsOnAwsLambda; + @Nullable + private final String awsLambdaLogStreamName = PrivilegedActionUtils.getEnv("AWS_LAMBDA_LOG_STREAM_NAME"); + public ServerlessConfiguration() { String lambdaName = PrivilegedActionUtils.getEnv("AWS_LAMBDA_FUNCTION_NAME"); this.runsOnAwsLambda = null != lambdaName && !lambdaName.isEmpty(); @@ -65,4 +70,9 @@ public boolean runsOnAwsLambda() { return runsOnAwsLambda; } + @Override + @Nullable + public String awsLambdaLogStreamName() { + return awsLambdaLogStreamName; + } } diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/ElasticApmTracer.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/ElasticApmTracer.java index 6d6ca48506..043ab72165 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/ElasticApmTracer.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/ElasticApmTracer.java @@ -27,6 +27,8 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.configuration.ServerlessConfiguration; import co.elastic.apm.agent.context.InitializableLifecycleListener; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.tracer.service.ServiceInfo; import co.elastic.apm.agent.configuration.SpanConfiguration; import co.elastic.apm.agent.context.ClosableLifecycleListenerAdapter; @@ -947,11 +949,32 @@ public MetaDataFuture getMetaDataFuture() { return metaDataFuture; } + @Override + public void addMetric(String name, Labels labels, DoubleSupplier metric) { + metricRegistry.add(name, labels, metric); + } + + @Override + public void removeMetric(String name, Labels labels) { + metricRegistry.removeGauge(name, labels); + } + + @Override + public void reportLog(String log) { + reporter.reportLog(log); + } + + @Override + public void reportLog(byte[] log) { + reporter.reportLog(log); + } + @Override public ScheduledThreadPoolExecutor getSharedSingleThreadedPool() { return sharedPool; } + @Override public void addShutdownHook(Closeable closeable) { lifecycleListeners.add(ClosableLifecycleListenerAdapter.of(closeable)); } diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/transaction/Transaction.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/transaction/Transaction.java index aabac69aed..e9f59a6095 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/transaction/Transaction.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/impl/transaction/Transaction.java @@ -27,7 +27,7 @@ import co.elastic.apm.agent.impl.context.Response; import co.elastic.apm.agent.impl.context.TransactionContext; import co.elastic.apm.agent.impl.sampling.Sampler; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.metrics.Timer; import co.elastic.apm.agent.tracer.Outcome; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricCollector.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricCollector.java index b8ccd561f4..e7dadaa2c6 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricCollector.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricCollector.java @@ -18,6 +18,8 @@ */ package co.elastic.apm.agent.metrics; +import co.elastic.apm.agent.tracer.reporting.Labels; + public interface MetricCollector { void addMetricValue(String metric, Labels labels, double value); diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricRegistry.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricRegistry.java index 2df93faa7f..f0378cbbe2 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricRegistry.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricRegistry.java @@ -23,6 +23,8 @@ import co.elastic.apm.agent.report.ReporterConfiguration; import co.elastic.apm.agent.sdk.logging.Logger; import co.elastic.apm.agent.sdk.logging.LoggerFactory; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import org.HdrHistogram.WriterReaderPhaser; import javax.annotation.Nonnull; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricSet.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricSet.java index 474a3827be..07d8b354d5 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricSet.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/MetricSet.java @@ -19,6 +19,8 @@ package co.elastic.apm.agent.metrics; import co.elastic.apm.agent.tracer.pooling.Recyclable; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import javax.annotation.Nullable; import java.util.Map; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/AgentOverheadMetrics.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/AgentOverheadMetrics.java index b891e81d28..08bd932169 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/AgentOverheadMetrics.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/AgentOverheadMetrics.java @@ -21,7 +21,7 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.tracer.AbstractLifecycleListener; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricCollector; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.metrics.MetricsProvider; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/AgentReporterMetrics.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/AgentReporterMetrics.java index 6970d114ae..ff8818968d 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/AgentReporterMetrics.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/AgentReporterMetrics.java @@ -19,7 +19,7 @@ package co.elastic.apm.agent.metrics.builtin; import co.elastic.apm.agent.configuration.MetricsConfiguration; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricCollector; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.metrics.MetricsProvider; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/CGroupMetrics.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/CGroupMetrics.java index 051d37ea44..a37ce90ee5 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/CGroupMetrics.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/CGroupMetrics.java @@ -20,8 +20,8 @@ import co.elastic.apm.agent.tracer.AbstractLifecycleListener; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.DoubleSupplier; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.sdk.logging.Logger; import co.elastic.apm.agent.sdk.logging.LoggerFactory; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmFdMetrics.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmFdMetrics.java index 12e36a62ee..4ba2f16931 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmFdMetrics.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmFdMetrics.java @@ -20,8 +20,8 @@ import co.elastic.apm.agent.tracer.AbstractLifecycleListener; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.DoubleSupplier; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import javax.annotation.Nullable; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmGcMetrics.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmGcMetrics.java index a77b35f34a..1ad0fb24b0 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmGcMetrics.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmGcMetrics.java @@ -20,8 +20,8 @@ import co.elastic.apm.agent.tracer.AbstractLifecycleListener; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.DoubleSupplier; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import com.sun.management.ThreadMXBean; import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmMemoryMetrics.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmMemoryMetrics.java index c5fea8387f..7add5f4d11 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmMemoryMetrics.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/JvmMemoryMetrics.java @@ -20,8 +20,8 @@ import co.elastic.apm.agent.tracer.AbstractLifecycleListener; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.DoubleSupplier; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.sdk.logging.Logger; import co.elastic.apm.agent.sdk.logging.LoggerFactory; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/SystemMetrics.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/SystemMetrics.java index 7f69144ce5..61d1a8b876 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/SystemMetrics.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/SystemMetrics.java @@ -21,8 +21,8 @@ import co.elastic.apm.agent.tracer.AbstractLifecycleListener; import co.elastic.apm.agent.impl.ElasticApmTracer; import co.elastic.apm.agent.common.util.WildcardMatcher; -import co.elastic.apm.agent.metrics.DoubleSupplier; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.tracer.GlobalTracer; import co.elastic.apm.agent.util.JmxUtils; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/ThreadMetrics.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/ThreadMetrics.java index 549d840532..9be546121f 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/ThreadMetrics.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/builtin/ThreadMetrics.java @@ -20,8 +20,8 @@ import co.elastic.apm.agent.tracer.AbstractLifecycleListener; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.DoubleSupplier; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import java.lang.management.ManagementFactory; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonSerializer.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonSerializer.java index 6ec3676c4b..05c91a4e29 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonSerializer.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonSerializer.java @@ -59,7 +59,7 @@ import co.elastic.apm.agent.impl.transaction.StackFrame; import co.elastic.apm.agent.impl.transaction.TraceContext; import co.elastic.apm.agent.impl.transaction.Transaction; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.report.ApmServerClient; import co.elastic.apm.agent.sdk.internal.collections.LongList; import co.elastic.apm.agent.sdk.logging.Logger; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/MetricRegistryReporter.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/MetricRegistryReporter.java index 9f9c090346..369fca596d 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/MetricRegistryReporter.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/MetricRegistryReporter.java @@ -21,7 +21,7 @@ import co.elastic.apm.agent.tracer.service.ServiceInfo; import co.elastic.apm.agent.tracer.AbstractLifecycleListener; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.metrics.MetricSet; import co.elastic.apm.agent.report.Reporter; diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/MetricRegistrySerializer.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/MetricRegistrySerializer.java index e5b3700f39..70391123b4 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/MetricRegistrySerializer.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/MetricRegistrySerializer.java @@ -19,7 +19,7 @@ package co.elastic.apm.agent.report.serialize; import co.elastic.apm.agent.tracer.service.ServiceInfo; -import co.elastic.apm.agent.metrics.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; import co.elastic.apm.agent.metrics.MetricSet; import co.elastic.apm.agent.metrics.Timer; import com.dslplatform.json.DslJson; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/ElasticApmTracerTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/ElasticApmTracerTest.java index 5283795cf5..2b85dc0543 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/ElasticApmTracerTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/ElasticApmTracerTest.java @@ -34,7 +34,7 @@ import co.elastic.apm.agent.impl.transaction.Span; import co.elastic.apm.agent.impl.transaction.TraceContext; import co.elastic.apm.agent.impl.transaction.Transaction; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.objectpool.TestObjectPoolFactory; import co.elastic.apm.agent.report.ApmServerClient; import co.elastic.apm.agent.tracer.Outcome; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/SpanTypeBreakdownTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/SpanTypeBreakdownTest.java index a090c71566..c5bd601ae3 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/SpanTypeBreakdownTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/impl/SpanTypeBreakdownTest.java @@ -26,7 +26,7 @@ import co.elastic.apm.agent.impl.transaction.AbstractSpan; import co.elastic.apm.agent.impl.transaction.Span; import co.elastic.apm.agent.impl.transaction.Transaction; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricSet; import co.elastic.apm.agent.metrics.Timer; import org.junit.jupiter.api.AfterEach; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/MetricRegistryTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/MetricRegistryTest.java index 2b445c9e54..1b8fe9174f 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/MetricRegistryTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/MetricRegistryTest.java @@ -21,6 +21,8 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.common.util.WildcardMatcher; import co.elastic.apm.agent.report.ReporterConfiguration; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/AgentOverheadMetricsTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/AgentOverheadMetricsTest.java index 21e35ce4b5..21f37585e0 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/AgentOverheadMetricsTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/AgentOverheadMetricsTest.java @@ -21,7 +21,7 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.common.util.WildcardMatcher; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.metrics.MetricSet; import co.elastic.apm.agent.report.ReporterConfiguration; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/AgentReporterMetricsTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/AgentReporterMetricsTest.java index bc86fd0cda..c9b2cea731 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/AgentReporterMetricsTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/AgentReporterMetricsTest.java @@ -20,7 +20,7 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.common.util.WildcardMatcher; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.metrics.MetricSet; import co.elastic.apm.agent.report.ReporterConfiguration; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/CGroupMetricsTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/CGroupMetricsTest.java index f7fd1a5501..85ad8c8446 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/CGroupMetricsTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/CGroupMetricsTest.java @@ -20,7 +20,7 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.report.ReporterConfiguration; import org.junit.jupiter.api.Test; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/JvmFdMetricsTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/JvmFdMetricsTest.java index eaf982feed..707a0eb50b 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/JvmFdMetricsTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/JvmFdMetricsTest.java @@ -20,7 +20,7 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.report.ReporterConfiguration; import org.junit.jupiter.api.condition.DisabledOnOs; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/JvmMemoryMetricsTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/JvmMemoryMetricsTest.java index 7694adbebc..1e04d3bb45 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/JvmMemoryMetricsTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/JvmMemoryMetricsTest.java @@ -20,7 +20,7 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.report.ReporterConfiguration; import org.assertj.core.api.AbstractDoubleAssert; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/SystemMetricsTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/SystemMetricsTest.java index cbc1a962ac..b72eb4c289 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/SystemMetricsTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/SystemMetricsTest.java @@ -20,7 +20,7 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.report.ReporterConfiguration; import org.junit.jupiter.api.Test; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/ThreadMetricsTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/ThreadMetricsTest.java index 54976c7452..488449ecdc 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/ThreadMetricsTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/builtin/ThreadMetricsTest.java @@ -20,7 +20,7 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.report.ReporterConfiguration; import org.junit.jupiter.api.Test; diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/report/serialize/MetricSetSerializationTest.java b/apm-agent-core/src/test/java/co/elastic/apm/agent/report/serialize/MetricSetSerializationTest.java index 7f696af5f1..1399acf058 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/report/serialize/MetricSetSerializationTest.java +++ b/apm-agent-core/src/test/java/co/elastic/apm/agent/report/serialize/MetricSetSerializationTest.java @@ -20,7 +20,7 @@ import co.elastic.apm.agent.configuration.MetricsConfiguration; import co.elastic.apm.agent.tracer.service.ServiceInfo; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricCollector; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.metrics.MetricsProvider; diff --git a/apm-agent-plugins/apm-ecs-logging-plugin/pom.xml b/apm-agent-plugins/apm-ecs-logging-plugin/pom.xml index e42851bd73..708e1762cb 100644 --- a/apm-agent-plugins/apm-ecs-logging-plugin/pom.xml +++ b/apm-agent-plugins/apm-ecs-logging-plugin/pom.xml @@ -16,13 +16,6 @@ - - - ${project.groupId} - apm-agent-core - ${project.version} - - co.elastic.logging diff --git a/apm-agent-plugins/apm-jmx-plugin/pom.xml b/apm-agent-plugins/apm-jmx-plugin/pom.xml index a8a83b1333..a2949f3642 100644 --- a/apm-agent-plugins/apm-jmx-plugin/pom.xml +++ b/apm-agent-plugins/apm-jmx-plugin/pom.xml @@ -15,13 +15,4 @@ ${project.basedir}/../.. - - - - ${project.groupId} - apm-agent-core - ${project.version} - - - diff --git a/apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetric.java b/apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetric.java index 7427494bad..84bbcc5b59 100644 --- a/apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetric.java +++ b/apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetric.java @@ -18,12 +18,11 @@ */ package co.elastic.apm.agent.jmx; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import org.stagemonitor.configuration.converter.AbstractValueConverter; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import javax.management.MBeanServer; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; import java.util.ArrayList; diff --git a/apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetricTracker.java b/apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetricTracker.java index d85cbcba1c..d1c862ffb6 100644 --- a/apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetricTracker.java +++ b/apm-agent-plugins/apm-jmx-plugin/src/main/java/co/elastic/apm/agent/jmx/JmxMetricTracker.java @@ -19,14 +19,13 @@ package co.elastic.apm.agent.jmx; import co.elastic.apm.agent.tracer.AbstractLifecycleListener; -import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.DoubleSupplier; -import co.elastic.apm.agent.metrics.Labels; -import co.elastic.apm.agent.metrics.MetricRegistry; +import co.elastic.apm.agent.tracer.reporting.DoubleSupplier; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.tracer.GlobalLocks; import co.elastic.apm.agent.sdk.logging.Logger; import co.elastic.apm.agent.sdk.logging.LoggerFactory; import co.elastic.apm.agent.sdk.internal.util.PrivilegedActionUtils; +import co.elastic.apm.agent.tracer.reporting.ReportingTracer; import org.stagemonitor.configuration.ConfigurationOption; import javax.annotation.Nullable; @@ -60,14 +59,14 @@ public class JmxMetricTracker extends AbstractLifecycleListener { private volatile Thread logManagerPropertyPoller; @Nullable private volatile MBeanServer server; + private final ReportingTracer tracer; private final JmxConfiguration jmxConfiguration; - private final MetricRegistry metricRegistry; @Nullable private volatile NotificationListener listener; - public JmxMetricTracker(ElasticApmTracer tracer) { + public JmxMetricTracker(ReportingTracer tracer) { + this.tracer = tracer; jmxConfiguration = tracer.getConfig(JmxConfiguration.class); - metricRegistry = tracer.getMetricRegistry(); } @Override @@ -176,10 +175,10 @@ public void onChange(ConfigurationOption configurationOption, List List newRegistrations = compileJmxMetricRegistrations(newValue, platformMBeanServer); for (JmxMetricRegistration addedRegistration : removeAll(oldRegistrations, newRegistrations)) { - addedRegistration.register(platformMBeanServer, metricRegistry); + addedRegistration.register(platformMBeanServer, tracer); } for (JmxMetricRegistration deletedRegistration : removeAll(newRegistrations, oldRegistrations)) { - deletedRegistration.unregister(metricRegistry); + deletedRegistration.unregister(tracer); } } @@ -279,7 +278,7 @@ private static List removeAll(List removeFromThis, List toRemove) { private void register(List jmxMetrics, MBeanServer server) { for (JmxMetricRegistration registration : compileJmxMetricRegistrations(jmxMetrics, server)) { - registration.register(server, metricRegistry); + registration.register(server, tracer); } } @@ -360,9 +359,9 @@ private JmxMetricRegistration(String metricName, Labels labels, String jmxAttrib } - void register(final MBeanServer server, final MetricRegistry metricRegistry) { + void register(final MBeanServer server, final ReportingTracer tracer) { logger.debug("Registering JMX metric {} {}.{} as metric_name: {} labels: {}", objectName, jmxAttribute, compositeDataKey, metricName, labels); - metricRegistry.add(metricName, labels, new DoubleSupplier() { + tracer.addMetric(metricName, labels, new DoubleSupplier() { @Override public double get() { try { @@ -372,7 +371,7 @@ public double get() { return ((Number) ((CompositeData) server.getAttribute(objectName, jmxAttribute)).get(compositeDataKey)).doubleValue(); } } catch (InstanceNotFoundException | AttributeNotFoundException e) { - unregister(metricRegistry); + unregister(tracer); return Double.NaN; } catch (Exception e) { return Double.NaN; @@ -381,9 +380,9 @@ public double get() { }); } - void unregister(MetricRegistry metricRegistry) { + void unregister(ReportingTracer tracer) { logger.debug("Unregistering JMX metric {} {}.{} metric_name: {} labels: {}", objectName, jmxAttribute, compositeDataKey, metricName, labels); - metricRegistry.removeGauge(metricName, labels); + tracer.removeMetric(metricName, labels); } @Override diff --git a/apm-agent-plugins/apm-jmx-plugin/src/test/java/co/elastic/apm/agent/jmx/JmxMetricTrackerTest.java b/apm-agent-plugins/apm-jmx-plugin/src/test/java/co/elastic/apm/agent/jmx/JmxMetricTrackerTest.java index 17fa88bae5..cc7aebbd30 100644 --- a/apm-agent-plugins/apm-jmx-plugin/src/test/java/co/elastic/apm/agent/jmx/JmxMetricTrackerTest.java +++ b/apm-agent-plugins/apm-jmx-plugin/src/test/java/co/elastic/apm/agent/jmx/JmxMetricTrackerTest.java @@ -21,7 +21,7 @@ import co.elastic.apm.agent.MockTracer; import co.elastic.apm.agent.configuration.SpyConfiguration; import co.elastic.apm.agent.impl.ElasticApmTracer; -import co.elastic.apm.agent.metrics.Labels; +import co.elastic.apm.agent.tracer.reporting.Labels; import co.elastic.apm.agent.metrics.MetricRegistry; import co.elastic.apm.agent.report.serialize.MetricRegistrySerializer; import org.junit.jupiter.api.AfterEach; diff --git a/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/error/JulLoggerErrorCapturingInstrumentation.java b/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/error/JulLoggerErrorCapturingInstrumentation.java index 744956f7c4..7357599636 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/error/JulLoggerErrorCapturingInstrumentation.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/error/JulLoggerErrorCapturingInstrumentation.java @@ -18,7 +18,6 @@ */ package co.elastic.apm.agent.jul.error; -import co.elastic.apm.agent.impl.Tracer; import co.elastic.apm.agent.loginstr.error.AbstractLoggerErrorCapturingInstrumentation; import co.elastic.apm.agent.loginstr.error.LoggerErrorHelper; import net.bytebuddy.asm.Advice; diff --git a/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/reformatting/AbstractJulEcsReformattingHelper.java b/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/reformatting/AbstractJulEcsReformattingHelper.java index 7e0eb6fd25..a9434394ad 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/reformatting/AbstractJulEcsReformattingHelper.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/reformatting/AbstractJulEcsReformattingHelper.java @@ -21,10 +21,10 @@ import co.elastic.apm.agent.jul.sending.JulLogSenderHandler; import co.elastic.apm.agent.loginstr.correlation.CorrelationIdMapAdapter; import co.elastic.apm.agent.loginstr.reformatting.AbstractEcsReformattingHelper; -import co.elastic.apm.agent.report.Reporter; import co.elastic.apm.agent.sdk.logging.Logger; import co.elastic.apm.agent.sdk.logging.LoggerFactory; import co.elastic.apm.agent.sdk.internal.util.LoggerUtils; +import co.elastic.apm.agent.tracer.reporting.ReportingTracer; import co.elastic.logging.AdditionalField; import co.elastic.logging.jul.EcsFormatter; @@ -151,8 +151,8 @@ private static FileHandler doCreateFileHandler(String pattern, int maxLogFileSiz protected abstract boolean isFileHandler(Handler originalHandler); @Override - protected T createAndStartLogSendingAppender(Reporter reporter, Formatter formatter) { - return (T) new JulLogSenderHandler(reporter, formatter); + protected T createAndStartLogSendingAppender(ReportingTracer tracer, Formatter formatter) { + return (T) new JulLogSenderHandler(tracer, formatter); } @Override diff --git a/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/sending/JulLogSenderHandler.java b/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/sending/JulLogSenderHandler.java index 58fcf82b81..08922e9640 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/sending/JulLogSenderHandler.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-jul-plugin/src/main/java/co/elastic/apm/agent/jul/sending/JulLogSenderHandler.java @@ -18,24 +18,24 @@ */ package co.elastic.apm.agent.jul.sending; -import co.elastic.apm.agent.report.Reporter; +import co.elastic.apm.agent.tracer.reporting.ReportingTracer; import java.util.logging.Formatter; import java.util.logging.Handler; import java.util.logging.LogRecord; public class JulLogSenderHandler extends Handler { - private final Reporter reporter; + private final ReportingTracer tracer; private final Formatter formatter; - public JulLogSenderHandler(Reporter reporter, Formatter formatter) { - this.reporter = reporter; + public JulLogSenderHandler(ReportingTracer tracer, Formatter formatter) { + this.tracer = tracer; this.formatter = formatter; } @Override public void publish(LogRecord record) { - reporter.reportLog(formatter.format(record)); + tracer.reportLog(formatter.format(record)); } @Override diff --git a/apm-agent-plugins/apm-logging-plugin/apm-log4j1-plugin/src/main/java/co/elastic/apm/agent/log4j1/reformatting/Log4J1EcsReformattingHelper.java b/apm-agent-plugins/apm-logging-plugin/apm-log4j1-plugin/src/main/java/co/elastic/apm/agent/log4j1/reformatting/Log4J1EcsReformattingHelper.java index f70bbd550b..33bebb273b 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-log4j1-plugin/src/main/java/co/elastic/apm/agent/log4j1/reformatting/Log4J1EcsReformattingHelper.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-log4j1-plugin/src/main/java/co/elastic/apm/agent/log4j1/reformatting/Log4J1EcsReformattingHelper.java @@ -22,9 +22,9 @@ import co.elastic.apm.agent.loginstr.reformatting.AbstractEcsReformattingHelper; import co.elastic.apm.agent.loginstr.reformatting.Utils; -import co.elastic.apm.agent.report.Reporter; import co.elastic.apm.agent.sdk.logging.Logger; import co.elastic.apm.agent.sdk.logging.LoggerFactory; +import co.elastic.apm.agent.tracer.reporting.ReportingTracer; import co.elastic.logging.log4j.EcsLayout; import org.apache.log4j.Appender; import org.apache.log4j.FileAppender; @@ -112,8 +112,8 @@ protected void closeShadeAppender(WriterAppender shadeAppender) { } @Override - protected Appender createAndStartLogSendingAppender(Reporter reporter, Layout formatter) { - return new LogSenderAppender(reporter, formatter); + protected Appender createAndStartLogSendingAppender(ReportingTracer tracer, Layout formatter) { + return new LogSenderAppender(tracer, formatter); } @Override diff --git a/apm-agent-plugins/apm-logging-plugin/apm-log4j1-plugin/src/main/java/co/elastic/apm/agent/log4j1/sending/LogSenderAppender.java b/apm-agent-plugins/apm-logging-plugin/apm-log4j1-plugin/src/main/java/co/elastic/apm/agent/log4j1/sending/LogSenderAppender.java index ae1c66987f..f82fb4043a 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-log4j1-plugin/src/main/java/co/elastic/apm/agent/log4j1/sending/LogSenderAppender.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-log4j1-plugin/src/main/java/co/elastic/apm/agent/log4j1/sending/LogSenderAppender.java @@ -18,17 +18,17 @@ */ package co.elastic.apm.agent.log4j1.sending; -import co.elastic.apm.agent.report.Reporter; +import co.elastic.apm.agent.tracer.reporting.ReportingTracer; import org.apache.log4j.AppenderSkeleton; import org.apache.log4j.Layout; import org.apache.log4j.spi.LoggingEvent; public class LogSenderAppender extends AppenderSkeleton { - private final Reporter reporter; + private final ReportingTracer tracer; private final Layout formatter; - public LogSenderAppender(Reporter reporter, Layout formatter) { - this.reporter = reporter; + public LogSenderAppender(ReportingTracer tracer, Layout formatter) { + this.tracer = tracer; this.formatter = formatter; } @@ -39,7 +39,7 @@ public synchronized void doAppend(LoggingEvent event) { @Override protected void append(LoggingEvent event) { - reporter.reportLog(formatter.format(event)); + tracer.reportLog(formatter.format(event)); } @Override diff --git a/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/correlation/Log4j2_7PlusLogCorrelationHelper.java b/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/correlation/Log4j2_7PlusLogCorrelationHelper.java index 0551af209a..fd0b2ac813 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/correlation/Log4j2_7PlusLogCorrelationHelper.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/correlation/Log4j2_7PlusLogCorrelationHelper.java @@ -19,7 +19,6 @@ package co.elastic.apm.agent.log4j2.correlation; import co.elastic.apm.agent.tracer.GlobalTracer; -import co.elastic.apm.agent.impl.error.ErrorCapture; import co.elastic.apm.agent.loginstr.correlation.AbstractLogCorrelationHelper; import co.elastic.apm.agent.loginstr.correlation.CorrelationIdMapAdapter; import co.elastic.apm.agent.tracer.Tracer; diff --git a/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/reformatting/Log4J2EcsReformattingHelper.java b/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/reformatting/Log4J2EcsReformattingHelper.java index a9c7f519bc..c5871947b3 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/reformatting/Log4J2EcsReformattingHelper.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/reformatting/Log4J2EcsReformattingHelper.java @@ -21,9 +21,9 @@ import co.elastic.apm.agent.log4j2.sending.Log4j2LogSenderAppender; import co.elastic.apm.agent.loginstr.reformatting.AbstractEcsReformattingHelper; import co.elastic.apm.agent.loginstr.reformatting.Utils; -import co.elastic.apm.agent.report.Reporter; import co.elastic.apm.agent.sdk.logging.Logger; import co.elastic.apm.agent.sdk.logging.LoggerFactory; +import co.elastic.apm.agent.tracer.reporting.ReportingTracer; import co.elastic.logging.log4j2.EcsLayout; import org.apache.logging.log4j.core.Appender; import org.apache.logging.log4j.core.Layout; @@ -155,8 +155,8 @@ protected void closeShadeAppender(Appender shadeAppender) { } @Override - protected Appender createAndStartLogSendingAppender(Reporter reporter, Layout ecsLayout) { - Log4j2LogSenderAppender appender = new Log4j2LogSenderAppender(reporter, (StringLayout) ecsLayout); + protected Appender createAndStartLogSendingAppender(ReportingTracer tracer, Layout ecsLayout) { + Log4j2LogSenderAppender appender = new Log4j2LogSenderAppender(tracer, (StringLayout) ecsLayout); appender.start(); return appender; } diff --git a/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/sending/Log4j2LogSenderAppender.java b/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/sending/Log4j2LogSenderAppender.java index 652d30de3a..6d31e4e892 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/sending/Log4j2LogSenderAppender.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-log4j2-plugin/src/main/java/co/elastic/apm/agent/log4j2/sending/Log4j2LogSenderAppender.java @@ -18,25 +18,25 @@ */ package co.elastic.apm.agent.log4j2.sending; -import co.elastic.apm.agent.report.Reporter; +import co.elastic.apm.agent.tracer.reporting.ReportingTracer; import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.StringLayout; import org.apache.logging.log4j.core.appender.AbstractAppender; public class Log4j2LogSenderAppender extends AbstractAppender { - private final Reporter reporter; + private final ReportingTracer tracer; private final StringLayout ecsLayout; - public Log4j2LogSenderAppender(Reporter reporter, StringLayout ecsLayout) { + public Log4j2LogSenderAppender(ReportingTracer tracer, StringLayout ecsLayout) { super("ElasticApmAppender", null, ecsLayout, true, null); - this.reporter = reporter; + this.tracer = tracer; this.ecsLayout = ecsLayout; } @Override public void append(LogEvent event) { - reporter.reportLog(ecsLayout.toSerializable(event)); + tracer.reportLog(ecsLayout.toSerializable(event)); } } diff --git a/apm-agent-plugins/apm-logging-plugin/apm-logback-plugin/apm-logback-plugin-impl/src/main/java/co/elastic/apm/agent/logback/reformatting/LogbackEcsReformattingHelper.java b/apm-agent-plugins/apm-logging-plugin/apm-logback-plugin/apm-logback-plugin-impl/src/main/java/co/elastic/apm/agent/logback/reformatting/LogbackEcsReformattingHelper.java index 6ebb056352..67c1120486 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-logback-plugin/apm-logback-plugin-impl/src/main/java/co/elastic/apm/agent/logback/reformatting/LogbackEcsReformattingHelper.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-logback-plugin/apm-logback-plugin-impl/src/main/java/co/elastic/apm/agent/logback/reformatting/LogbackEcsReformattingHelper.java @@ -32,9 +32,9 @@ import co.elastic.apm.agent.loginstr.reformatting.AbstractEcsReformattingHelper; import co.elastic.apm.agent.loginstr.reformatting.Utils; import co.elastic.apm.agent.common.util.WildcardMatcher; -import co.elastic.apm.agent.report.Reporter; import co.elastic.apm.agent.sdk.logging.Logger; import co.elastic.apm.agent.sdk.logging.LoggerFactory; +import co.elastic.apm.agent.tracer.reporting.ReportingTracer; import co.elastic.logging.AdditionalField; import co.elastic.logging.logback.EcsEncoder; @@ -158,8 +158,8 @@ protected void closeShadeAppender(OutputStreamAppender shadeAppen } @Override - protected Appender createAndStartLogSendingAppender(Reporter reporter, Encoder formatter) { - LogbackLogSenderAppender appender = new LogbackLogSenderAppender(reporter, formatter); + protected Appender createAndStartLogSendingAppender(ReportingTracer tracer, Encoder formatter) { + LogbackLogSenderAppender appender = new LogbackLogSenderAppender(tracer, formatter); appender.start(); return appender; } diff --git a/apm-agent-plugins/apm-logging-plugin/apm-logback-plugin/apm-logback-plugin-impl/src/main/java/co/elastic/apm/agent/logback/sending/LogbackLogSenderAppender.java b/apm-agent-plugins/apm-logging-plugin/apm-logback-plugin/apm-logback-plugin-impl/src/main/java/co/elastic/apm/agent/logback/sending/LogbackLogSenderAppender.java index 3e2e3fea2f..e8e260be47 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-logback-plugin/apm-logback-plugin-impl/src/main/java/co/elastic/apm/agent/logback/sending/LogbackLogSenderAppender.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-logback-plugin/apm-logback-plugin-impl/src/main/java/co/elastic/apm/agent/logback/sending/LogbackLogSenderAppender.java @@ -21,15 +21,15 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.UnsynchronizedAppenderBase; import ch.qos.logback.core.encoder.Encoder; -import co.elastic.apm.agent.report.Reporter; +import co.elastic.apm.agent.tracer.reporting.ReportingTracer; import co.elastic.logging.logback.EcsEncoder; public class LogbackLogSenderAppender extends UnsynchronizedAppenderBase { - private final Reporter reporter; + private final ReportingTracer tracer; private final EcsEncoder formatter; - public LogbackLogSenderAppender(Reporter reporter, Encoder formatter) { - this.reporter = reporter; + public LogbackLogSenderAppender(ReportingTracer tracer, Encoder formatter) { + this.tracer = tracer; // Due to API compatibility (see below in 'append'), we have to use our own formatter type rather than the // base/interface class from logback. if (!(formatter instanceof EcsEncoder)) { @@ -42,6 +42,6 @@ public LogbackLogSenderAppender(Reporter reporter, Encoder format protected void append(ILoggingEvent eventObject) { // the Formatter interface was changed in logback 1.x, but our ECS implementation is compatible with both // older and newer versions of the API so we can rely on the more recent version of the API - reporter.reportLog(formatter.encode(eventObject)); + tracer.reportLog(formatter.encode(eventObject)); } } diff --git a/apm-agent-plugins/apm-logging-plugin/apm-logging-plugin-common/src/main/java/co/elastic/apm/agent/loginstr/reformatting/AbstractEcsReformattingHelper.java b/apm-agent-plugins/apm-logging-plugin/apm-logging-plugin-common/src/main/java/co/elastic/apm/agent/loginstr/reformatting/AbstractEcsReformattingHelper.java index 75af126a95..9a1ccb23b9 100644 --- a/apm-agent-plugins/apm-logging-plugin/apm-logging-plugin-common/src/main/java/co/elastic/apm/agent/loginstr/reformatting/AbstractEcsReformattingHelper.java +++ b/apm-agent-plugins/apm-logging-plugin/apm-logging-plugin-common/src/main/java/co/elastic/apm/agent/loginstr/reformatting/AbstractEcsReformattingHelper.java @@ -18,23 +18,19 @@ */ package co.elastic.apm.agent.loginstr.reformatting; -import co.elastic.apm.agent.impl.ElasticApmTracer; import co.elastic.apm.agent.tracer.GlobalTracer; -import co.elastic.apm.agent.impl.metadata.Service; -import co.elastic.apm.agent.impl.metadata.ServiceFactory; import co.elastic.apm.agent.tracer.configuration.LogEcsReformatting; import co.elastic.apm.agent.common.util.WildcardMatcher; -import co.elastic.apm.agent.report.Reporter; import co.elastic.apm.agent.sdk.logging.Logger; import co.elastic.apm.agent.sdk.logging.LoggerFactory; import co.elastic.apm.agent.sdk.state.CallDepth; import co.elastic.apm.agent.sdk.state.GlobalState; import co.elastic.apm.agent.sdk.weakconcurrent.WeakConcurrent; import co.elastic.apm.agent.sdk.weakconcurrent.WeakMap; -import co.elastic.apm.agent.tracer.Tracer; import co.elastic.apm.agent.tracer.configuration.CoreConfiguration; import co.elastic.apm.agent.tracer.configuration.LoggingConfiguration; import co.elastic.apm.agent.tracer.configuration.ServerlessConfiguration; +import co.elastic.apm.agent.tracer.reporting.ReportingTracer; import javax.annotation.Nullable; import java.util.List; @@ -152,6 +148,8 @@ public abstract class AbstractEcsReformattingHelper { */ private static final ThreadLocal configForCurrentLogEvent = new ThreadLocal<>(); + private final ReportingTracer tracer; + private final LoggingConfiguration loggingConfiguration; @Nullable @@ -168,26 +166,22 @@ public abstract class AbstractEcsReformattingHelper { @Nullable private final Map additionalFields; - private final Reporter reporter; public AbstractEcsReformattingHelper() { - Tracer tracer = GlobalTracer.get(); + tracer = GlobalTracer.get().require(ReportingTracer.class); loggingConfiguration = tracer.getConfig(LoggingConfiguration.class); additionalFields = loggingConfiguration.getLogEcsReformattingAdditionalFields(); - Service service = new ServiceFactory().createService( - tracer.getConfig(CoreConfiguration.class), - "", - tracer.getConfig(ServerlessConfiguration.class).runsOnAwsLambda() - ); - globalServiceName = service.getName(); - globalServiceVersion = service.getVersion(); - if (service.getNode() != null) { - configuredServiceNodeName = service.getNode().getName(); + CoreConfiguration config = tracer.getConfig(CoreConfiguration.class); + globalServiceName = config.getServiceName(); + globalServiceVersion = config.getServiceVersion(); + String configuredServiceNodeName = config.getServiceNodeName(); + if (configuredServiceNodeName == null) { + ServerlessConfiguration serverlessConfiguration = tracer.getConfig(ServerlessConfiguration.class); + this.configuredServiceNodeName = serverlessConfiguration.awsLambdaLogStreamName(); } else { - configuredServiceNodeName = null; + this.configuredServiceNodeName = configuredServiceNodeName; } - environment = service.getEnvironment(); - reporter = tracer.require(ElasticApmTracer.class).getReporter(); + environment = config.getEnvironment(); } /** @@ -330,7 +324,7 @@ private Object createAndMapSendingAppenderFor(final A originalAppender) { } sendingAppender = NULL_APPENDER; try { - sendingAppender = createAndStartLogSendingAppender(reporter, createEcsFormatter(originalAppender)); + sendingAppender = createAndStartLogSendingAppender(tracer, createEcsFormatter(originalAppender)); originalAppender2sendingAppender.put(originalAppender, sendingAppender); } catch (Throwable throwable) { logger.warn(String.format("Failed to create ECS shipper appender for log appender %s.%s. " + @@ -538,7 +532,7 @@ protected long getDefaultMaxLogFileSize() { protected abstract void closeShadeAppender(A shadeAppender); - protected abstract B createAndStartLogSendingAppender(Reporter reporter, F formatter); + protected abstract B createAndStartLogSendingAppender(ReportingTracer tracer, F formatter); protected abstract void append(L logEvent, B appender); } diff --git a/apm-agent-plugins/apm-logging-plugin/pom.xml b/apm-agent-plugins/apm-logging-plugin/pom.xml index 67328e4065..8ac34527bc 100644 --- a/apm-agent-plugins/apm-logging-plugin/pom.xml +++ b/apm-agent-plugins/apm-logging-plugin/pom.xml @@ -27,13 +27,4 @@ apm-jul-plugin - - - - ${project.groupId} - apm-agent-core - ${project.version} - - - diff --git a/apm-agent-plugins/apm-micrometer-plugin/src/main/java/co/elastic/apm/agent/micrometer/MicrometerMetricsReporter.java b/apm-agent-plugins/apm-micrometer-plugin/src/main/java/co/elastic/apm/agent/micrometer/MicrometerMetricsReporter.java index 3379ce66cd..a443ff3932 100644 --- a/apm-agent-plugins/apm-micrometer-plugin/src/main/java/co/elastic/apm/agent/micrometer/MicrometerMetricsReporter.java +++ b/apm-agent-plugins/apm-micrometer-plugin/src/main/java/co/elastic/apm/agent/micrometer/MicrometerMetricsReporter.java @@ -147,7 +147,7 @@ public void run() { //run split up to have this available for testing void run(final long now) { - if (tracer.getState() != Tracer.TracerState.RUNNING) { + if (!tracer.isRunning()) { return; } long metricsIntervalMs = tracer.getConfig(ReporterConfiguration.class).getMetricsIntervalMs(); diff --git a/apm-agent-plugins/apm-servlet-plugin/pom.xml b/apm-agent-plugins/apm-servlet-plugin/pom.xml index b42be23d57..5b211fd95e 100644 --- a/apm-agent-plugins/apm-servlet-plugin/pom.xml +++ b/apm-agent-plugins/apm-servlet-plugin/pom.xml @@ -16,12 +16,6 @@ - - - ${project.groupId} - apm-agent-core - ${project.version} - ${project.groupId} apm-java-concurrent-plugin diff --git a/apm-agent-plugins/apm-spring-webmvc/apm-spring-webmvc-spring5/pom.xml b/apm-agent-plugins/apm-spring-webmvc/apm-spring-webmvc-spring5/pom.xml index f7c45d6d34..c490eadda8 100644 --- a/apm-agent-plugins/apm-spring-webmvc/apm-spring-webmvc-spring5/pom.xml +++ b/apm-agent-plugins/apm-spring-webmvc/apm-spring-webmvc-spring5/pom.xml @@ -33,12 +33,6 @@ - - - ${project.groupId} - apm-agent-core - ${project.version} - javax.servlet javax.servlet-api diff --git a/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/configuration/CoreConfiguration.java b/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/configuration/CoreConfiguration.java index 3d166ca595..347bf7b3a0 100644 --- a/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/configuration/CoreConfiguration.java +++ b/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/configuration/CoreConfiguration.java @@ -21,6 +21,7 @@ import co.elastic.apm.agent.common.util.WildcardMatcher; import co.elastic.apm.agent.configuration.ActivationMethod; +import javax.annotation.Nullable; import java.util.Collection; import java.util.List; @@ -40,10 +41,13 @@ public interface CoreConfiguration { String getServiceName(); + @Nullable String getServiceVersion(); + @Nullable String getServiceNodeName(); + @Nullable String getEnvironment(); ActivationMethod getActivationMethod(); diff --git a/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/configuration/ServerlessConfiguration.java b/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/configuration/ServerlessConfiguration.java index cb3a5e3fbe..bb1ba1c347 100644 --- a/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/configuration/ServerlessConfiguration.java +++ b/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/configuration/ServerlessConfiguration.java @@ -18,6 +18,8 @@ */ package co.elastic.apm.agent.tracer.configuration; +import javax.annotation.Nullable; + public interface ServerlessConfiguration { String getAwsLambdaHandler(); @@ -25,4 +27,7 @@ public interface ServerlessConfiguration { long getDataFlushTimeout(); boolean runsOnAwsLambda(); + + @Nullable + String awsLambdaLogStreamName(); } diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/DoubleSupplier.java b/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting/DoubleSupplier.java similarity index 94% rename from apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/DoubleSupplier.java rename to apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting/DoubleSupplier.java index 120a72221d..390dfe97e2 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/DoubleSupplier.java +++ b/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting/DoubleSupplier.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package co.elastic.apm.agent.metrics; +package co.elastic.apm.agent.tracer.reporting; public interface DoubleSupplier { diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/Labels.java b/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting/Labels.java similarity index 98% rename from apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/Labels.java rename to apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting/Labels.java index c6a2e0475d..7bfcee52dc 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/metrics/Labels.java +++ b/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting/Labels.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package co.elastic.apm.agent.metrics; +package co.elastic.apm.agent.tracer.reporting; import co.elastic.apm.agent.tracer.pooling.Recyclable; @@ -31,10 +31,6 @@ * However, there are also top-level labels which are not nested under the {@code labels} object, * for example {@link #getTransactionName()}, {@link #getTransactionType()}, {@link #getSpanType()} and {@link #getSpanSubType()}. *

- * Metrics are structured into multiple {@link MetricSet}s. - * For each distinct combination of {@link Labels}, there is one {@link MetricSet}. - *

- *

* Labels allow for {@link CharSequence}s as a value, * thus avoiding allocations for {@code transaction.name.toString()} when tracking breakdown metrics for a transaction. * Iterations over the labels also don't allocate an Iterator, in contrast to {@code Map.entrySet().iterator()}. diff --git a/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting/ReportingTracer.java b/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting/ReportingTracer.java index 50c23f69ab..9c8577abd4 100644 --- a/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting/ReportingTracer.java +++ b/apm-agent-tracer/src/main/java/co/elastic/apm/agent/tracer/reporting/ReportingTracer.java @@ -20,9 +20,30 @@ import co.elastic.apm.agent.tracer.Tracer; +import java.io.Closeable; import java.util.concurrent.ScheduledExecutorService; public interface ReportingTracer extends Tracer { + void addMetric(String name, Labels labels, DoubleSupplier metric); + + void removeMetric(String name, Labels labels); + + /** + * Reports an ECS-logging formatted log message. + * + * @param log log message generated by ecs-logging + */ + void reportLog(String log); + + /** + * Reports an ECS-logging formatted log message. + * + * @param log log message generated by ecs-logging + */ + void reportLog(byte[] log); + ScheduledExecutorService getSharedSingleThreadedPool(); + + void addShutdownHook(Closeable job); } diff --git a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/LabelsTest.java b/apm-agent-tracer/src/test/java/co/elastic/apm/agent/tracer/reporting/LabelsTest.java similarity index 99% rename from apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/LabelsTest.java rename to apm-agent-tracer/src/test/java/co/elastic/apm/agent/tracer/reporting/LabelsTest.java index 21e55850c0..a27919baec 100644 --- a/apm-agent-core/src/test/java/co/elastic/apm/agent/metrics/LabelsTest.java +++ b/apm-agent-tracer/src/test/java/co/elastic/apm/agent/tracer/reporting/LabelsTest.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package co.elastic.apm.agent.metrics; +package co.elastic.apm.agent.tracer.reporting; import org.junit.jupiter.api.Test; diff --git a/integration-tests/spring-boot-1-5/pom.xml b/integration-tests/spring-boot-1-5/pom.xml index fc7bd94d42..7f5000cee3 100644 --- a/integration-tests/spring-boot-1-5/pom.xml +++ b/integration-tests/spring-boot-1-5/pom.xml @@ -28,6 +28,13 @@ apm-servlet-plugin ${project.version} + + + ${project.groupId} + apm-agent-core + ${project.version} + test + ${project.groupId} apm-agent-core