Put back in needed pubs.

This commit is contained in:
Tom Alexander
2023-09-11 13:13:28 -04:00
parent 7650a9edff
commit 84953c1669
71 changed files with 522 additions and 515 deletions

View File

@@ -10,7 +10,7 @@ const SERVICE_NAME: &'static str = "organic";
// Despite the obvious verbosity that fully-qualifying everything causes, in these functions I am fully-qualifying everything relating to tracing. This is because the tracing feature involves multiple libraries working together and so I think it is beneficial to see which libraries contribute which bits.
#[cfg(feature = "tracing")]
fn init_telemetry() -> Result<(), Box<dyn std::error::Error>> {
pub(crate) fn init_telemetry() -> Result<(), Box<dyn std::error::Error>> {
// by default it will hit http://localhost:4317 with a gRPC payload
// TODO: I think the endpoint can be controlled by the OTEL_EXPORTER_OTLP_TRACES_ENDPOINT env variable instead of hard-coded into this code base. Regardless, I am the only developer right now so I am not too concerned.
let exporter = opentelemetry_otlp::new_exporter()
@@ -55,17 +55,17 @@ const SERVICE_NAME: &'static str = "organic";
}
#[cfg(feature = "tracing")]
fn shutdown_telemetry() -> Result<(), Box<dyn std::error::Error>> {
pub(crate) fn shutdown_telemetry() -> Result<(), Box<dyn std::error::Error>> {
opentelemetry::global::shutdown_tracer_provider();
Ok(())
}
#[cfg(not(feature = "tracing"))]
fn init_telemetry() -> Result<(), Box<dyn std::error::Error>> {
pub(crate) fn init_telemetry() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}
#[cfg(not(feature = "tracing"))]
fn shutdown_telemetry() -> Result<(), Box<dyn std::error::Error>> {
pub(crate) fn shutdown_telemetry() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}