# Hierarchical federated setup is not aggregating metrics

**URL:** <https://discuss.prometheus.io/t/hierarchical-federated-setup-is-not-aggregating-metrics/1817>\
**Category:** Scaling / Clustering / Long-Term Storage\
**Created:** [August 18, 2023, 6:09am UTC](https://discuss.prometheus.io/t/hierarchical-federated-setup-is-not-aggregating-metrics/1817 "2023-08-18T06:09:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pm-viral-vala](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/pm-viral-vala/32/779_2.png) [@pm-viral-vala](https://discuss.prometheus.io/u/pm-viral-vala)\
**Post date:** [August 18, 2023, 6:09am UTC](https://discuss.prometheus.io/t/hierarchical-federated-setup-is-not-aggregating-metrics/1817/1 "2023-08-18T06:09:52Z")

</div>

Hi Team,

As per documentation **Hierarchical federated** setup does **aggregation of metrics** at the **job level.** I was trying out the same but it is not working for me.

Let’s assume the below setup.

**Prometheus Server (P1) =\> Scarping from 3 nodes**  
eg: 3 nodes are exposing metrics

```auto
http_requests{instance: "n1", job:"j1"} = 10
http_requests{instance: "n2", job:"j1"} = 10
http_requests{instance: "n3", job:"j1"} = 10

```

**Federated Prometheus(P2) =\> Scraping from P1**  
**Expectation** is P2 should have only one key(aggregated) `http_requests{job:"j1"} = 30`  
**Actually,** In P2 I am getting 3 of the same instances not aggregated.

```auto
http_requests{instance: "n1", job:"j1"} = 10
http_requests{instance: "n2", job:"j1"} = 10
http_requests{instance: "n3", job:"j1"} = 10

```

I have a very large number of nodes and wanted aggregated metrics at the job level, not the instance level.

I tried relabeling/removing of instance label but it’s not helping here. Can someone please me with the correct configuration at P1 and P2?

Thanks in Advance,  
Viral
