Trait vector::config::SourceConfig

source ·
pub trait SourceConfig:
    DynClone
    + NamedComponent
    + Debug
    + Send
    + Sync
    + Serialize
    + Deserialize {
    // Required methods
    fn build<'life0, 'async_trait>(
        &'life0 self,
        cx: SourceContext,
    ) -> Pin<Box<dyn Future<Output = Result<Source>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn outputs(&self, global_log_namespace: LogNamespace) -> Vec<SourceOutput>;
    fn can_acknowledge(&self) -> bool;

    // Provided method
    fn resources(&self) -> Vec<Resource> { ... }
}
Expand description

Generalized interface for describing and building source components.

Required Methods§

source

fn build<'life0, 'async_trait>( &'life0 self, cx: SourceContext, ) -> Pin<Box<dyn Future<Output = Result<Source>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Builds the source with the given context.

If the source is built successfully, Ok(...) is returned containing the source.

§Errors

If an error occurs while building the source, an error variant explaining the issue is returned.

source

fn outputs(&self, global_log_namespace: LogNamespace) -> Vec<SourceOutput>

Gets the list of outputs exposed by this source.

source

fn can_acknowledge(&self) -> bool

Whether or not this source can acknowledge the events it emits.

Generally, Vector uses acknowledgements to track when an event has finally been processed, either successfully or unsuccessfully. While it is used internally in some areas, such as within disk buffers for knowing when a message can be deleted from the buffer, it is primarily used to signal back to a source that a message has been successfully (durably) processed or not.

By exposing whether or not a source supports acknowledgements, we can avoid situations where using acknowledgements would only add processing overhead for no benefit to the source, as well as emit contextual warnings when end-to-end acknowledgements are enabled, but the topology as configured does not actually support the use of end-to-end acknowledgements.

Provided Methods§

source

fn resources(&self) -> Vec<Resource>

Gets the list of resources, if any, used by this source.

Resources represent dependencies – network ports, file descriptors, and so on – that cannot be shared between components at runtime. This ensures that components can not be configured in a way that would deadlock the spawning of a topology, and as well, allows Vector to determine the correct order for rebuilding a topology during configuration reload when resources must first be reclaimed before being reassigned, and so on.

Trait Implementations§

source§

impl<'typetag> Serialize for dyn SourceConfig + 'typetag

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'typetag> Serialize for dyn SourceConfig + Send + 'typetag

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'typetag> Serialize for dyn SourceConfig + Send + Sync + 'typetag

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'typetag> Serialize for dyn SourceConfig + Sync + 'typetag

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Implementors§

source§

impl SourceConfig for StatsdConfig

source§

impl SourceConfig for AmqpSourceConfig

source§

impl SourceConfig for ApacheMetricsConfig

source§

impl SourceConfig for AwsEcsMetricsSourceConfig

source§

impl SourceConfig for AwsKinesisFirehoseConfig

source§

impl SourceConfig for AwsS3Config

source§

impl SourceConfig for AwsSqsConfig

source§

impl SourceConfig for DatadogAgentConfig

source§

impl SourceConfig for DemoLogsConfig

source§

impl SourceConfig for DnstapConfig

source§

impl SourceConfig for DockerLogsConfig

source§

impl SourceConfig for EventStoreDbConfig

source§

impl SourceConfig for ExecConfig

source§

impl SourceConfig for FileConfig

source§

impl SourceConfig for FileDescriptorSourceConfig

source§

impl SourceConfig for StdinConfig

source§

impl SourceConfig for FluentConfig

source§

impl SourceConfig for PubsubConfig

source§

impl SourceConfig for LogplexConfig

source§

impl SourceConfig for HostMetricsConfig

source§

impl SourceConfig for HttpClientConfig

source§

impl SourceConfig for HttpConfig

source§

impl SourceConfig for SimpleHttpConfig

source§

impl SourceConfig for InternalLogsConfig

source§

impl SourceConfig for InternalMetricsConfig

source§

impl SourceConfig for JournaldConfig

source§

impl SourceConfig for KafkaSourceConfig

source§

impl SourceConfig for Config

source§

impl SourceConfig for LogstashConfig

source§

impl SourceConfig for MongoDbMetricsConfig

source§

impl SourceConfig for NatsSourceConfig

source§

impl SourceConfig for NginxMetricsConfig

source§

impl SourceConfig for OpentelemetryConfig

source§

impl SourceConfig for PostgresqlMetricsConfig

source§

impl SourceConfig for PrometheusPushgatewayConfig

source§

impl SourceConfig for PrometheusRemoteWriteConfig

source§

impl SourceConfig for PrometheusScrapeConfig

source§

impl SourceConfig for PulsarSourceConfig

source§

impl SourceConfig for RedisSourceConfig

source§

impl SourceConfig for SocketConfig

source§

impl SourceConfig for SplunkConfig

source§

impl SourceConfig for StaticMetricsConfig

source§

impl SourceConfig for SyslogConfig

source§

impl SourceConfig for VectorConfig

source§

impl SourceConfig for UnitTestSourceConfig

source§

impl SourceConfig for UnitTestStreamSourceConfig