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

ZipkinExporter shutdown #1153

Merged
merged 1 commit into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ class ZipkinExporter final : public opentelemetry::sdk::trace::SpanExporter
* @param timeout an optional timeout, default to max.
*/
bool Shutdown(
std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override
{
return true;
}
std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override;

private:
void InitializeLocalEndpoint();
Expand Down
6 changes: 6 additions & 0 deletions exporters/zipkin/src/zipkin_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ void ZipkinExporter::InitializeLocalEndpoint()
local_end_point_["port"] = url_parser_.port_;
}

bool ZipkinExporter::Shutdown(std::chrono::microseconds timeout) noexcept
{
isShutdown_ = true;
Copy link
Member

@lalitb lalitb Dec 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to PR, but probably we need to discuss if this should be an atomic operation to protect against Shutdown() and Export() called from separate threads. While specs don't allow Export() to be called concurrently ( https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#exportbatch ), it doesn't talk about Export() and Shutdown().

This is valid to all exporters, and not blocking this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree it should be protected somehow.

return true;
}

} // namespace zipkin
} // namespace exporter
OPENTELEMETRY_END_NAMESPACE