# Query request count ( time series data ) using HTTP headers / attributes in Dynatrace DQL

**URL:** <https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed\
**Created:** [September 15, 2025, 4:13pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353 "2025-09-15T16:13:21Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Butchi](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@Butchi](https://community.dynatrace.com/u/Butchi)\
**Post date:** [September 15, 2025, 4:13pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/1 "2025-09-15T16:13:21Z")

</div>

I have a java application with bunch of API end points and each end point has a unique identifier in the HTTP header header ( for example : sourceID as one identifier in the request header).&nbsp; Whats the best way to get the&nbsp; request count ( as time series data ) for each endpoint using service name and HTTP header attributes ?

In this case :

my service name = XYX\_Service

Endpoint&nbsp; = processRequest

URL path&nbsp; = /api/my\_request

HTTP request header attribute sourceID =abc

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [September 15, 2025, 8:26pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/2 "2025-09-15T20:26:52Z")

</div>

You could enable the business events capture for these requests, and extract the HTTP header as attribute, then you can easily summarize it.

> **[Business event capture](https://docs.dynatrace.com/docs/observe/business-observability/bo-events-capturing#examples-of-data-capture-from-requests-and-responses)**
>
> Capture business events for Dynatrace Business Observability.

Or, you could create a request attribute from classic settings, and create a calculated service metric from MDA app, using the created request attribute as dimension.

> **[Capture request attributes based on web request data](https://docs.dynatrace.com/docs/observe/application-observability/services/request-attributes/capture-request-attributes-based-on-web-request-data)**
>
> Create request attributes based on web request data.

> **[Multidimensional analysis](https://docs.dynatrace.com/docs/observe/application-observability/multidimensional-analysis)**
>
> Configure a multidimensional analysis view and save it as a calculated metric.

---

<div class="post-metadata">

**Author:** ![Butchi](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@Butchi](https://community.dynatrace.com/u/Butchi)\
**Post date:** [September 15, 2025, 9:05pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/3 "2025-09-15T21:05:02Z")

</div>

Hi&nbsp;[@dannemca](https://community.dynatrace.com/user/18264)&nbsp;Yes we enabled those business events to capture business level metrics but we’re not able to capture response times, failures and request counts via business events unless we’re missing some additional steps in&nbsp;business events config.

From classic setting page, we have a request attribute rule to capture those headers ( using HTTP Request header as attribute source ) but those&nbsp;request attribute are not showing up as dimension although we have some traffic. Not sure what the issue was and whats causing it not to show up.

---

<div class="post-metadata">

**Author:** ![Butchi](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@Butchi](https://community.dynatrace.com/u/Butchi)\
**Post date:** [September 15, 2025, 9:30pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/4 "2025-09-15T21:30:32Z")

</div>

Just to add , From&nbsp;classic setting page, with&nbsp;request attribute rule, Dynatrace shows ( Under Explore view ) those attributes under HTTP Headers as opposed to showing it under Request attributes. This is preventing us to&nbsp;create a calculated service metric using those dimensions.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [September 16, 2025, 8:01am UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/5 "2025-09-16T08:01:59Z")

</div>

[@Butchi](https://community.dynatrace.com/user/18869)&nbsp; can you share a screenshot? If can see request attributes on the service, you can define it in the calculated service metric:

 ![Julius_Loman_0-1758009467430.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/3/f3a045e9c73ed93d1b1b9f19dd3982339234b227.png)

You can also try to “reload” the Dynatrace UI (refresh the page), if the request attribute is newly defined, it might not be yet visible.

The most straightforward path is using the multidimensional analysis for the service, use the request attribute for splitting and then if the values are as expected, create a metric:

 ![Julius_Loman_1-1758009708584.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/3/d37d0da3863a19e66fb8c366043da87ef75cb4f5.png)

---

<div class="post-metadata">

**Author:** ![t\_pawlak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/t_pawlak/32/14991_2.png) [@t\_pawlak](https://community.dynatrace.com/u/t_pawlak)\
**Post date:** [September 16, 2025, 9:07am UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/6 "2025-09-16T09:07:16Z")

</div>

Hi,  
if you can see the header under HTTP Headers in Explore, it means the OneAgent is capturing it.  
However, for it to be available as a **dimension** (for Calculated Service Metrics or DQL), it must first be converted into a **Request Attribute**.

Here’s what you should check:

1. **Verify the Request Attribute configuration**

2. **Wait for propagation**  
Request Attributes are calculated by the OneAgent. After saving the rule, allow a few minutes for the config to propagate and generate new traffic – attributes are not calculated retroactively.

3. **Validate in MDA**  
Open _Multidimensional analysis_ for the service, try “Split by → Request attribute → sourceID”.

4. **Then create the Calculated Service Metric**  
In MDA, click “Create metric” with the Request Attribute as dimension.

---

<div class="post-metadata">

**Author:** ![Butchi](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@Butchi](https://community.dynatrace.com/u/Butchi)\
**Post date:** [September 16, 2025, 5:00pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/7 "2025-09-16T17:00:31Z")

</div>

Hi&nbsp; [@t\_pawlak](https://community.dynatrace.com/user/42367)&nbsp; & [@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;Thank you. Yes those settings are defined as mentioned in your steps. I think I found the issue.

This is how my header looks like

accept: \*/\*

source-id:QTR

content-length:2415

content-type: application/json

in my RA rule , I have “HTTP Request header”&nbsp;as my request attribute source and then parameter name defined as “source-id:” ( with column at the end ) and for some reason Dynatrace didn’t like “:” so I went a head and removed it and request attributed are picking up and showing in MDA.

one final question - is there way to query time series data using those request attributes as filters ? I do not want to use fetch spans in this case.

Thank you.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [September 16, 2025, 6:57pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/8 "2025-09-16T18:57:16Z")

</div>

Sure, when you create your calculated service metric, it will have the dimension (just a single one) you specified. So you can query it in both Dashboards and Dashboards classic.

---

<div class="post-metadata">

**Author:** ![t\_pawlak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/t_pawlak/32/14991_2.png) [@t\_pawlak](https://community.dynatrace.com/u/t_pawlak)\
**Post date:** [September 16, 2025, 7:01pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/9 "2025-09-16T19:01:50Z")

</div>

Calculated Service Metric (CSM) from MDA

In Multidimension Anlaysys for your service, split by your Request Attribute source-id and pick the measure you want (e.g., request count, response time).

Click Create metric, and include the Request Attribute as a dimension in the metric definition

---

<div class="post-metadata">

**Author:** ![Butchi](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@Butchi](https://community.dynatrace.com/u/Butchi)\
**Post date:** [September 16, 2025, 7:15pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/10 "2025-09-16T19:15:29Z")

</div>

Hi&nbsp;[@t\_pawlak](https://community.dynatrace.com/user/42367)&nbsp;,&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;Yes I agree and&nbsp; we can query Calculated Service Metrics (CSM) generated from MDA . However I’m thing about using requestAttribute as a filter in my DQL instead of going with&nbsp;Calculated Service Metric route. is that possible ? something like give me all request count where dt.serviceName=myService and&nbsp;source-id=XYZ

---

<div class="post-metadata">

**Author:** ![t\_pawlak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/t_pawlak/32/14991_2.png) [@t\_pawlak](https://community.dynatrace.com/u/t_pawlak)\
**Post date:** [September 16, 2025, 7:21pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/11 "2025-09-16T19:21:00Z")

</div>

You can’t directly use a Request Attribute as a filter in a metric query unless you’ve turned it into a dimension of a metric first.  
Request Attributes are available as fields in trace/span data, so you can use them with fetch spans like this:

```markup
fetch spans
| filter service.name == "myService"
  and requestAttribute."source-id" == "XYZ"
| summarize count()

```

But i not recommended this option

In metric queries (timeseries), request attributes aren’t exposed by default as dimensions.  
To filter by them in a metric query, you need to create a Calculated Service Metric (CSM) with the request attribute included as a dimension.  
Then you can query time series data like this:

```markup
timeseries req = sum(m:calc:service.requests.by_source_id), by: {dt.entity.service, source_id}
| filter dt.entity.service == "SERVICE-XXXXXXXXXXXXXXX" and source_id == "XYZ"

```

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [September 16, 2025, 7:26pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/12 "2025-09-16T19:26:46Z")

</div>

When you don’t want a calculated service metric, you need query spans in DQL. (or bizevent - if you defined capturing). All has pros and cons. See table below

| &nbsp; | **Pros** | **Cons** |
| Calculated service metric | No additional cost for queries | Works on captured traces (might not be 100% accurate) |
| Fetch spans | More flexibility in queries | Additional cost with queries.  
Works on captured traces (might not be 100% accurate) |
| Bizevents | Accurate - works with 100% of requests, regardless of sampling (yes some limits for very high volume services apply) | Technology must be supported for OneAgent bizevent capture.  
Additional cost with queries on raw bizevents using DQL - but can be eliminated by metrics from bizevents.  
Can't capture response time of the request - [product idea](https://community.dynatrace.com/post/279384). |

---

<div class="post-metadata">

**Author:** ![Butchi](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@Butchi](https://community.dynatrace.com/u/Butchi)\
**Post date:** [September 16, 2025, 7:35pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/13 "2025-09-16T19:35:07Z")

</div>

Got it thanks for the info. Unfortunately we don’t DT have license for spans and have a need to capture response time for all service metrics. so it sounds like CSM is the only option. thank you all for your inputs.

---

<div class="post-metadata">

**Author:** ![Butchi](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@Butchi](https://community.dynatrace.com/u/Butchi)\
**Post date:** [September 16, 2025, 7:38pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/14 "2025-09-16T19:38:09Z")

</div>

Thank you [@Julius\_Loman](https://community.dynatrace.com/user/3364)&nbsp;& [@t\_pawlak](https://community.dynatrace.com/user/42367)&nbsp;. We don’t have a license for spans so CSM is the only option. will try your time series query using CSM, thanks for your help and really appreciated.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [September 16, 2025, 7:38pm UTC](https://community.dynatrace.com/t/query-request-count-time-series-data-using-http-headers-attributes-in-dynatrace-dql/53353/15 "2025-09-16T19:38:32Z")

</div>

Yes, then you are most likely left with calculated service metric.&nbsp;  
Bizevents might be interesting approach too in your case - but it depends on the technologies used.
