Class MetricsCdiExtension
- All Implemented Interfaces:
Extension
Earlier versions of this class detected app-provided producer fields and methods and triggered creation and registration
of the corresponding metrics upon such detection. As explained in this
MP metrics issue
and this MP metrics PR,
this probably was never correct and does not work because @Metric
no longer applies to producers per the
MP metrics 3.0 spec. The issue and PR discussion explain how developers who provide their own producers should use
CDI qualifiers on the producers (and, therefore, injection points) to avoid ambiguity between their own producers and
producers written by vendors implementing MP metrics.
For Helidon, this means we no longer need to track producer fields and methods, nor do we need to augment injection points
with our own VendorProvided
qualifier to disambiguate, because we now rely on developers who write their own
producers to avoid the ambiguity using qualifiers.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.helidon.microprofile.servicecommon.HelidonRestCdiExtension
HelidonRestCdiExtension.WorkItemsManager<W>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Cleans up any data structures created during annotation processing but which are not needed once the CDI container has started.protected Config
SE Configuration of the current compoennt.void
enroll
(MetricAnnotationDiscoveryObserver metricAnnotationDiscoveryObserver) Records an observer of metric annotation discoveries.void
enroll
(MetricRegistrationObserver metricRegistrationObserver) Records an observer of metric registrations.protected void
processManagedBean
(ProcessManagedBean<?> pmb) Deals with a managed bean that survived vetoing, provided by concrete extension implementations.void
registerService
(Object event, BeanManager bm, ServerCdiExtension server) Register the Metrics observer with server observer feature.Methods inherited from class io.helidon.microprofile.servicecommon.HelidonRestCdiExtension
isConcreteNonInterceptor, isOwnProducerOrNonDefaultQualified, nestedConfigKey, observeManagedBeans, prepareRuntime, producers, recordAnnotatedType, recordProducerField, recordProducerMethod, rootConfig, routingBuilder
-
Constructor Details
-
MetricsCdiExtension
public MetricsCdiExtension()Creates a new extension instance.
-
-
Method Details
-
enroll
Records an observer of metric annotation discoveries.- Parameters:
metricAnnotationDiscoveryObserver
- the observer to enroll
-
enroll
Records an observer of metric registrations.- Parameters:
metricRegistrationObserver
- the observer to enroll
-
clearAnnotationInfo
Description copied from class:HelidonRestCdiExtension
Cleans up any data structures created during annotation processing but which are not needed once the CDI container has started.- Overrides:
clearAnnotationInfo
in classHelidonRestCdiExtension
- Parameters:
adv
- theAfterDeploymentValidation
event
-
registerService
public void registerService(@Observes @Priority(1010) @Initialized(jakarta.enterprise.context.ApplicationScoped.class) Object event, BeanManager bm, ServerCdiExtension server) Register the Metrics observer with server observer feature. This is a CDI observer method invoked by CDI machinery.- Parameters:
event
- event objectbm
- CDI bean managerserver
- Server CDI extension
-
processManagedBean
Description copied from class:HelidonRestCdiExtension
Deals with a managed bean that survived vetoing, provided by concrete extension implementations.The meaning of "process" varies among the concrete implementations. At this point, this base implementation has managed the annotation processing in a general way (e.g., only non-vetoed beans survive) and now delegates to the concrete implementations to actually respond appropriately to the bean and whichever of its members are annotated.
- Overrides:
processManagedBean
in classHelidonRestCdiExtension
- Parameters:
pmb
- the managed bean, with at least one annotation of interest to the extension
-
componentConfig
Description copied from class:HelidonRestCdiExtension
SE Configuration of the current compoennt.- Overrides:
componentConfig
in classHelidonRestCdiExtension
- Returns:
- component configuration
-