# Visualize OTEL http.server.request.duration metric

**URL:** <https://discuss.elastic.co/t/visualize-otel-http-server-request-duration-metric/382841>\
**Category:** Elastic Observability\
**Tags:** infrastructure-observability\
**Created:** [October 20, 2025, 3:08pm UTC](https://discuss.elastic.co/t/visualize-otel-http-server-request-duration-metric/382841 "2025-10-20T15:08:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.michael](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@david.michael](https://discuss.elastic.co/u/david.michael)\
**Post date:** [October 20, 2025, 3:08pm UTC](https://discuss.elastic.co/t/visualize-otel-http-server-request-duration-metric/382841/1 "2025-10-20T15:08:14Z")

</div>

I’m currently using the elastic-otel-java agent to instrument Java based applications and have enabled the `OTEL_INSTRUMENTATION_HTTP_SERVER_EMIT_EXPERIMENTAL_TELEMETRY` option which outputs a new metric called `http.server.request.duration` which is a histogram of response durations and counts.

This is an example:

```auto
{"values":[0.375,0.875,1.75],"counts":[1,2,3]}

```

Is there an effective way to visualize this using Kibana Lens or some other way to do so? I’d like to be able to create a graph of these based on the value of the duration and counts over time and also by the labels `numeric_labels.http_response_`stat`us_code` and `labels.http_request_method`

We can ensure the buckets for the histogram are consistent by setting `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION` to `explicit_bucket_histogram `[Metrics Exporter - OTLP | OpenTelemetry](https://opentelemetry.io/docs/specs/otel/metrics/sdk_exporters/otlp/#additional-environment-variable-configuration)

> **[HTTP instrumentation configuration](https://opentelemetry.io/docs/zero-code/java/agent/instrumentation/http/)**
>
> Capturing HTTP request and response headers You can configure the agent to capture predefined HTTP headers as span attributes, according to the semantic convention. Use the following properties to define which HTTP headers you want to capture:
> System...

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 20, 2025, 4:02pm UTC](https://discuss.elastic.co/t/visualize-otel-http-server-request-duration-metric/382841/2 "2025-10-20T16:02:39Z")

</div>

Hi @david.michael, Welcome to the Community.

What version stack are you on?

On Recent Versions, Lens should support histograms.

Did you try that? Something like this?

 ![Screenshot 2025-10-20 at 8.53.57 AM](https://us1.discourse-cdn.com/elastic/original/3X/e/0/e0fd3bdccda034b247fcc8cbb82a9ee4c004199b.jpeg)

From one of the documents

```auto
   "metrics": {
      "transaction.duration.histogram": {
        "values": [
          4008.327388554257,
          4586.599435716125,
          4668.358175930145,
          4876.177108215123
        ],
        "counts": [
          1,
          1,
          1,
          1
        ]
      },

```

Note there

 ![Screenshot 2025-10-20 at 9.02.09 AM](https://us1.discourse-cdn.com/elastic/original/3X/e/f/efc7de8ee2a404ebc14e6ec848c24d0a1e00b48f.jpeg)

---

<div class="post-metadata">

**Author:** ![david.michael](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@david.michael](https://discuss.elastic.co/u/david.michael)\
**Post date:** [October 20, 2025, 7:29pm UTC](https://discuss.elastic.co/t/visualize-otel-http-server-request-duration-metric/382841/3 "2025-10-20T19:29:32Z")

</div>

We are using Kibana 9.1.2. I do see the option to chart it. So does Kibana automatically detect this is a histogram and if I use a function like Average or Count it will automatically know how to process the histogram to get a correct visualization from it?

What I’m seeing in this data doesn’t appear to match the pattern I’d expect from other APM trace data. For example, this is should show average response time by HTTP method for the last 4 hours. But the latency APM graph shows a large spike at a later, different time of about 30 seconds. I see something similar for count of `http.server.request.duration` and the throughput APM metric not matching.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/5/2520a77a77acc58849581f0758a76ff250fd1649.png)

---

<div class="post-metadata">

**Author:** ![david.michael](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@david.michael](https://discuss.elastic.co/u/david.michael)\
**Post date:** [October 20, 2025, 7:46pm UTC](https://discuss.elastic.co/t/visualize-otel-http-server-request-duration-metric/382841/4 "2025-10-20T19:46:09Z")

</div>

Example of APM data latency:

 ![Screenshot 2025-10-20 at 2.27.06 PM](https://us1.discourse-cdn.com/elastic/original/3X/3/0/3025c31de6f37acf8ada7d24ef116eaa6b734fca.png)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 20, 2025, 11:14pm UTC](https://discuss.elastic.co/t/visualize-otel-http-server-request-duration-metric/382841/5 "2025-10-20T23:14:44Z")

</div>

> [@david.michael](#):
>
> We are using Kibana 9.1.2. I do see the option to chart it. So does Kibana automatically detect this is a histogram and if I use a function like Average or Count it will automatically know how to process the histogram to get a correct visualization from it?

Yes it should.

> [@david.michael](#):
>
> What I’m seeing in this data doesn’t appear to match the pattern I’d expect from other APM trace data.

I am not sure what you are comparing that to on the bottom.

Many times when I see things like this it s because the graph is not properly filtered and / or broken down.. like by service or environment or transactions etc. .. the results are different dataset being erroneously aggregated together.

Are all the exact same filters applied...

There are different ways to calculate the latency... see here

> <https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/apm/dev_docs/apm_queries.md#transactions>

It is not clear to me that you are comparing like for like.

I think I gave examples here

> [@How do I add a custom dashboard with charts for latency, throughput, and transaction failure rate in APM Service?](https://discuss.elastic.co/t/how-do-i-add-a-custom-dashboard-with-charts-for-latency-throughput-and-transaction-failure-rate-in-apm-service/349635/2):
>
> Hi @Mang-Joo Welcome to the community. Just dig into the data. You can look at the data in Discover ... but it is pretty easy to just go to Lens and Start working with the Data. Open Lens and Create a Graph Example one of my services... from the APM App Here is a Lens (use the apm Data view or create one) Note I filtered for the same service... Or I took out the filter and put multiple services on the Viz
