-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9bd1fe
commit 688b608
Showing
8 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
use vector_lib::configurable::configurable_component; | ||
|
||
use crate::{ | ||
codecs::{EncodingConfigWithFraming, Transformer}, | ||
config::{AcknowledgementsConfig, GenerateConfig, Input, SinkConfig, SinkContext}, | ||
http::Auth as HttpAuthConfig, | ||
sinks::{ | ||
http::config::{HttpMethod, HttpSinkConfig}, | ||
util::{ | ||
http::RequestConfig, BatchConfig, Compression, RealtimeSizeBasedDefaultBatchSettings, | ||
}, | ||
Healthcheck, VectorSink, | ||
}, | ||
tls::TlsConfig, | ||
}; | ||
|
||
/// Configuration for the `openobserve` sink. | ||
#[configurable_component(sink("openobserve", "Deliver log events to OpenObserve."))] | ||
#[derive(Clone, Debug)] | ||
pub struct OpenObserveConfig { | ||
/// Wrap the HTTP sink configuration. | ||
pub http: HttpSinkConfig, | ||
} | ||
|
||
#[async_trait::async_trait] | ||
#[typetag::serde(name = "openobserve")] | ||
impl SinkConfig for OpenObserveConfig { | ||
async fn build(&self, cx: SinkContext) -> crate::Result<(VectorSink, Healthcheck)> { | ||
let http = self.http.clone(); | ||
let sink = HttpSink::new(http, cx)?; | ||
Ok((sink, sink.healthcheck())) | ||
} | ||
|
||
fn input_type(&self) -> DataType { | ||
DataType::Log | ||
} | ||
|
||
fn sink_type(&self) -> &'static str { | ||
"openobserve" | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod test { | ||
#[test] | ||
fn generate_config() { | ||
crate::test_util::test_generate_config::<super::OpenObserveConfig>(); | ||
} | ||
} | ||
|
||
#[cfg(feature = "openobserve-integration-tests")] | ||
#[cfg(test)] | ||
mod integration_tests {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters