Skip to content

Conversation

dgoffredo
Copy link
Contributor

This is my fiddling with #249.

Flushing the tracer on destruction causes nginx's master process to send a trace within the time the integration test waits for a certain number of traces.

I still haven't figured out how to get the integration tests running on my new machine's Docker setup, so I'll use CI via this pull request instead.

DS-Serafin and others added 4 commits October 6, 2022 09:45
Rational: In short lived applications (e.g. Kubernetes Jobs) most
of the time all traces get lost becasue they are not synced. Users
need to call `Close` manually, but as all spans hold a shared_ptr
on the tracer it is hard to have the correct place to call it.
Calling it in the destructor assures all spans will be included in the
flush.
@DS-Serafin
Copy link

DS-Serafin commented Oct 19, 2022

@dgoffredo If I understand correctly this sems to be a bug in the integration tests?

Edit: Ahh found now the source of the problem in the opentracing_nginx integration. Not sure if I shoudl laugh or cry :D

@dgoffredo
Copy link
Contributor Author

dgoffredo commented Oct 20, 2022

What it comes down to is a matter of policy about whether we want ~Tracer to call Close. It has implications not only for these integration tests (which could be patched), but elsewhere also. A complicating factor is that weird "dummy" span that is used by nginx-opentracing to probe the names of the propagation headers.

I'll revisit this next week to present our options.

@DS-Serafin
Copy link

@dgoffredo ANy news

I understrand this changes behaviour. But only were it was undefined before. The dummy span could also before already be sent to agent. It was just very unlikely. Now the behaviour is defined and I think it is therefore an improvment. I think no new behaviour was introduced it was made only reliable.

@dgoffredo
Copy link
Contributor Author

@DS-Serafin I'm closing this PR as I'm no longer a maintainer of Datadog software and there are now newer alternatives that are supported (dd-trace-cpp, nginx-datadog). Please direct any further questions to @dmehala.

@dgoffredo dgoffredo closed this Mar 25, 2025
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

Successfully merging this pull request may close these issues.

2 participants