sample code of Sinatra integration does not work with classic style application #1935
Labels
bug
Involves a bug
community
Was opened by a community member
integrations
Involves tracing integrations
I found sample code of Sinatra integration does not work if application is classic style.
I mean This sample code has a problem.
Sinatra classic style application start in at_exit
https://github.com/sinatra/sinatra/blob/2b5d1b45097f67c06a2345f0d8c30db2b38030bf/lib/sinatra/main.rb#L45
and
Datadog::Writer.stop_worker
method is called in at_exithttps://github.com/DataDog/dd-trace-rb/blob/v0.54.2/lib/ddtrace/writer.rb#L97
So current sample code means following execution order
(at_exit handlers are executed in reverser order of registration https://ruby-doc.org/core-3.1.1/Kernel.html#method-i-at_exit)
https://gist.github.com/okazu-dm/480f6188d2be7573b07c364cfac14194
The text was updated successfully, but these errors were encountered: