# How does grouping\_key get assigned?

**URL:** <https://discuss.elastic.co/t/how-does-grouping-key-get-assigned/203959>\
**Category:** APM\
**Created:** [October 17, 2019, 3:24am UTC](https://discuss.elastic.co/t/how-does-grouping-key-get-assigned/203959 "2019-10-17T03:24:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ntavendale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ntavendale/32/38029_2.png) [@ntavendale](https://discuss.elastic.co/u/ntavendale)\
**Post date:** [October 17, 2019, 3:24am UTC](https://discuss.elastic.co/t/how-does-grouping-key-get-assigned/203959/1 "2019-10-17T03:24:03Z")

</div>

Have attempted to do my own assignment like so:  
{"error":{"id":"4367DBC77C9A6AE7","timestamp":1571282318000000,"trace\_id":"70C8BA2D755B5AE570DBA0807F14A684","transaction\_id":"5E3768BB0EF5FBAC","parent\_id":"5E3768BB0EF5FBAC","culprit":"TTransactionWithSpansTest.Load","grouping\_key":"403","exception":{"code":"403","message":"HTTP/1.1 403 Forbidden","attributes":null,"stacktrace":null,"type":"EIdHTTPProtocolException","handled":true}}}

and I get a 200 back. However when I look up the error in ES the grouping\_key has been changed. And for some reason all my errors are being assigned the same grouping\_key.

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [October 17, 2019, 5:24am UTC](https://discuss.elastic.co/t/how-does-grouping-key-get-assigned/203959/2 "2019-10-17T05:24:19Z")

</div>

Hi again 🙂

As my reply to the other topic- best is to refer you to [the Intake API documentation](https://www.elastic.co/guide/en/apm/server/current/intake-api.html) and [the APM server GitHub repo](https://github.com/elastic/apm-server/tree/master/docs/spec).

I believe the `grouping_key` is assigned by the APM server as part of events ingestion.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 7, 2019, 1:24am UTC](https://discuss.elastic.co/t/how-does-grouping-key-get-assigned/203959/3 "2019-11-07T01:24:20Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
