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 parent ID (all zeros) #1223

Closed
swgoldwood opened this issue Feb 18, 2022 · 8 comments
Closed

Invalid parent ID (all zeros) #1223

swgoldwood opened this issue Feb 18, 2022 · 8 comments

Comments

@swgoldwood
Copy link

Hey, could anyone point me to real world repo using opentelemetry-cpp? I'd like to study code already successfully using it.

I'm struggling to produce usable traces into Jaeger. Each time i create a span and scope, it produces a new trace in Jaeger, so I'm unable to get anything useful other than for a single function runtime. It seems like the way I am using it doesn't handle parents correctly.

The way I'm using it is as follows:

  • there is tracer object created for each user request. This is stored in TLS.
  • i start a span/scope that lives for the duration of the request
  • i create new span and scope using this tracer, for each function I want to measure
  • each span/scope produces just a single trace in Jaeger - pretty useless

I must be doing something wrong!

Thanks!

@lalitb
Copy link
Member

lalitb commented Feb 18, 2022

Example code for parent-child span creation with Jaeger is here. But looks like you are doing steps correctly. Which OS/compiler you are testing with. There are issues with Ubuntu 18.04.5 LTS/ gcc 7.5.0 where TLS is not handled correctly due to a bug in the compiler. More details along with a workaround #1014

@swgoldwood
Copy link
Author

Example code for parent-child span creation with Jaeger is here. But looks like you are doing steps correctly. Which OS/compiler you are testing with. There are issues with Ubuntu 18.04.5 LTS/ gcc 7.5.0 where TLS is not handled correctly due to a bug in the compiler. More details along with a workaround #1014

Thanks. This seems to be the same issue I am having.

I'm using Release built static libs. GCC 6.3 on RHEL6.10. I'll try out the workaround and get back. Thanks a lot for quick reply

@swgoldwood
Copy link
Author

Nope my issue is something else. Very strange. I'm going to look into it more.

@swgoldwood
Copy link
Author

Any ideas what I could do to debug this? My issue is very similar to the issue you linked. Parent id is zero'd out just like that issue.

What line of code populates the parent_id? Debugging the Stack i can see objects getting added appropriately. This seems correct.

Thanks a lot! This library will be awesome when it works!

@lalitb
Copy link
Member

lalitb commented Feb 19, 2022

Parent-id gets populated here.

Meanwhile, if you are able to build sample example, and share the console output after running, it would give some idea.

@swgoldwood swgoldwood changed the title Real world examples? Invalid parent ID (all zeros) Feb 20, 2022
@swgoldwood
Copy link
Author

swgoldwood commented Feb 22, 2022

I finally got this working. I pulled out the StartSpan function in tracer.cc into the header file, and it worked. So I'm just going to use my local revision for time being! The traces look great in Jaeger.

@swgoldwood
Copy link
Author

In case anyone sees this. The fix was likely not my changes in tracer.cc. it was the same issue as here: #1014

@lalitb
Copy link
Member

lalitb commented Mar 10, 2022

In case anyone sees this. The fix was likely not my changes in tracer.cc. it was the same issue as here: #1014

Thanks for confirming.

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