opencensus-cpp icon indicating copy to clipboard operation
opencensus-cpp copied to clipboard

What is the recommended way to gracefully shutdown?

Open coryan opened this issue 7 years ago • 6 comments

Is there a recommended way to terminate short lived programs? I am thinking of examples, tests, or batch processes that may have completed their work but want to give OpenCensus time to complete its work before shutting down.

coryan avatar Oct 14 '18 14:10 coryan

Currently we sleep to let the stats aggregation and exporting happen, which isn't ideal.

g-easy avatar Oct 16 '18 09:10 g-easy

That is what I thought. No rush, but any plans to have something better?

coryan avatar Oct 16 '18 13:10 coryan

I've been thinking about it but I don't have a good proposal yet.

Related discussions:

  • https://github.com/census-instrumentation/opencensus-specs/issues/152 for flushing stats
  • https://github.com/census-instrumentation/opencensus-specs/issues/126 for flushing traces

g-easy avatar Oct 17 '18 02:10 g-easy

Have there been any progress on adding a flush capability? I ran into this problem today and had to add a wait to the end of my program (which is short lived).

Dig-Doug avatar Aug 02 '20 18:08 Dig-Doug

I'm afraid not. I'm very limited in how much time I can spend on OpenCensus. Check out https://github.com/open-telemetry/opentelemetry-cpp/

g-easy avatar Aug 04 '20 04:08 g-easy

No problem, it looks like this is the relevant feature on the opentelemetry side. I look forward to migrating once everything is ready :)

Dig-Doug avatar Aug 04 '20 12:08 Dig-Doug