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

Publish logging instrumentation package that injects X-Ray styled Trace IDs into logs #46

Open
NathanielRN opened this issue Nov 29, 2021 · 5 comments
Labels
enhancement New feature or request stale traces Tracing related issues

Comments

@NathanielRN
Copy link
Contributor

NathanielRN commented Nov 29, 2021

Description

The AWS X-Ray developer guide talks about Trace ID Injection. Trace ID Injection allows services like CloudWatch Service to link X-Ray segments to X-Ray segment Service Graphs. This is accomplished by injecting the current AWS X-Ray segment Trace ID into the log that is sent to CloudWatch under the AWS-XRAY-TRACE-ID key (the key is not important since the query is done on the Trace ID, but this is just an example). For example, as seen in the docs:

2019-09-10 18:58:30.844 [nio-5000-exec-4]  AWS-XRAY-TRACE-ID: 1-5d77f256-19f12e4eaa02e3f76c78f46a@1ce7df03252d99e1 WARN 1 - Your logging message here

The problem is, that we do not currently have a package that does this. This is unlike ADOT Java, which publishes a package for log4j and other logging libraries as well.

We should distribute a package like this which gives an OpenTelemetry Instrumentor that injects X-Ray formatted Trace IDs from the current OpenTelemetry Python span. Since we want to do X-Ray specific Trace IDs, the package should be hosted in this repo and not OTel Python Contrib.

NOTE: We need to set up publishing to PIP before we can work on this issue.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled

@github-actions github-actions bot added the stale label Nov 20, 2022
@BTripp1986
Copy link

This would be great to have

@github-actions github-actions bot removed the stale label Dec 18, 2022
@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled

@github-actions github-actions bot added the stale label Mar 19, 2023
@BTripp1986
Copy link

BTripp1986 commented Mar 19, 2023

I have implemented this manually in our FastAPI application running in ECS Fargate, but it is not incredibly reliable. Sometimes a trace id will get injected into the wrong log. Something out of the box and more robust would be a great feature. If I had time to take a crack at this I would open an MR, but sadly I don't have the time.

@github-actions github-actions bot removed the stale label Mar 26, 2023
@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled

@github-actions github-actions bot added the stale label Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale traces Tracing related issues
Projects
None yet
Development

No branches or pull requests

3 participants