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

span events doesn't show up in the Xray trace segments #821

Open
kullu-ashish opened this issue Dec 21, 2021 · 8 comments
Open

span events doesn't show up in the Xray trace segments #821

kullu-ashish opened this issue Dec 21, 2021 · 8 comments
Assignees
Labels
traces Tracing related issue X-Ray AWS X-Ray components

Comments

@kullu-ashish
Copy link

Is your feature request related to a problem? Please describe.
span.AddEvents on the span in the code instrumenting the OTELHttp. However, these events don't show up on the Xray traces segments.

Sample code -

func genericHandler(w http.ResponseWriter, r *http.Request, endpoint string) {
ctx := r.Context()
span := trace.SpanFromContext(ctx)

    commonLabels := []attribute.KeyValue{
            attribute.String("labelA", "chocolate"),
            attribute.String("labelB", "raspberry"),
            attribute.String("labelC", "vanilla"),
    }

    span.AddEvent("Test Span A", trace.WithAttributes(commonLabels...))
    time.Sleep(1 * time.Second)
    span.AddEvent("Test Span B")
    span.AddEvent("handling this http request", trace.WithAttributes(attributeEndpoint.String(endpoint)))

    resp, err := httpClient.Get(endpoint)
    if err != nil {
            w.WriteHeader(http.StatusBadRequest)
            w.Write([]byte(fmt.Sprintf("Failed to make request.\n%v", err)))

            msg := fmt.Sprintf("failed to make request.\n%v", err)
            log.Print(msg)

            span.AddEvent("error occurred", trace.WithAttributes(attributeError.String(msg)))
            return
    }
    defer resp.Body.Close()

    body, err := io.ReadAll(resp.Body)

    if err != nil {
            w.WriteHeader(http.StatusBadRequest)
            w.Write([]byte(fmt.Sprintf("Failed to read body.\n%v", err)))
            msg := fmt.Sprintf("failed to read body.\n%v", err)
            log.Print(msg)

            span.AddEvent("error occurred", trace.WithAttributes(attributeError.String(msg)))
            return
    }

    log.Print(fmt.Sprintf("%v response body: %v", endpoint, string(body)))
    span.AddEvent("body", trace.WithAttributes(attributeReqBody.String(string(body))))
    span.AddEvent("response body", trace.WithAttributes(attributeReqBody.String(string(body))))

    w.Write(append([]byte("Body: "), body...))

}

Only first segment which is the serviceB name shows up but I added 4 events, they don't show up in traces(AWS Xray).

Describe the solution you'd like
When you add the span events on the trace, it should create new segments on AWS Xray traces.

Describe alternatives you've considered
There is not alternative solution at the moment.

Additional context
Added

@kullu-ashish kullu-ashish changed the title span events doesn't show inteh Xray segments span events doesn't show up in the Xray trace segments Dec 21, 2021
@alolita alolita added xray traces Tracing related issue labels Jan 7, 2022
@willarmiros
Copy link
Contributor

Hi @kullu-ashish,

Unfortunately there is no equivalent to the OpenTelemetry Event in the X-Ray data model so events are dropped when sending OTel spans to the X-ray backend. We will update our docs to reflect this. At this time we are unable to provide an ETA for event support, but will update this issue if there are any updates.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Mar 27, 2022
@willarmiros willarmiros added this to the ADOT Collector Backlog milestone Mar 27, 2022
@alolita alolita removed the stale label Apr 4, 2022
@Aneurysm9 Aneurysm9 added X-Ray AWS X-Ray components and removed xray labels Apr 28, 2022
@willarmiros
Copy link
Contributor

Docs have been updated here: https://aws-otel.github.io/docs/getting-started/x-ray#configuring-the-aws-x-ray-exporter

We are working with the X-Ray backend team to update our data model to support span Events as first-class citizens. Will leave this open to track that progress.

@meijeran
Copy link

Is there already an update on this?

@atshaw43
Copy link

@meijeran
I'm afraid I do not have an update to share on the topic.
We do not currently support events in X-Ray.
I have no ETA on when this functionality will be supported.

@kcrandall
Copy link

Is there any update on this? Spent a while trying to figure out why my events werent showing up in AWS managed grafana and i think this is it (using open telemetry aws distro as sidecar with otlp exporter, which is properly being fed events).

Is it being worked on still or has events support been abandoned by xray? Don't expect a solid release date, but this has been open for over 2 years so kinda wanted to know if this is a 2030s feature or something that is actively being worked on by the x-ray team.

@vastin
Copy link
Contributor

vastin commented May 6, 2024

The limit support of span event is added in #27232 and documented for HTTP error events. The generic span events support is still in roadmap and there is no ETA yet.

@ishworg
Copy link

ishworg commented Sep 20, 2024

if this is a 2030s feature or something that is actively being worked on by the x-ray team.

@kcrandall, the thing is that pretty much all serious tracing backends are ahead of xray these days.

Almost everyone I have spoken to uses other tracing backends apart from this toy called xray.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
traces Tracing related issue X-Ray AWS X-Ray components
Projects
None yet
Development

No branches or pull requests

9 participants