From 6b1805406b6fd3446cc7be6ed0ab066b932ed9bd 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:00 +0200 Subject: [PATCH 1/4] feat(observability): add EcmMetrics for document storage and e-signature adapters - Records firefly.ecm.documents.operations, firefly.ecm.operation.duration, firefly.ecm.bytes.transferred, firefly.ecm.signatures.completed, firefly.ecm.errors - Auto-configured for all ECM adapters (S3, Azure Blob, DocuSign, Adobe Sign, Logalty) - Bean gated on MeterRegistry + firefly.observability.metrics.enabled --- .../ecm/observability/EcmMetrics.java | 72 +++++++++++++++++++ .../EcmObservabilityAutoConfiguration.java | 43 +++++++++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + 3 files changed, 116 insertions(+) create mode 100644 src/main/java/org/fireflyframework/ecm/observability/EcmMetrics.java create mode 100644 src/main/java/org/fireflyframework/ecm/observability/EcmObservabilityAutoConfiguration.java diff --git a/src/main/java/org/fireflyframework/ecm/observability/EcmMetrics.java b/src/main/java/org/fireflyframework/ecm/observability/EcmMetrics.java new file mode 100644 index 0000000..63531a9 --- /dev/null +++ b/src/main/java/org/fireflyframework/ecm/observability/EcmMetrics.java @@ -0,0 +1,72 @@ +/* + * 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.ecm.observability; + +import io.micrometer.core.instrument.MeterRegistry; +import org.fireflyframework.observability.metrics.FireflyMetricsSupport; +import reactor.core.publisher.Mono; + +/** + * Shared observability instrumentation for the ECM module and all its adapters + * (storage: S3/Azure Blob/local; e-signature: DocuSign/Adobe Sign/Logalty). + *

+ * Records: + *

+ */ +public class EcmMetrics extends FireflyMetricsSupport { + + private static final String TAG_OPERATION = "operation"; + private static final String TAG_PROVIDER = "provider"; + private static final String TAG_DIRECTION = "direction"; + + public EcmMetrics(MeterRegistry meterRegistry) { + super(meterRegistry, "ecm"); + } + + /** + * Wraps a document-storage or e-signature operation with a timer and success/failure counters. + */ + public Mono timedOperation(String operation, String provider, Mono op) { + return timed("operation.duration", op, TAG_OPERATION, operation, TAG_PROVIDER, provider) + .doOnSuccess(v -> recordSuccess("documents.operations", + TAG_OPERATION, operation, TAG_PROVIDER, provider)) + .doOnError(e -> { + recordFailure("documents.operations", e, + TAG_OPERATION, operation, TAG_PROVIDER, provider); + recordFailure("errors", e, + TAG_OPERATION, operation, TAG_PROVIDER, provider); + }); + } + + public void recordBytesTransferred(String direction, String provider, long bytes) { + distributionSummary("bytes.transferred", TAG_DIRECTION, direction, TAG_PROVIDER, provider) + .record(bytes); + } + + public void recordSignatureCompleted(String provider) { + counter("signatures.completed", TAG_PROVIDER, provider).increment(); + } +} diff --git a/src/main/java/org/fireflyframework/ecm/observability/EcmObservabilityAutoConfiguration.java b/src/main/java/org/fireflyframework/ecm/observability/EcmObservabilityAutoConfiguration.java new file mode 100644 index 0000000..aa5044a --- /dev/null +++ b/src/main/java/org/fireflyframework/ecm/observability/EcmObservabilityAutoConfiguration.java @@ -0,0 +1,43 @@ +/* + * 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.ecm.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 EcmMetrics} for all ECM adapter implementations + * (storage and e-signature providers). + */ +@AutoConfiguration +@ConditionalOnClass(MeterRegistry.class) +@ConditionalOnProperty(prefix = "firefly.observability.metrics", name = "enabled", + havingValue = "true", matchIfMissing = true) +public class EcmObservabilityAutoConfiguration { + + @Bean + @ConditionalOnMissingBean + @ConditionalOnBean(MeterRegistry.class) + EcmMetrics ecmMetrics(MeterRegistry meterRegistry) { + return new EcmMetrics(meterRegistry); + } +} diff --git a/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 3014da2..121fe14 100644 --- a/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1,2 @@ org.fireflyframework.ecm.config.EcmAutoConfiguration +org.fireflyframework.ecm.observability.EcmObservabilityAutoConfiguration From 5546bd855042f3231a1c74ab1243ad676b9ff1bc 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:07 +0200 Subject: [PATCH 2/4] release: bump version to 26.05.01 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f38afb1..1f751c1 100644 --- a/pom.xml +++ b/pom.xml @@ -7,12 +7,12 @@ org.fireflyframework fireflyframework-parent - 26.04.01 + 26.05.01 fireflyframework-ecm - 26.04.01 + 26.05.01 jar Firefly Framework - Enterprise Content Management Library From f09f8d6c5547127c64b6a50ad62dbf2b0456bb41 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:45 +0200 Subject: [PATCH 3/4] release: bump version to 26.05.06 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1f751c1..89a266e 100644 --- a/pom.xml +++ b/pom.xml @@ -7,12 +7,12 @@ org.fireflyframework fireflyframework-parent - 26.05.01 + 26.05.06 fireflyframework-ecm - 26.05.01 + 26.05.06 jar Firefly Framework - Enterprise Content Management Library From aba0572de7da6261af3562e0d5c8be5290225ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Contreras=20Guill=C3=A9n?= Date: Tue, 19 May 2026 18:59:47 +0200 Subject: [PATCH 4/4] ci: re-trigger after layer 2 publish