0
# Framework Integration Binders
1
2
Automatic instrumentation processors that integrate metrics collection with various Quarkus frameworks and technologies. Each binder processor provides conditional activation and seamless metrics integration for specific technology stacks.
3
4
## Capabilities
5
6
### HTTP Binder Processor
7
8
Enables HTTP metrics for both client and server operations across various HTTP frameworks.
9
10
```java { .api }
11
/**
12
* Deployment processor for HTTP metrics integration
13
*/
14
public class HttpBinderProcessor {
15
16
/**
17
* Creates HTTP binder configuration
18
* @return UnremovableBeanBuildItem for HTTP metrics configuration
19
*/
20
@BuildStep(onlyIf = HttpServerBinderEnabled.class)
21
public UnremovableBeanBuildItem enableHttpBinders();
22
23
/**
24
* Enables HTTP server metrics support
25
* @return AdditionalBeanBuildItem for server metrics
26
*/
27
@BuildStep(onlyIf = HttpServerBinderEnabled.class)
28
public AdditionalBeanBuildItem enableHttpServerSupport();
29
30
/**
31
* Registers HTTP client metrics provider
32
* @return UnremovableBeanBuildItem for client metrics
33
*/
34
@BuildStep(onlyIf = HttpClientBinderEnabled.class)
35
public UnremovableBeanBuildItem registerProvider();
36
37
// Enablement conditions
38
public static class HttpServerBinderEnabled implements BooleanSupplier;
39
public static class HttpClientBinderEnabled implements BooleanSupplier;
40
}
41
```
42
43
### Vert.x Binder Processor
44
45
Enables Vert.x instrumentation for metrics collection in reactive applications.
46
47
```java { .api }
48
/**
49
* Deployment processor for Vert.x metrics integration
50
*/
51
@BuildSteps
52
public class VertxBinderProcessor {
53
54
/**
55
* Preserves HTTP server metrics beans for Vert.x
56
* @return UnremovableBeanBuildItem for server metrics preservation
57
*/
58
@BuildStep(onlyIf = VertxBinderEnabled.class)
59
public UnremovableBeanBuildItem unremoveableAdditionalHttpServerMetrics();
60
61
/**
62
* Preserves HTTP client metrics beans for Vert.x
63
* @return UnremovableBeanBuildItem for client metrics preservation
64
*/
65
@BuildStep(onlyIf = VertxBinderEnabled.class)
66
public UnremovableBeanBuildItem unremoveableAdditionalHttpClientMetrics();
67
68
/**
69
* Configures Vert.x options for metrics
70
* @return AdditionalBeanBuildItem for Vert.x configuration
71
*/
72
@BuildStep(onlyIf = VertxBinderEnabled.class)
73
public AdditionalBeanBuildItem build();
74
75
/**
76
* Sets Vert.x runtime configuration
77
* @return RuntimeConfigSetterBuildItem for Vert.x config
78
*/
79
@BuildStep(onlyIf = VertxBinderEnabled.class)
80
@Record(ExecutionTime.RUNTIME_INIT)
81
public RuntimeConfigSetterBuildItem setVertxConfig();
82
83
// Enablement condition
84
public static class VertxBinderEnabled implements BooleanSupplier;
85
}
86
```
87
88
### gRPC Binder Processor
89
90
Enables gRPC client and server metrics through interceptors.
91
92
```java { .api }
93
/**
94
* Deployment processor for gRPC metrics integration
95
*/
96
public class GrpcBinderProcessor {
97
98
/**
99
* Adds gRPC client metrics interceptor
100
* @return UnremovableBeanBuildItem for client interceptor
101
*/
102
@BuildStep(onlyIf = GrpcClientSupportEnabled.class)
103
public UnremovableBeanBuildItem addGrpcClientMetricInterceptor();
104
105
/**
106
* Adds gRPC server metrics interceptor
107
* @return UnremovableBeanBuildItem for server interceptor
108
*/
109
@BuildStep(onlyIf = GrpcServerSupportEnabled.class)
110
public UnremovableBeanBuildItem addGrpcServerMetricInterceptor();
111
112
// Enablement conditions
113
public static class GrpcClientSupportEnabled implements BooleanSupplier;
114
public static class GrpcServerSupportEnabled implements BooleanSupplier;
115
}
116
```
117
118
### Kafka Binder Processor
119
120
Enables Kafka metrics for producer, consumer, and streams applications.
121
122
```java { .api }
123
/**
124
* Deployment processor for Kafka metrics integration
125
*/
126
public class KafkaBinderProcessor {
127
128
/**
129
* Creates CDI event consumer for Kafka metrics
130
* @return SyntheticBeanBuildItem for Kafka event handling
131
*/
132
@BuildStep(onlyIf = KafkaSupportEnabled.class)
133
@Record(ExecutionTime.RUNTIME_INIT)
134
public SyntheticBeanBuildItem createCDIEventConsumer();
135
136
/**
137
* Creates Kafka Streams event observer
138
* @return SyntheticBeanBuildItem for Streams observation
139
*/
140
@BuildStep(onlyIf = KafkaStreamsSupportEnabled.class)
141
@Record(ExecutionTime.RUNTIME_INIT)
142
public SyntheticBeanBuildItem createKafkaStreamsEventObserver();
143
144
// Enablement conditions
145
public static class KafkaSupportEnabled implements BooleanSupplier;
146
public static class KafkaStreamsSupportEnabled implements BooleanSupplier;
147
}
148
```
149
150
### Reactive Messaging Processor
151
152
Enables SmallRye Reactive Messaging metrics integration.
153
154
```java { .api }
155
/**
156
* Deployment processor for Reactive Messaging metrics
157
*/
158
public class ReactiveMessagingProcessor {
159
160
/**
161
* Creates CDI event consumer for reactive messaging
162
* @return SyntheticBeanBuildItem for message observation
163
*/
164
@BuildStep(onlyIf = ReactiveMessagingSupportEnabled.class)
165
@Record(ExecutionTime.RUNTIME_INIT)
166
public SyntheticBeanBuildItem createCDIEventConsumer();
167
168
// Enablement condition
169
public static class ReactiveMessagingSupportEnabled implements BooleanSupplier;
170
}
171
```
172
173
### Netty Binder Processor
174
175
Enables Netty allocator and event executor metrics for memory and thread pool monitoring.
176
177
```java { .api }
178
/**
179
* Deployment processor for Netty metrics integration
180
*/
181
public class NettyBinderProcessor {
182
183
/**
184
* Creates Netty allocator metrics
185
* @return SyntheticBeanBuildItem for Netty allocator monitoring
186
*/
187
@BuildStep(onlyIf = NettySupportEnabled.class)
188
@Record(ExecutionTime.RUNTIME_INIT)
189
public SyntheticBeanBuildItem createNettyNettyAllocatorMetrics();
190
191
/**
192
* Creates Vert.x allocator metrics
193
* @return SyntheticBeanBuildItem for Vert.x allocator monitoring
194
*/
195
@BuildStep(onlyIf = VertxAllocatorSupportEnabled.class)
196
@Record(ExecutionTime.RUNTIME_INIT)
197
public SyntheticBeanBuildItem createVertxNettyAllocatorMetrics();
198
199
/**
200
* Creates Vert.x event executor metrics
201
* @return SyntheticBeanBuildItem for event executor monitoring
202
*/
203
@BuildStep(onlyIf = VertxEventExecutorSupportEnabled.class)
204
@Record(ExecutionTime.RUNTIME_INIT)
205
public SyntheticBeanBuildItem createVertxNettyEventExecutorMetrics();
206
207
/**
208
* Creates reactive Netty allocator metrics
209
* @return SyntheticBeanBuildItem for reactive allocator monitoring
210
*/
211
@BuildStep(onlyIf = ReactiveSupportEnabled.class)
212
@Record(ExecutionTime.RUNTIME_INIT)
213
public SyntheticBeanBuildItem createReactiveNettyAllocatorMetrics();
214
215
// Base enablement condition
216
public abstract static class AbstractSupportEnabled implements BooleanSupplier;
217
218
// Specific enablement conditions
219
public static class NettySupportEnabled extends AbstractSupportEnabled;
220
public static class VertxAllocatorSupportEnabled extends AbstractSupportEnabled;
221
public static class VertxEventExecutorSupportEnabled extends AbstractSupportEnabled;
222
public static class ReactiveSupportEnabled extends AbstractSupportEnabled;
223
}
224
```
225
226
### Redis Binder Processor
227
228
Enables Redis client metrics for cache and data store operations.
229
230
```java { .api }
231
/**
232
* Deployment processor for Redis metrics integration
233
*/
234
public class RedisBinderProcessor {
235
236
/**
237
* Adds Redis client metrics
238
* @return SyntheticBeanBuildItem for Redis client monitoring
239
*/
240
@BuildStep(onlyIf = RedisMetricsSupportEnabled.class)
241
@Record(ExecutionTime.RUNTIME_INIT)
242
public SyntheticBeanBuildItem addRedisClientMetric();
243
244
// Enablement condition
245
public static class RedisMetricsSupportEnabled implements BooleanSupplier;
246
}
247
```
248
249
### Stork Binder Processor
250
251
Enables Stork service discovery metrics for load balancing and service resolution.
252
253
```java { .api }
254
/**
255
* Deployment processor for Stork service discovery metrics
256
*/
257
public class StorkBinderProcessor {
258
259
/**
260
* Adds Stork observation collector
261
* @return SyntheticBeanBuildItem for service discovery monitoring
262
*/
263
@BuildStep(onlyIf = StorkMetricsSupportEnabled.class)
264
@Record(ExecutionTime.RUNTIME_INIT)
265
public SyntheticBeanBuildItem addStorkObservationCollector();
266
267
// Enablement condition
268
public static class StorkMetricsSupportEnabled implements BooleanSupplier;
269
}
270
```
271
272
### WebSockets Binder Processor
273
274
Enables WebSockets Next instrumentation for real-time communication metrics.
275
276
```java { .api }
277
/**
278
* Deployment processor for WebSockets metrics integration
279
*/
280
@BuildSteps
281
public class WebSocketsBinderProcessor {
282
283
/**
284
* Registers WebSocket metrics interceptor
285
* @return UnremovableBeanBuildItem for WebSocket monitoring
286
*/
287
@BuildStep
288
public UnremovableBeanBuildItem registerWebSocketMetricsInterceptor();
289
}
290
```
291
292
### Virtual Thread Binder Processor
293
294
Enables virtual thread metrics for Java 21+ applications (Project Loom).
295
296
```java { .api }
297
/**
298
* Deployment processor for virtual thread metrics (Java 21+)
299
*/
300
public class VirtualThreadBinderProcessor {
301
302
/**
303
* Creates CDI event consumer for virtual thread metrics
304
* @return SyntheticBeanBuildItem for virtual thread monitoring
305
*/
306
@BuildStep(onlyIf = VirtualThreadSupportEnabled.class)
307
@Record(ExecutionTime.RUNTIME_INIT)
308
public SyntheticBeanBuildItem createCDIEventConsumer();
309
310
/**
311
* Adds native monitoring for JFR integration
312
* @return NativeImageConfigBuildItem for native monitoring
313
*/
314
@BuildStep(onlyIf = VirtualThreadSupportEnabled.class)
315
public NativeImageConfigBuildItem addNativeMonitoring();
316
317
// Enablement condition
318
public static class VirtualThreadSupportEnabled implements BooleanSupplier;
319
}
320
```
321
322
**Usage Examples:**
323
324
```java
325
// Custom framework integration following the binder pattern
326
@BuildSteps
327
public class CustomFrameworkBinderProcessor {
328
329
@BuildStep(onlyIf = CustomFrameworkEnabled.class)
330
UnremovableBeanBuildItem enableCustomFrameworkMetrics() {
331
return UnremovableBeanBuildItem.beanTypes(
332
DotName.createSimple("com.example.CustomFrameworkMetrics")
333
);
334
}
335
336
public static class CustomFrameworkEnabled implements BooleanSupplier {
337
@Override
338
public boolean getAsBoolean() {
339
return ConfigProvider.getConfig()
340
.getOptionalValue("quarkus.micrometer.binder.custom-framework.enabled", Boolean.class)
341
.orElse(false);
342
}
343
}
344
}
345
346
// Conditional metrics activation
347
@BuildStep(onlyIf = HttpBinderProcessor.HttpServerBinderEnabled.class)
348
AdditionalBeanBuildItem addHttpServerMetrics() {
349
return AdditionalBeanBuildItem.builder()
350
.addBeanClass(HttpServerMetricsHandler.class)
351
.setUnremovable()
352
.build();
353
}
354
```