use crate::{trace::Tracer, InstrumentationLibrary, KeyValue};
use std::{borrow::Cow, sync::Arc};
pub trait TracerProvider {
type Tracer: Tracer;
fn tracer(&self, name: impl Into<Cow<'static, str>>) -> Self::Tracer {
self.versioned_tracer(
name,
None::<Cow<'static, str>>,
None::<Cow<'static, str>>,
None,
)
}
fn versioned_tracer(
&self,
name: impl Into<Cow<'static, str>>,
version: Option<impl Into<Cow<'static, str>>>,
schema_url: Option<impl Into<Cow<'static, str>>>,
attributes: Option<Vec<KeyValue>>,
) -> Self::Tracer {
self.library_tracer(Arc::new(InstrumentationLibrary::new(
name, version, schema_url, attributes,
)))
}
fn library_tracer(&self, library: Arc<InstrumentationLibrary>) -> Self::Tracer;
}