Skip to main content

1. Add the dependency

<dependency>
    <groupId>io.flowwarden</groupId>
    <artifactId>flowwarden-reporter</artifactId>
    <version>1.0.0-MVP-SNAPSHOT</version>
</dependency>
The Reporter is currently published to GitHub Packages (private). See the GitHub Packages setup guide for Maven repository configuration.

2. Choose your mode

Send metrics to the FlowWarden Console dashboard.
flowwarden:
  api-key: ${FLOWWARDEN_API_KEY}

  reporter:
    console-url: https://console.flowwarden.io

3. Verify

Start your application. Depending on the mode, you should see: Console mode:
INFO  i.f.r.a.FlowWardenReporterConfigurationValidator : FlowWarden Reporter Console mode activated (https://console.flowwarden.io)
INFO  i.f.r.h.HeartbeatSender : HeartbeatSender started (interval=30s, endpoint=https://console.flowwarden.io/api/heartbeat)
Prometheus mode:
INFO  i.f.r.a.FlowWardenReporterConfigurationValidator : FlowWarden Reporter Local/Prometheus mode activated (MeterRegistry detected)
INFO  i.f.r.m.FlowWardenMicrometerReporter : FlowWardenMicrometerReporter started (pollInterval=30s)
Enable debug logging to see each heartbeat:
logging:
  level:
    io.flowwarden.reporter: DEBUG

4. Disable when not needed

To disable the Reporter without removing the dependency:
flowwarden:
  reporter:
    enabled: false
No Reporter beans are created — zero overhead.

What happens at startup

  1. Validation — checks configuration based on what’s available:
    • Console URL + no API key → fails to start with a clear error message
    • API key + no Console URL → warning (Console mode disabled)
    • No Console URL + no MeterRegistry → warning (NoOp mode)
  2. Instance identification — resolves hostname, environment, service name, and version automatically.
  3. Metrics collection — registers as the StreamMetricsProvider for Stream Core via the SPI.
  4. Output activation — starts heartbeat loop (Console) and/or registers Micrometer meters (Prometheus).

Minimal complete example

@SpringBootApplication
@EnableFlowWarden
public class OrderServiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(OrderServiceApplication.class, args);
    }
}

@ChangeStream(documentType = Order.class)
@Checkpoint
public class OrderStreamHandler {

    @OnInsert
    void onNewOrder(Order order, ChangeStreamContext<Order> ctx) {
        log.info("New order: {}", order.getId());
    }

    @OnUpdate
    void onOrderUpdated(ChangeStreamContext<Order> ctx) {
        log.info("Order updated: {}", ctx.getDocumentKey());
    }
}
# application.yml
spring:
  application:
    name: order-service
  data:
    mongodb:
      uri: mongodb://localhost:27017/orders

flowwarden:
  default-mode: IMPERATIVE
  api-key: ${FLOWWARDEN_API_KEY}

  reporter:
    console-url: https://console.flowwarden.io
    environment: production
With this setup, the Console receives heartbeats containing the status and metrics of order-stream every 30 seconds.

See Also

Configuration Reference

All available Reporter properties and their defaults.

Stream Core Quick Start

Set up FlowWarden Stream Core if you haven’t already.