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

[APM] 500 while fetching linked span without span.subtype #202370

Open
1pkg opened this issue Nov 29, 2024 · 1 comment
Open

[APM] 500 while fetching linked span without span.subtype #202370

1pkg opened this issue Nov 29, 2024 · 1 comment
Labels
apm bug Fixes for quality problems that affect the customer experience Team:APM All issues that need APM UI Team support

Comments

@1pkg
Copy link
Member

1pkg commented Nov 29, 2024

Describe the bug:

In the thread a potential issue with :kbn/internal/apm/traces/{traceId}/span_links/{spanId}/children endpoint was unraveled. In which while fetching linked spans APM UI will assume that span.subtype is a required field and fail when the field is not set, see the required fields definition in the code.

Steps to reproduce:

  1. Run provided go script to ingest traces without subtype.
  2. In Kibana go to Applications > Service Inventory > Transactions > Span details > Span Links
  3. Observe 500 error

Expected behavior:

Either span.subtype shouldn't be a required field or this error should be handled gracefully by filtering out spans which don't have the field.

Screenshots (if relevant):

Image

Provide logs and/or server output (if relevant):

GET :kbn/internal/apm/traces/{traceId}/span_links/{spanId}/children

{
    "statusCode": 500,
    "error": "Internal Server Error",
    "message": "Missing required fields span.subtype in event",
    "attributes": {
        "data": {},
        "_inspect": []
    }
}

Any additional context:

An example go script to ingest the data.

package main

import "go.elastic.co/apm/v2"

func main() {
	tracer, _ := apm.NewTracerOptions(apm.TracerOptions{})
	tr := tracer.StartTransaction("trx", "type")
	span := tr.StartSpan("span", "custom.sub", nil)
	span.End()
	for range 10 {
		// Note there is no subtype here.
		s := tr.StartSpan("span", "custom", nil)
		s.AddLink(apm.SpanLink{Trace: span.TraceContext().Trace, Span: span.TraceContext().Span})
		s.End()
	}
	tr.End()
	tracer.Flush(nil)
}
@1pkg 1pkg added apm bug Fixes for quality problems that affect the customer experience labels Nov 29, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Nov 29, 2024
@dej611 dej611 added the Team:APM All issues that need APM UI Team support label Dec 2, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:APM)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm bug Fixes for quality problems that affect the customer experience Team:APM All issues that need APM UI Team support
Projects
None yet
Development

No branches or pull requests

3 participants