tvl-depot/tvix/store/src
Simon Hauser fa7ed39bf4 feat(tvix/tracing): correctly close otlp on exit
Provide a new interface for forcing a flush of otlp traces and use this
interface to shutdown otlp prior to exiting tvix-store, either if the
tool was stopped with a SIGTERM or ended regularly.
This also fixes an issue where traces were not even exported if for
example we just imported 10 paths and never even emitted more than 256
traces. The implementation uses a mpsc channel so a flush can be done
without having to wait for it to complete. If you want to wait for a
flush to complete you can provide a oneshot channel which will receive a
message once flushing is complete.

Because of a otlp bug `force_flush` as well as
`shutdown_tracer_provider` need to be executed using `spawn_blocking`
otherwise the function will deadlock. See
https://github.com/open-telemetry/opentelemetry-rust/issues/1395#issuecomment-1953280335

Change-Id: I0a828391adfb1f72dc8305f62ced8cba0515847c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11803
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Autosubmit: Simon Hauser <simon.hauser@helsinki-systems.de>
2024-06-14 09:34:51 +00:00
..
bin feat(tvix/tracing): correctly close otlp on exit 2024-06-14 09:34:51 +00:00
nar refactor(tvix/store/nar/import): add ingest_nar_and_hash 2024-06-11 22:47:31 +00:00
pathinfoservice refactor(tvix/store/nar/import): add ingest_nar_and_hash 2024-06-11 22:47:31 +00:00
proto refactor(tvix/store): drop calculate_nar from PathInfoService 2024-05-11 13:33:59 +00:00
tests chore(tvix/store): migrate import.rs and tests/pathinfo.rs to rstest 2024-04-19 19:22:10 +00:00
import.rs refactor(tvix/store): drop calculate_nar from PathInfoService 2024-05-11 13:33:59 +00:00
lib.rs feat(tvix/store): add rstest-based PathInfoService tests 2024-03-28 07:02:18 +00:00
utils.rs refactor(tvix/store): drop calculate_nar from PathInfoService 2024-05-11 13:33:59 +00:00