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

Generate ID for x-Ray #40

Open
vasiliy-grinko opened this issue Oct 31, 2022 · 3 comments
Open

Generate ID for x-Ray #40

vasiliy-grinko opened this issue Oct 31, 2022 · 3 comments

Comments

@vasiliy-grinko
Copy link

vasiliy-grinko commented Oct 31, 2022

Feature request

As of now, go-agent is generating id in format which don't conforms with AWS X-Ray

I looked at code and didn't understand how to replace &eBPFSourceIDGenerator with xray.NewIDGenerator() without crushing the tracing.

Use case

In order to send traces to X-ray, go-agent needs generate ID in proper format.

@vasiliy-grinko
Copy link
Author

I managed to generate ID for X-Ray by editing NewController() function:
added lines:

idg := xray.NewIDGenerator()
otel.SetTracerProvider(tracerProvider)
otel.SetTextMapPropagator(xray.Propagator{})

chenaged line 114 sdktrace.WithIDGenerator(idg),

I also want to add status code and path of a request into traces

@edeNFed
Copy link
Contributor

edeNFed commented Nov 2, 2022

Sounds good, I will be happy to accept a PR.

@vasiliy-grinko
Copy link
Author

Sounds good, I will be happy to accept a PR.

I'll create it after I fix this problem: in X-Ray I don't see a status code and a request path, in otel-collector logs I see this
2022-11-02T10:46:12.185Z debug [email protected]/awsxray.go:67 request: { TraceSegmentDocuments: ["{\"name\":\"backend\",\"id\":\"dc653d4977e1457b\",\"start_time\":1667385967.2310646,\"trace_id\":\"1-63624a6f-f40d0a0ff943e053208c61cd\",\"end_time\":1667385967.2310905,\"http\":{\"request\":{\"method\":\"GET\"},\"re} {"kind": "exporter", "data_type": "traces", "name": "awsxray"} 2022-11-02T10:46:12.192Z debug [email protected]/awsxray.go:74 response: { UnprocessedTraceSegments: [] } {"kind": "exporter", "data_type": "traces", "name": "awsxray"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants