Skip to content

Visualize OpenTelemetry http.server.request.duration

0

I have an application which uses OpenTelemetry SDK to export metrics to an OpenTelemetry Collector using OTLP. From the collector, metrics are exported using AWS EMF exporter to CloudWatch.

I would like to visualize the http.server.request.duration metric (https://opentelemetry.io/docs/specs/semconv/http/http-metrics/#metric-httpserverrequestduration) on CloudWatch. However, I noticed that OpenTelemetry histogram is not compatible with CloudWatch. As a result, I only saw the following values from the log group.

"http.server.request.duration": {
    "Max": 0.016615747,
    "Min": 0.016615747,
    "Count": 1,
    "Sum": 0.016615747
}

From these values, how do I create a graph that shows how many http requests per minute?

asked a year ago292 views

1 Answer
0

You are correct that OpenTelemetry histograms aren't fully compatible with CloudWatch's native metrics' datatype. However, the Count statistic still gives you valuable information about request frequency, which seems to what you're looking for in this case.

To create a graph showing the number of HTTP requests per minute using the data you have from OpenTelemetry metrics in CloudWatch, you should focus on the "Count" value in your metrics.

Here's how to create this visualization:

  1. In the CloudWatch console, search for your metric. It should be in the namespace where your EMF logs are being extracted (by default, this would be the "CWAgent" namespace if you're using the standard configuration).

  2. Select the "http.server.request.duration" metric.

  3. For the statistic, choose "SampleCount" or "Count" (depending on what CloudWatch exposes for your metric). This represents the number of data points received during each period, which corresponds to the number of HTTP requests.

  4. Set the period to 1 minute to see requests per minute.

  5. Choose the appropriate graph type - a line graph would work well for showing request rates over time.

The "Count" value in your EMF logs represents the number of requests that occurred during the reporting period. By graphing this value with a 1-minute period, you'll be able to visualize how many HTTP requests are occurring per minute.

Sources
Graph a metric - Amazon CloudWatch
Collect metrics and traces with OpenTelemetry - Amazon CloudWatch
Community | Instrumenting Java Applications with OpenTelemetry

answered a year ago

AWS
SUPPORT ENGINEER

revised a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.