Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in converting between OTEL and APM context #1686

Open
rubvs opened this issue Jan 24, 2025 · 1 comment
Open

Issue in converting between OTEL and APM context #1686

rubvs opened this issue Jan 24, 2025 · 1 comment
Assignees
Labels

Comments

@rubvs
Copy link

rubvs commented Jan 24, 2025

Describe the bug

Information seems to be getting lost between converting from an APM context to OTEL context.

  1. If we have a OTEL parent span and APM child span, we can see full relationship in Kibana. The figure below shows how we go from elasticHandler (otel) -> Streaming (apm) -> Semaphore.Acquire (apm)
Image
  1. The issue arises when we want to go from an APM span back to an OTEL span. In this case, we do not observe the last span (Semaphore.Acquire) in Kibana.
Image

To Reproduce

  1. Create an OTEL parent span. Then an APM child span, followed by another APM child span. View in Kibana
  2. Create an OTEL parent span. Then an APM child span, followed by an OTEL child span. View in Kibana

Expected behavior

Spans and Span Links that go from OTEL context to APM context doesn't work.

@dmathieu
Copy link
Member

dmathieu commented Jan 25, 2025

Nice find.
It looks like this is because the APM span is a child span. We only look for transactions when checking parent spans from apm.

if tx := apm.TransactionFromContext(ctx); tx != nil {
parent = &span{tx: tx}
}

@dmathieu dmathieu self-assigned this Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants