Apm: Add global labels to spans

Created on 27 Sep 2019  路  9Comments  路  Source: elastic/apm

Currently, global labels are only added to transactions, metrics, and errors. There are several requests for enabling global labels for spans too.

The latest one: https://discuss.elastic.co/t/labels-are-getting-added-to-only-transaction-event-not-to-span-event/201069/

Some other use cases:

  • Send all events with a particular global label (for example department) to a specific index. By doing that it's possible to set up different retention/ILM policies based on the global label.
  • Use the global label for access control (see also https://github.com/elastic/apm/issues/99)
discussion

Most helpful comment

Issue created but milestone decision is still pending, feel free to follow the linked issue.

All 9 comments

The environment will be added to all spans as of 7.4: https://github.com/elastic/apm-server/issues/2471

IMHO, it would be consistent to do the same for global labels. Does someone have objections in terms of disk usage? I don't expect that users would add lots and lots of global labels. And if they add them, they generally want to be able to filter by those labels.

Personally, I'm all for _consistency_. The less differences between transactions and spans the better.

Filtering spans by labels has come up in multiple user conversations. In most cases its users wanting to add just a couple of labels(at the most)to track specific end to end user actions.

Based on the comments here and in today's meeting, it seems like there's agreement that this should be done. @graphaelli could you create an APM Server issue and put it in a milestone?

When can I expect this change? In which release it will be updated?

Issue created but milestone decision is still pending, feel free to follow the linked issue.

Server support has been merged. If agents do not need a new API or anything, this issue can be closed.

AFAIK, they do not. We can reopen if needed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

axw picture axw  路  6Comments

axw picture axw  路  11Comments

jianzzz picture jianzzz  路  12Comments

mikker picture mikker  路  11Comments

formgeist picture formgeist  路  7Comments