# New Plugin-Api setAttribute not shown in APM App

**URL:** <https://discuss.elastic.co/t/new-plugin-api-setattribute-not-shown-in-apm-app/311903>\
**Category:** APM\
**Tags:** java\
**Created:** [August 11, 2022, 7:20am UTC](https://discuss.elastic.co/t/new-plugin-api-setattribute-not-shown-in-apm-app/311903 "2022-08-11T07:20:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaoranlaos](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Shaoranlaos](https://discuss.elastic.co/u/Shaoranlaos)\
**Post date:** [August 11, 2022, 7:20am UTC](https://discuss.elastic.co/t/new-plugin-api-setattribute-not-shown-in-apm-app/311903/1 "2022-08-11T07:20:48Z")

</div>

**Kibana version** : 7.8.0

**Elasticsearch version** : 7.8.0

**APM Server version** : 7.8.0

**APM Agent language and version** : Java 1.33.0

**Browser version** : Chrome 103

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
I'm trying to set an attribute in an instrumentation plugin via the new Plugin Api:

```auto
Tracer tracer = GlobalOpenTelemetry.get().getTracer("TibcoServer");
SpanBuilder spanBuilder = tracer.spanBuilder(subject).setSpanKind(SpanKind.PRODUCER);
if (subject.startsWith("_INBOX")) {
    spanBuilder.setAttribute("type", "reply");
} else {
    spanBuilder.setAttribute("type", "publish");
}
Span span = spanBuilder.startSpan();
Scope scope = span.makeCurrent();

```

The Transaction and Span for this instrumentation is shown in the APM App but i can not find this attribute anywhere in the APM-App or on the span document in the apm\* indices.

Is that not a supported feature of the Plugin-Api yet or is my APM-Server Version to old for this?  
Where should this attribute be seen?

---

<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:** [August 11, 2022, 7:47am UTC](https://discuss.elastic.co/t/new-plugin-api-setattribute-not-shown-in-apm-app/311903/2 "2022-08-11T07:47:43Z")

</div>

Not sure why this doesn't work. Maybe the `type` attribute key is a reserved one and the APM Server maps it to something. Try to use a different attribute name, for example - `message-action`.

If that doesn't work, please find a document of such span, verify it is indeed one on which you set the attribute, and share it.

---

<div class="post-metadata">

**Author:** ![Shaoranlaos](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Shaoranlaos](https://discuss.elastic.co/u/Shaoranlaos)\
**Post date:** [August 11, 2022, 10:12am UTC](https://discuss.elastic.co/t/new-plugin-api-setattribute-not-shown-in-apm-app/311903/3 "2022-08-11T10:12:53Z")

</div>

I changed the name of the artribute i set but no luck (its another instrumentation for the client side because i can change that more easily):

```auto
Tracer tracer = GlobalOpenTelemetry.get().getTracer("TibcoServer");
Span span = tracer.spanBuilder(subject).setSpanKind(SpanKind.PRODUCER)
        .setAttribute("messageIsA", "request")
        .startSpan();
Scope scope = span.makeCurrent();

```

Here the Json doc of the transaction that is created in the apm index (it only has a transaction with no span):

> <https://gist.github.com/Shaoranlaos/5c273c9c382e4517cc3bb4910df2e6ee>

---

<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:** [August 11, 2022, 11:02am UTC](https://discuss.elastic.co/t/new-plugin-api-setattribute-not-shown-in-apm-app/311903/4 "2022-08-11T11:02:58Z")

</div>

OK, sorry for missing that before - I thought that we send OTel attributes as labels, for which the mapping is dynamic, but we send them as `otel.attributes`, which APM Server supports only since [7.16](https://www.elastic.co/guide/en/apm/guide/7.17/release-notes-7.16.html#_intake_api_changes).

---

<div class="post-metadata">

**Author:** ![Shaoranlaos](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Shaoranlaos](https://discuss.elastic.co/u/Shaoranlaos)\
**Post date:** [August 11, 2022, 11:04am UTC](https://discuss.elastic.co/t/new-plugin-api-setattribute-not-shown-in-apm-app/311903/5 "2022-08-11T11:04:08Z")

</div>

ok that makes sense, thank you for confirming my suspion.

---

<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:** [September 1, 2022, 7:04am UTC](https://discuss.elastic.co/t/new-plugin-api-setattribute-not-shown-in-apm-app/311903/6 "2022-09-01T07:04:59Z")

</div>

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