diff --git a/commercetools/commercetools-monitoring-datadog/src/main/java/com/commercetools/monitoring/datadog/DatadogMiddleware.java b/commercetools/commercetools-monitoring-datadog/src/main/java/com/commercetools/monitoring/datadog/DatadogMiddleware.java index b2a1eec3d65..d77a94d1a5f 100644 --- a/commercetools/commercetools-monitoring-datadog/src/main/java/com/commercetools/monitoring/datadog/DatadogMiddleware.java +++ b/commercetools/commercetools-monitoring-datadog/src/main/java/com/commercetools/monitoring/datadog/DatadogMiddleware.java @@ -16,6 +16,24 @@ import io.vrap.rmf.base.client.ApiHttpResponse; import io.vrap.rmf.base.client.http.TelemetryMiddleware; +/** + *
The DatadogTelemetry middleware can be used to report outgoing request to commercetools to Datadog. + * It can be registered as TelemetryMiddleware to the {@link io.vrap.rmf.base.client.ClientBuilder#withTelemetryMiddleware(TelemetryMiddleware) ClientBuilder} + * or the ApiRootBuilder.
+ * + * {@include.example example.DatadogApiRootBuilderTest#addDatadogTelemetry()} + * + * The middleware adds the following metrics to Datadog: + *The metrics are enriched with the response status code, server address, port and request method.
+ * + *See also the Spring MVC example application in the examples folder for further details.
+ */ public class DatadogMiddleware implements TelemetryMiddleware { private final MetricsApi apiInstance; diff --git a/commercetools/commercetools-monitoring-datadog/src/test/java/example/DatadogApiRootBuilderTest.java b/commercetools/commercetools-monitoring-datadog/src/test/java/example/DatadogApiRootBuilderTest.java index 951f9c5301a..758f5ea8a7a 100644 --- a/commercetools/commercetools-monitoring-datadog/src/test/java/example/DatadogApiRootBuilderTest.java +++ b/commercetools/commercetools-monitoring-datadog/src/test/java/example/DatadogApiRootBuilderTest.java @@ -12,7 +12,7 @@ public class DatadogApiRootBuilderTest { - public void addOpenTelemetry() { + public void addDatadogTelemetry() { ApiHttpClient client = ApiRootBuilder.of() .defaultClient(ServiceRegion.GCP_EUROPE_WEST1.getApiUrl()) .withTelemetryMiddleware(new DatadogMiddleware(ApiClient.getDefaultApiClient())) diff --git a/commercetools/commercetools-monitoring-opentelemetry/src/main/java/com/commercetools/monitoring/opentelemetry/OpenTelemetryMiddleware.java b/commercetools/commercetools-monitoring-opentelemetry/src/main/java/com/commercetools/monitoring/opentelemetry/OpenTelemetryMiddleware.java index fc831fb9b79..61ec108cb37 100644 --- a/commercetools/commercetools-monitoring-opentelemetry/src/main/java/com/commercetools/monitoring/opentelemetry/OpenTelemetryMiddleware.java +++ b/commercetools/commercetools-monitoring-opentelemetry/src/main/java/com/commercetools/monitoring/opentelemetry/OpenTelemetryMiddleware.java @@ -24,8 +24,16 @@ * * {@include.example example.OpenTelemetryApiRootBuilderTest#addOpenTelemetry()} * - *The middleware records a histogram about the request timing in milliseconds. The total number of responses and errors is counted. + * The middleware adds the following metrics: + * *
See also the Spring MVC example application in the examples folder for further details.
*/ public class OpenTelemetryMiddleware implements TelemetryMiddleware { private final LongHistogram histogram; diff --git a/src/main/javadoc/overview.html b/src/main/javadoc/overview.html index 7909dc23df9..73feb7831c2 100644 --- a/src/main/javadoc/overview.html +++ b/src/main/javadoc/overview.html @@ -111,6 +111,14 @@