From d4c11dc64b71b5e8cb8abfaabd8a44d84efb364c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Contreras=20Guill=C3=A9n?= Date: Tue, 19 May 2026 17:48:23 +0200 Subject: [PATCH 1/9] feat(observability): add CallbackMetrics for delivery SLO tracking - firefly.callbacks.deliveries (success/failure), firefly.callbacks.delivery.duration, firefly.callbacks.retries, firefly.callbacks.circuit.opened, firefly.callbacks.errors - Tagged by target.id and attempt count - timedDelivery wrapper for the callback dispatcher --- .../core/observability/CallbackMetrics.java | 65 +++++++++++++++++++ ...allbackObservabilityAutoConfiguration.java | 42 ++++++++++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + 3 files changed, 108 insertions(+) create mode 100644 fireflyframework-callbacks-core/src/main/java/org/fireflyframework/callbacks/core/observability/CallbackMetrics.java create mode 100644 fireflyframework-callbacks-core/src/main/java/org/fireflyframework/callbacks/core/observability/CallbackObservabilityAutoConfiguration.java create mode 100644 fireflyframework-callbacks-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/fireflyframework-callbacks-core/src/main/java/org/fireflyframework/callbacks/core/observability/CallbackMetrics.java b/fireflyframework-callbacks-core/src/main/java/org/fireflyframework/callbacks/core/observability/CallbackMetrics.java new file mode 100644 index 0000000..8aa732a --- /dev/null +++ b/fireflyframework-callbacks-core/src/main/java/org/fireflyframework/callbacks/core/observability/CallbackMetrics.java @@ -0,0 +1,65 @@ +/* + * Copyright 2024-2026 Firefly Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.fireflyframework.callbacks.core.observability; + +import io.micrometer.core.instrument.MeterRegistry; +import org.fireflyframework.observability.metrics.FireflyMetricsSupport; +import reactor.core.publisher.Mono; + +/** + * Observability instrumentation for the callbacks dispatcher. + *

+ * Records: + *

+ */ +public class CallbackMetrics extends FireflyMetricsSupport { + + private static final String TAG_TARGET = "target.id"; + private static final String TAG_ATTEMPT = "attempt"; + + public CallbackMetrics(MeterRegistry meterRegistry) { + super(meterRegistry, "callbacks"); + } + + public Mono timedDelivery(String targetId, Mono delivery) { + return timed("delivery.duration", delivery, TAG_TARGET, targetId) + .doOnSuccess(v -> recordSuccess("deliveries", TAG_TARGET, targetId)) + .doOnError(e -> { + recordFailure("deliveries", e, TAG_TARGET, targetId); + recordFailure("errors", e, TAG_TARGET, targetId); + }); + } + + public void recordRetry(String targetId, int attempt) { + counter("retries", TAG_TARGET, targetId, TAG_ATTEMPT, String.valueOf(attempt)).increment(); + } + + public void recordCircuitOpened(String targetId) { + counter("circuit.opened", TAG_TARGET, targetId).increment(); + } +} diff --git a/fireflyframework-callbacks-core/src/main/java/org/fireflyframework/callbacks/core/observability/CallbackObservabilityAutoConfiguration.java b/fireflyframework-callbacks-core/src/main/java/org/fireflyframework/callbacks/core/observability/CallbackObservabilityAutoConfiguration.java new file mode 100644 index 0000000..25a64c3 --- /dev/null +++ b/fireflyframework-callbacks-core/src/main/java/org/fireflyframework/callbacks/core/observability/CallbackObservabilityAutoConfiguration.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024-2026 Firefly Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.fireflyframework.callbacks.core.observability; + +import io.micrometer.core.instrument.MeterRegistry; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; + +/** + * Auto-configures {@link CallbackMetrics}. + */ +@AutoConfiguration +@ConditionalOnClass(MeterRegistry.class) +@ConditionalOnProperty(prefix = "firefly.observability.metrics", name = "enabled", + havingValue = "true", matchIfMissing = true) +public class CallbackObservabilityAutoConfiguration { + + @Bean + @ConditionalOnMissingBean + @ConditionalOnBean(MeterRegistry.class) + CallbackMetrics callbackMetrics(MeterRegistry meterRegistry) { + return new CallbackMetrics(meterRegistry); + } +} diff --git a/fireflyframework-callbacks-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/fireflyframework-callbacks-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000..d9e1925 --- /dev/null +++ b/fireflyframework-callbacks-core/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +org.fireflyframework.callbacks.core.observability.CallbackObservabilityAutoConfiguration From d945a0e2465e184ae4c4082154e3167180e91250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Contreras=20Guill=C3=A9n?= Date: Tue, 19 May 2026 17:57:08 +0200 Subject: [PATCH 2/9] release: bump version to 26.05.01 --- fireflyframework-callbacks-core/pom.xml | 2 +- fireflyframework-callbacks-interfaces/pom.xml | 2 +- fireflyframework-callbacks-models/pom.xml | 2 +- fireflyframework-callbacks-sdk/pom.xml | 2 +- fireflyframework-callbacks-web/pom.xml | 2 +- pom.xml | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fireflyframework-callbacks-core/pom.xml b/fireflyframework-callbacks-core/pom.xml index 28ac973..ece6666 100644 --- a/fireflyframework-callbacks-core/pom.xml +++ b/fireflyframework-callbacks-core/pom.xml @@ -6,7 +6,7 @@ org.fireflyframework fireflyframework-callbacks - 26.04.01 + 26.05.01 fireflyframework-callbacks-core diff --git a/fireflyframework-callbacks-interfaces/pom.xml b/fireflyframework-callbacks-interfaces/pom.xml index 9cd70d6..a1fc3a7 100644 --- a/fireflyframework-callbacks-interfaces/pom.xml +++ b/fireflyframework-callbacks-interfaces/pom.xml @@ -6,7 +6,7 @@ org.fireflyframework fireflyframework-callbacks - 26.04.01 + 26.05.01 fireflyframework-callbacks-interfaces diff --git a/fireflyframework-callbacks-models/pom.xml b/fireflyframework-callbacks-models/pom.xml index 3bedd6e..e8336e5 100644 --- a/fireflyframework-callbacks-models/pom.xml +++ b/fireflyframework-callbacks-models/pom.xml @@ -6,7 +6,7 @@ org.fireflyframework fireflyframework-callbacks - 26.04.01 + 26.05.01 fireflyframework-callbacks-models diff --git a/fireflyframework-callbacks-sdk/pom.xml b/fireflyframework-callbacks-sdk/pom.xml index a581d58..3ae332e 100644 --- a/fireflyframework-callbacks-sdk/pom.xml +++ b/fireflyframework-callbacks-sdk/pom.xml @@ -6,7 +6,7 @@ org.fireflyframework fireflyframework-callbacks - 26.04.01 + 26.05.01 fireflyframework-callbacks-sdk diff --git a/fireflyframework-callbacks-web/pom.xml b/fireflyframework-callbacks-web/pom.xml index eb0741a..00963bb 100644 --- a/fireflyframework-callbacks-web/pom.xml +++ b/fireflyframework-callbacks-web/pom.xml @@ -6,7 +6,7 @@ org.fireflyframework fireflyframework-callbacks - 26.04.01 + 26.05.01 fireflyframework-callbacks-web diff --git a/pom.xml b/pom.xml index 5ddc9af..6914e67 100644 --- a/pom.xml +++ b/pom.xml @@ -7,13 +7,13 @@ org.fireflyframework fireflyframework-parent - 26.04.01 + 26.05.01 org.fireflyframework fireflyframework-callbacks - 26.04.01 + 26.05.01 pom Firefly Framework - Callbacks Library From c98d3fdf04fc259d6bc6cda0bc16f9c9c4e6aae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Contreras=20Guill=C3=A9n?= Date: Tue, 19 May 2026 18:17:46 +0200 Subject: [PATCH 3/9] release: bump version to 26.05.06 --- fireflyframework-callbacks-core/pom.xml | 2 +- fireflyframework-callbacks-interfaces/pom.xml | 2 +- fireflyframework-callbacks-models/pom.xml | 2 +- fireflyframework-callbacks-sdk/pom.xml | 2 +- fireflyframework-callbacks-web/pom.xml | 2 +- pom.xml | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fireflyframework-callbacks-core/pom.xml b/fireflyframework-callbacks-core/pom.xml index ece6666..320a6b2 100644 --- a/fireflyframework-callbacks-core/pom.xml +++ b/fireflyframework-callbacks-core/pom.xml @@ -6,7 +6,7 @@ org.fireflyframework fireflyframework-callbacks - 26.05.01 + 26.05.06 fireflyframework-callbacks-core diff --git a/fireflyframework-callbacks-interfaces/pom.xml b/fireflyframework-callbacks-interfaces/pom.xml index a1fc3a7..c7c3796 100644 --- a/fireflyframework-callbacks-interfaces/pom.xml +++ b/fireflyframework-callbacks-interfaces/pom.xml @@ -6,7 +6,7 @@ org.fireflyframework fireflyframework-callbacks - 26.05.01 + 26.05.06 fireflyframework-callbacks-interfaces diff --git a/fireflyframework-callbacks-models/pom.xml b/fireflyframework-callbacks-models/pom.xml index e8336e5..0a38851 100644 --- a/fireflyframework-callbacks-models/pom.xml +++ b/fireflyframework-callbacks-models/pom.xml @@ -6,7 +6,7 @@ org.fireflyframework fireflyframework-callbacks - 26.05.01 + 26.05.06 fireflyframework-callbacks-models diff --git a/fireflyframework-callbacks-sdk/pom.xml b/fireflyframework-callbacks-sdk/pom.xml index 3ae332e..c1d8ce6 100644 --- a/fireflyframework-callbacks-sdk/pom.xml +++ b/fireflyframework-callbacks-sdk/pom.xml @@ -6,7 +6,7 @@ org.fireflyframework fireflyframework-callbacks - 26.05.01 + 26.05.06 fireflyframework-callbacks-sdk diff --git a/fireflyframework-callbacks-web/pom.xml b/fireflyframework-callbacks-web/pom.xml index 00963bb..bfa77e4 100644 --- a/fireflyframework-callbacks-web/pom.xml +++ b/fireflyframework-callbacks-web/pom.xml @@ -6,7 +6,7 @@ org.fireflyframework fireflyframework-callbacks - 26.05.01 + 26.05.06 fireflyframework-callbacks-web diff --git a/pom.xml b/pom.xml index 6914e67..29c34e3 100644 --- a/pom.xml +++ b/pom.xml @@ -7,13 +7,13 @@ org.fireflyframework fireflyframework-parent - 26.05.01 + 26.05.06 org.fireflyframework fireflyframework-callbacks - 26.05.01 + 26.05.06 pom Firefly Framework - Callbacks Library From a540ac15156e3cf91e461e41385691944bca7934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Contreras=20Guill=C3=A9n?= Date: Tue, 19 May 2026 19:00:05 +0200 Subject: [PATCH 4/9] ci: re-trigger after layer 2 publish From a5796c13c283fb3444c89e6dd3a8c7f3b8d66415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Contreras=20Guill=C3=A9n?= Date: Tue, 19 May 2026 19:29:51 +0200 Subject: [PATCH 5/9] ci: re-trigger after layer 4 deps published From da8d55bc7f75ed86ff42baa02b90245fa96f0e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Contreras=20Guill=C3=A9n?= Date: Tue, 19 May 2026 19:36:05 +0200 Subject: [PATCH 6/9] ci: re-trigger after starter-core publish From 291ab170a8fa80c201553901498103f578b6a31b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Contreras=20Guill=C3=A9n?= Date: Tue, 19 May 2026 19:36:12 +0200 Subject: [PATCH 7/9] ci: re-trigger after starter-core publish From 22a50dc1a04621b10a6b19656e7719302f5608d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Contreras=20Guill=C3=A9n?= Date: Tue, 19 May 2026 19:46:59 +0200 Subject: [PATCH 8/9] test: disable strict health-group validation in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Workaround for observability 26.05.06 readiness group that includes 'db' contributor — callbacks-web tests don't have JDBC autoconfig so the group validator crashes startup. Proper fix lands in observability 26.05.07 via management.endpoint.health.validate-group-membership=false default. --- .../src/test/resources/application-test.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fireflyframework-callbacks-web/src/test/resources/application-test.yml b/fireflyframework-callbacks-web/src/test/resources/application-test.yml index 4c1f356..aa6b0c9 100644 --- a/fireflyframework-callbacks-web/src/test/resources/application-test.yml +++ b/fireflyframework-callbacks-web/src/test/resources/application-test.yml @@ -68,3 +68,13 @@ logging: org.fireflyframework.common.eda: DEBUG org.springframework.data.r2dbc: DEBUG org.testcontainers: INFO + +# Same observability test workaround as webhooks (see CacheObservabilityAutoConfiguration fix in 26.05.07). +management: + endpoint: + health: + validate-group-membership: false +firefly: + observability: + health: + enabled: false From 735018f2ed8c25aa115632da4c2c37db6f83cba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Contreras=20Guill=C3=A9n?= Date: Tue, 19 May 2026 19:52:19 +0200 Subject: [PATCH 9/9] test: merge observability disable into existing firefly: block (YAML) --- .../src/test/resources/application-test.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fireflyframework-callbacks-web/src/test/resources/application-test.yml b/fireflyframework-callbacks-web/src/test/resources/application-test.yml index aa6b0c9..186e1d4 100644 --- a/fireflyframework-callbacks-web/src/test/resources/application-test.yml +++ b/fireflyframework-callbacks-web/src/test/resources/application-test.yml @@ -29,6 +29,9 @@ spring: # Firefly Callbacks Configuration firefly: + observability: + health: + enabled: false callbacks: # listener configuration removed - now using dynamic listeners from database @@ -69,12 +72,8 @@ logging: org.springframework.data.r2dbc: DEBUG org.testcontainers: INFO -# Same observability test workaround as webhooks (see CacheObservabilityAutoConfiguration fix in 26.05.07). +# Required so apps without a db autoconfig don't crash on the readiness health-group default. management: endpoint: health: validate-group-membership: false -firefly: - observability: - health: - enabled: false