pub struct PrometheusTemplateRenderingService { /* private fields */ }Expand description
Service for rendering Prometheus configuration templates
This service encapsulates the logic for rendering prometheus.yml configuration files. It’s designed to be shared across command handlers and steps that need to prepare Prometheus configuration.
Implementations§
Source§impl PrometheusTemplateRenderingService
impl PrometheusTemplateRenderingService
Sourcepub fn from_paths(
templates_dir: PathBuf,
build_dir: PathBuf,
clock: Arc<dyn Clock>,
) -> Self
pub fn from_paths( templates_dir: PathBuf, build_dir: PathBuf, clock: Arc<dyn Clock>, ) -> Self
Build a PrometheusTemplateRenderingService from environment paths
§Arguments
templates_dir- Directory containing the source templatesbuild_dir- Directory where rendered templates will be writtenclock- The clock for generating timestamps
§Returns
Returns a configured PrometheusTemplateRenderingService ready for template rendering
Sourcepub fn render(
&self,
prometheus_config: Option<&PrometheusConfig>,
tracker_config: &TrackerConfig,
) -> Result<Option<PathBuf>, PrometheusTemplateRenderingServiceError>
pub fn render( &self, prometheus_config: Option<&PrometheusConfig>, tracker_config: &TrackerConfig, ) -> Result<Option<PathBuf>, PrometheusTemplateRenderingServiceError>
Render Prometheus configuration templates
This renders the prometheus.yml configuration file to the build directory.
Returns None if Prometheus is not configured.
§Arguments
prometheus_config- Prometheus configuration from user inputs (optional)tracker_config- Tracker configuration (needed for API token and port)
§Returns
Returns the path to the rendered Prometheus build directory, or None if not configured
§Errors
Returns PrometheusTemplateRenderingServiceError::RenderingFailed if template rendering fails.
Auto Trait Implementations§
impl !RefUnwindSafe for PrometheusTemplateRenderingService
impl !UnwindSafe for PrometheusTemplateRenderingService
impl Freeze for PrometheusTemplateRenderingService
impl Send for PrometheusTemplateRenderingService
impl Sync for PrometheusTemplateRenderingService
impl Unpin for PrometheusTemplateRenderingService
impl UnsafeUnpin for PrometheusTemplateRenderingService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request