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

Invalid traceparent generated is causing dd-python library to throw errors #2925

Open
grzegorzwziatek-flyr opened this issue Aug 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@grzegorzwziatek-flyr
Copy link

Describe the bug

Hi,
we are using allowedTracingUrls so some traceparent heading is added to each request to our allowed list of urls. Unfortunately generated traceparent seems to be invalid and in backend in python library there is an exception logged -> https://github.com/DataDog/dd-trace-py/blob/ab8588c4a5c446ada65ab248b8a69c11aa546340/ddtrace/propagation/http.py#L804.

This looks like traceparent is added few times to headers and this is causing issue.

We are using latest @datadog/browser-rum": "^5.23.3", package and issue still exists. Can you please look at this issue?

Example generated exceptions:

Invalid traceparent version: 00-000000000000000011a50c8dcc567ed9-6f4232e02d4ac784-01, 00-0000000000000000442a20cbe29c4fa5-5ed6c6b4142b2447-01
Invalid traceparent version: 00-00000000000000004eaacec6a925dc53-770a00d530aa0196-01, 00-000000000000000023ec18787d44ab92-0b6e9dc02656ed98-01, 00-000000000000000030bad57ea1022e49-1d66eeed697f9905-01
Invalid traceparent version: 00-000000000000000036dbed040d19e83f-772ea7035c651c75-01, 00-000000000000000053466c54bc15cb59-76013d79dd1ea453-01, 00-00000000000000003cffd24cb75d41b4-21f96faa0f558226-01
Invalid traceparent version: 00-000000000000000057e36a4796d90c6f-2e04d2ade6e86e69-01, 00-00000000000000004fac5992ccbd917f-4f7510405039bbbb-01

To Reproduce
This is random behaviour, happens around 20 times in 1000 reqs.

Expected behavior
Only one traceparent added to xhr header

@grzegorzwziatek-flyr grzegorzwziatek-flyr added the bug Something isn't working label Aug 7, 2024
@grzegorzwziatek-flyr grzegorzwziatek-flyr changed the title 🐛 My bug title Invalid traceparent generated is causing dd-python library to throw errors Aug 7, 2024
@cy-moi
Copy link
Contributor

cy-moi commented Aug 12, 2024

Hi @grzegorzwziatek-flyr ,
Thank you for reaching out. I see that the logs attached are from backend. And we have a hard time to reproduce these headers in the browser. We could provide some guesses to move you forward though:

  1. are the issues all from the same session/user? - maybe they are injecting extra code from client side.
  2. are there other libraries also adding trace info? - these headers might not necessarily come from one source.

To better assist you further, I suggest to reach out to Datadog Support.

@grzegorzwziatek-flyr
Copy link
Author

grzegorzwziatek-flyr commented Aug 14, 2024

Hi @cy-moi

  1. Yes this is same user - happens even on my user
  2. We had sentry, but we disabled it on our testing env - issue is still here
  3. We have federated applications and we thought that this might be an issue, but we are protecting datadog from another initialisation by executing this code:
if (!datadogRum.getInternalContext()) {
    datadogRum.init()....
}

@amortemousque
Copy link
Contributor

Hello @grzegorzwziatek-flyr,
Thanks for the info. To better assist you, so you can provide more information like your backend configuration and maybe an access to replicate the issue, I suggest to reach out to Datadog Support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants