Add Transaction.name in Spans / Merge Doucment of span and transaction

Hello Elastic Observability > APM engineers,

I have multiple agents ingerated with multiple type of applications using multiple methods like nodes js agents, python, java and some of the application are ingerated using open telemetry .

I want to have transaction.name in my span doucment instead of just transaction.id,

How to achieve that so i can build a case on it ingest-pipeline transforms Elastic Observability > APM elastic-observability-engineer

Thanks for reaching out, @kishorkumar,

Would using OpenTelmetry's attribute mapping work for you? Here is an example of what this could look like:

from opentelemetry import trace
from opentelemetry.trace import SpanKind

tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span("name-of-transaction", kind=SpanKind.SERVER) as span:

Hi @jessgarson,

No i have not tried at opentelemetry as i am looking for one solution to do on all the apm's via elasticsearch itself not on code bases either its ingtegrated opentelementry, nodes js, python or java etc from elasticsearch end not from any code level.

But i will try that on opentelemetry as well but there others aswell how we are going to enable on them.

Thanks, @kishorkumar. Thanks for providing that additional context. From an Elasticsearch prespective, have you considered using an ingest pipeline or transforms for this purpose?

Hi,
I have tried via **Transform ** it is looks impossible as span and transaction in same index but different document.

Yes, In ingest pipleline it was possible via enrich processor and enrichment policy but as we have the datastream and we will use index: apm-traces-* in enrichment_policy and it will through the exception of large data - circuit_breaking_exception

If and we can the month or the day in our index-pattern by as traces-apm-{{year}}-{{month}}-{{day}}-* then only enrichment policy will excute and we might get the results.

Have you ever come across with this kind of use case to get one document which merge the fields of 2 different doucments fields from same datastream index via transform or any method?