Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the old MetricBuildItem SPI #39470

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import static io.quarkus.smallrye.metrics.deployment.SmallRyeMetricsDotNames.TIMER_INTERFACE;

import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
Expand All @@ -27,7 +26,6 @@

import jakarta.enterprise.context.Dependent;

import org.eclipse.microprofile.metrics.MetricRegistry;
import org.eclipse.microprofile.metrics.MetricType;
import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.AnnotationTarget;
Expand Down Expand Up @@ -72,11 +70,8 @@
import io.quarkus.runtime.metrics.MetricsFactory;
import io.quarkus.smallrye.metrics.deployment.jandex.JandexBeanInfoAdapter;
import io.quarkus.smallrye.metrics.deployment.jandex.JandexMemberInfoAdapter;
import io.quarkus.smallrye.metrics.deployment.spi.MetricBuildItem;
import io.quarkus.smallrye.metrics.deployment.spi.MetricsConfigurationBuildItem;
import io.quarkus.smallrye.metrics.runtime.MetadataHolder;
import io.quarkus.smallrye.metrics.runtime.SmallRyeMetricsRecorder;
import io.quarkus.smallrye.metrics.runtime.TagHolder;
import io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem;
import io.quarkus.vertx.http.deployment.RouteBuildItem;
import io.quarkus.vertx.http.deployment.devmode.NotFoundPageDisplayableEndpointBuildItem;
Expand Down Expand Up @@ -555,28 +550,8 @@ public void warnAboutMetricsFromProducers(ValidationPhaseBuildItem validationPha
@BuildStep
@Record(STATIC_INIT)
void extensionMetrics(SmallRyeMetricsRecorder recorder,
List<MetricBuildItem> additionalMetrics,
List<MetricsFactoryConsumerBuildItem> metricsFactoryConsumerBuildItems,
BuildProducer<UnremovableBeanBuildItem> unremovableBeans) {
List<MetricsFactoryConsumerBuildItem> metricsFactoryConsumerBuildItems) {
if (metrics.extensionsEnabled) {
if (!additionalMetrics.isEmpty()) {
unremovableBeans.produce(new UnremovableBeanBuildItem(
new UnremovableBeanBuildItem.BeanClassNameExclusion(MetricRegistry.class.getName())));
unremovableBeans.produce(new UnremovableBeanBuildItem(
new UnremovableBeanBuildItem.BeanClassNameExclusion(MetricRegistries.class.getName())));
}
for (MetricBuildItem additionalMetric : additionalMetrics) {
if (additionalMetric.isEnabled()) {
TagHolder[] tags = Arrays.stream(additionalMetric.getTags())
.map(TagHolder::from)
.toArray(TagHolder[]::new);
recorder.registerMetric(additionalMetric.getRegistryType(),
MetadataHolder.from(additionalMetric.getMetadata()),
tags,
additionalMetric.getImplementor());
}
}

for (MetricsFactoryConsumerBuildItem item : metricsFactoryConsumerBuildItems) {
if (item.executionTime() == STATIC_INIT) {
recorder.registerMetrics(item.getConsumer());
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading