/guicedee-metrics:guicedee-metricsfrom guicedee-metrics
Instruments Guiced applications with MicroProfile/Vert.x metrics, custom counters/timers, and Prometheus reporting via annotated methods and a scrape endpoint.
Ships in guicedee-metrics. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Production-ready application metrics using Vert.x 5 Dropwizard Metrics and the MicroProfile Metrics 5.1 API.
Annotate your methods with standard @Counted, @Timed, and custom @MetricMethod — interceptors are bound through Guice AOP, metrics are collected into a shared MetricRegistry, and a Prometheus-compatible scrape endpoint is exposed on the Vert.x Web Router automatically.
guiced.net:metrics dependency.@MetricsOptions:
@MetricsOptions(
enabled = true,
jmxEnabled = true,
baseName = "my-app",
prometheus = @MetricsOptions.PrometheusOptions(enabled = true, endpoint = "/metrics")
)
public class MyAppConfig {}
@Counted/@Timed are the MicroProfile Metrics annotations from org.eclipse.microprofile.metrics.annotation (packaged in the com.codahale.metrics JPMS module, not com.guicedee.metrics):
import org.eclipse.microprofile.metrics.annotation.Counted;
import org.eclipse.microprofile.metrics.annotation.Timed;
// absolute = true → use the name verbatim (no declaring-class prefix)
@Counted(name = "orders_placed_total", absolute = true, description = "Orders placed")
@Timed(name = "order_processing_seconds", absolute = true, description = "Order processing time")
public void placeOrder(Order order) { ... }
module-info.java. The MicroProfile annotations require com.codahale.metrics:
module my.app {
requires com.guicedee.metrics; // configurators + Prometheus /metrics endpoint
requires com.codahale.metrics; // @Counted / @Timed annotations + MetricRegistry
opens my.app.services to com.google.guice;
}
IGuiceContext.registerModuleForScanning.add("my.app");
IGuiceContext.instance().inject();
// GET /metrics returns Prometheus exposition format
@CountedIncrements a monotonic counter each invocation. Place on method or class (applies to all methods).
@TimedMeasures execution time with quantile snapshots (p50, p75, p95, p98, p99, p999).
@MetricMethodCustom Guiced annotation. Increments a named counter. If the method returns a numeric type, the counter value is returned instead.
@MetricsOptions annotation| Attribute | Purpose |
|---|---|
enabled | Enable/disable metrics |
registryName | Dropwizard registry name |
jmxEnabled | Expose as JMX MBeans |
baseName | Metric name prefix |
monitoredHttpServerUris | URI patterns to monitor |
monitoredEventBusHandlers | EventBus handler patterns |
graphite | @GraphiteOptions for Graphite reporting |
prometheus | @PrometheusOptions for Prometheus endpoint |
Every @MetricsOptions attribute can be overridden via system properties or environment variables.
IGuiceContext.instance().inject()
└─ MetricsPreStartup (MIN_VALUE + 36; scans for @MetricsOptions)
└─ MetricsVertxConfigurator.options (sets DropwizardMetricsOptions on shared VertxOptions)
└─ MetricsModule (binds MetricRegistry, interceptors, reporters)
└─ PrometheusMetricsConfigurator (registers GET /metrics handler)
Customize metrics through VertxConfigurator.options(VertxOptions) on the shared options object; keep the builder hook composable. Calling builder.with(new VertxOptions()) from a metrics configurator replaces previously prepared event-bus and pool configuration.
Prepare metrics before Hazelcast (MIN_VALUE + 37) and Vert.x (+38). A composition test should inspect the built runtime and verify metrics enabled together with the chosen event-bus bind/advertised ports and event-loop/worker pool sizes. A metrics-only test cannot detect a configuration replacement that breaks clustering.
requires com.guicedee.metrics;.@Counted/@Timed, also requires com.codahale.metrics; (that module supplies the MicroProfile annotations and the MetricRegistry).com.google.guice.IGuiceContext.get(...) / injected) — calling new MyResource() bypasses the AOP interceptors.provides needed.The shared MetricRegistry is injectable, so metrics can be asserted directly without scraping /metrics. Boot the context, resolve the Guice-managed bean (so AOP fires), invoke it, then read the registry:
@BeforeAll
static void boot() {
IGuiceContext.registerModule("my.app");
IGuiceContext.instance().getConfig()
.setClasspathScanning(true).setAnnotationScanning(true)
.setMethodInfo(true).setFieldInfo(true);
IGuiceContext.instance().inject();
}
@Test
void metricsAreRecorded() {
MyResource resource = IGuiceContext.get(MyResource.class); // managed → interceptors fire
for (int i = 0; i < 3; i++) resource.placeOrder(order);
MetricRegistry registry = IGuiceContext.get(MetricRegistry.class);
// Names carry suffixes/tags in the registry — match by substring
Counter counter = registry.getCounters().entrySet().stream()
.filter(e -> e.getKey().contains("orders_placed_total"))
.map(Map.Entry::getValue).findFirst().orElseThrow();
assertTrue(counter.getCount() >= 3);
Timer timer = registry.getTimers().entrySet().stream()
.filter(e -> e.getKey().contains("order_processing_seconds"))
.map(Map.Entry::getValue).findFirst().orElseThrow();
assertTrue(timer.getCount() >= 3);
}
Test module-info.java needs requires com.codahale.metrics; (for MetricRegistry/Counter/Timer) and access to the metered class.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub guicedee/ai-rules --plugin guicedee-metrics