Struct poem::endpoint::PrometheusExporter
source · pub struct PrometheusExporter { /* private fields */ }
Available on crate feature
prometheus
only.Expand description
An endpoint that exports metrics for Prometheus.
Example
use libopentelemetry::sdk::{
export::metrics::aggregation,
metrics::{controllers, processors, selectors},
};
use poem::{endpoint::PrometheusExporter, Route};
let controller = controllers::basic(
processors::factory(
selectors::simple::histogram([1.0, 2.0, 5.0, 10.0, 20.0, 50.0]),
aggregation::cumulative_temporality_selector(),
)
.with_memory(true),
)
.build();
let app = Route::new().nest("/metrics", PrometheusExporter::with_controller(controller));
Implementations
sourceimpl PrometheusExporter
impl PrometheusExporter
Trait Implementations
sourceimpl Default for PrometheusExporter
impl Default for PrometheusExporter
sourceimpl IntoEndpoint for PrometheusExporter
impl IntoEndpoint for PrometheusExporter
type Endpoint = PrometheusExporterEndpoint
type Endpoint = PrometheusExporterEndpoint
Represents the endpoint type.
sourcefn into_endpoint(self) -> Self::Endpoint
fn into_endpoint(self) -> Self::Endpoint
Converts this object into endpoint.
Auto Trait Implementations
impl !RefUnwindSafe for PrometheusExporter
impl Send for PrometheusExporter
impl Sync for PrometheusExporter
impl Unpin for PrometheusExporter
impl !UnwindSafe for PrometheusExporter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more