# How to add and process private custom attributes in elastic-apm-traceparent?

**URL:** <https://discuss.elastic.co/t/how-to-add-and-process-private-custom-attributes-in-elastic-apm-traceparent/213033>\
**Category:** APM\
**Tags:** go\
**Created:** [December 26, 2019, 3:38am UTC](https://discuss.elastic.co/t/how-to-add-and-process-private-custom-attributes-in-elastic-apm-traceparent/213033 "2019-12-26T03:38:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [December 26, 2019, 3:38am UTC](https://discuss.elastic.co/t/how-to-add-and-process-private-custom-attributes-in-elastic-apm-traceparent/213033/1 "2019-12-26T03:38:13Z")

</div>

**Kibana version** :

v7.4.2

**Elasticsearch version** :

v7.4.2

**APM Server version** :

v7.4.2

**APM Agent language and version** :

v1.6.0

**Question** :

We hope to implement a requirement to add a private attribute identifier to the existing link identifier elastic-apm-traceparent, while ensuring that the original link trace is normal.

I have observed these methods ([https://github.com/elastic/apm-agent-go/blob/master/internal/apmcontext/context.go#L22-L55](https://github.com/elastic/apm-agent-go/blob/master/internal/apmcontext/context.go#L22-L55)), I customize the implementation and replace it, is it possible to implement My purpose?

Do you have any good suggestions, thank you!

---

<div class="post-metadata">

**Author:** ![EDDYCJY](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eddycjy/32/54324_2.png) [@EDDYCJY](https://discuss.elastic.co/u/EDDYCJY)\
**Post date:** [December 26, 2019, 3:39am UTC](https://discuss.elastic.co/t/how-to-add-and-process-private-custom-attributes-in-elastic-apm-traceparent/213033/2 "2019-12-26T03:39:28Z")

</div>

@axw Hello, i'm here to disturb you again ...

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [January 6, 2020, 8:19am UTC](https://discuss.elastic.co/t/how-to-add-and-process-private-custom-attributes-in-elastic-apm-traceparent/213033/3 "2020-01-06T08:19:34Z")

</div>

@EDDYCJY sorry for the late reply, I've been away from computer for the past couple of weeks.

Adding custom attributes to `elastic-apm-traceparent` is not possible, as that header is meant to conform to the [W3C Trace-Context standard](https://w3c.github.io/trace-context/).

I think [Correlation-Context](https://w3c.github.io/correlation-context/) may address your needs. We don't currently have plans to add this, but that might change.

For now you will need to implement your own middleware to propagate custom attributes.

---

<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:** [January 27, 2020, 4:19am UTC](https://discuss.elastic.co/t/how-to-add-and-process-private-custom-attributes-in-elastic-apm-traceparent/213033/4 "2020-01-27T04:19:35Z")

</div>

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