Skip to content
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ With Spring Boot Actuator and a Prometheus registry (`micrometer-registry-promet
| `okapi.entries.count` | Gauge | Current entry count (tag: `status=pending\|delivered\|failed`) |
| `okapi.entries.lag.seconds` | Gauge | Age of oldest entry in seconds (tag: `status`) |

### Configuration

| Property | Default | Description |
|----------|---------|-------------|
| `okapi.metrics.refresh-interval` | `PT15S` (15s) | How often gauge metrics poll the outbox store. Each refresh runs one transaction with two queries. |

### Multi-instance deployments

Counters and timers (`okapi.entries.delivered`, `okapi.entries.retry.scheduled`, `okapi.entries.failed`, `okapi.batch.duration`) report work performed by **each instance** — aggregate with `sum`:
Expand Down
1 change: 1 addition & 0 deletions okapi-micrometer/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("buildsrc.convention.kotlin-jvm")
id("buildsrc.convention.publish")
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ package com.softwaremill.okapi.springboot
import org.springframework.boot.context.properties.ConfigurationProperties
import java.time.Duration

/**
* Configuration for Okapi Micrometer metrics.
*
* @property refreshInterval How often gauge metrics (`okapi.entries.count`, `okapi.entries.lag.seconds`)
* are refreshed from the outbox store. Each refresh runs one transaction with two queries.
* Set under property `okapi.metrics.refresh-interval`, e.g. `PT15S`, `30s`, `1m`. Default: 15 seconds.
*/
@ConfigurationProperties(prefix = "okapi.metrics")
data class OkapiMetricsProperties(
val refreshInterval: Duration = Duration.ofSeconds(15),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"name": "okapi.processor",
"type": "com.softwaremill.okapi.springboot.OutboxProcessorProperties",
"description": "Outbox processor configuration."
},
{
"name": "okapi.metrics",
"type": "com.softwaremill.okapi.springboot.OkapiMetricsProperties",
"description": "Okapi Micrometer metrics configuration (okapi-micrometer module)."
}
],
"properties": [
Expand Down Expand Up @@ -70,6 +75,12 @@
"type": "java.lang.String",
"defaultValue": null,
"description": "Name of the DataSource bean to use for the outbox. When set, okapi uses this specific DataSource instead of the primary one. Required in multi-datasource setups where the outbox table is not in the primary database."
},
{
"name": "okapi.metrics.refresh-interval",
"type": "java.time.Duration",
"defaultValue": "15s",
"description": "How often gauge metrics (okapi.entries.count, okapi.entries.lag.seconds) are refreshed from the outbox store. Each refresh runs one transaction with two queries. Requires okapi-micrometer on the classpath."
}
]
}