pub struct RenderPrometheusTemplatesStep<S> { /* private fields */ }Expand description
Step that renders Prometheus templates to the build directory
This step handles the preparation of Prometheus configuration files by rendering templates to the build directory. The rendered files are then ready to be deployed to the remote host.
Implementations§
Source§impl<S> RenderPrometheusTemplatesStep<S>
impl<S> RenderPrometheusTemplatesStep<S>
Sourcepub fn new(
environment: Arc<Environment<S>>,
templates_dir: PathBuf,
build_dir: PathBuf,
clock: Arc<dyn Clock>,
) -> Self
pub fn new( environment: Arc<Environment<S>>, templates_dir: PathBuf, build_dir: PathBuf, clock: Arc<dyn Clock>, ) -> Self
Creates a new RenderPrometheusTemplatesStep
§Arguments
environment- The deployment environmenttemplates_dir- The templates directorybuild_dir- The build directory where templates will be renderedclock- Clock service for generating timestamps
Sourcepub fn execute(
&self,
) -> Result<Option<PathBuf>, PrometheusTemplateRenderingServiceError>
pub fn execute( &self, ) -> Result<Option<PathBuf>, PrometheusTemplateRenderingServiceError>
Execute the template rendering step
This will render Prometheus templates to the build directory if Prometheus configuration is present in the environment.
§Returns
Returns the path to the Prometheus build directory on success, or None
if Prometheus is not configured.
§Errors
Returns an error if:
- Template rendering fails
- Directory creation fails
- File writing fails
Auto Trait Implementations§
impl<S> !RefUnwindSafe for RenderPrometheusTemplatesStep<S>
impl<S> !UnwindSafe for RenderPrometheusTemplatesStep<S>
impl<S> Freeze for RenderPrometheusTemplatesStep<S>
impl<S> Send for RenderPrometheusTemplatesStep<S>
impl<S> Sync for RenderPrometheusTemplatesStep<S>
impl<S> Unpin for RenderPrometheusTemplatesStep<S>
impl<S> UnsafeUnpin for RenderPrometheusTemplatesStep<S>
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