Skip to content

Commit

Permalink
updated CI and minor progress
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhatsharma committed Oct 20, 2024
1 parent e9bd1fe commit 688b608
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ on:
value: ${{ jobs.int_tests.outputs.nginx }}
opentelemetry:
value: ${{ jobs.int_tests.outputs.opentelemetry }}
openobserve:
value: ${{ jobs.int_tests.outputs.openobserve }}
postgres:
value: ${{ jobs.int_tests.outputs.postgres }}
prometheus:
Expand Down Expand Up @@ -230,6 +232,7 @@ jobs:
nats: ${{ steps.filter.outputs.nats }}
nginx: ${{ steps.filter.outputs.nginx }}
opentelemetry: ${{ steps.filter.outputs.opentelemetry }}
openobserve: ${{ steps.filter.outputs.openobserve }}
postgres: ${{ steps.filter.outputs.postgres }}
prometheus: ${{ steps.filter.outputs.prometheus }}
pulsar: ${{ steps.filter.outputs.pulsar }}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/ci-integration-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,16 @@ jobs:
timeout_minutes: 30
max_attempts: 3
command: bash scripts/ci-int-e2e-test.sh int opentelemetry

- name: openobserve
if: ${{ startsWith(github.event.review.body, '/ci-run-integration-openobserve')
|| startsWith(github.event.review.body, '/ci-run-integration-all')
|| startsWith(github.event.review.body, '/ci-run-all') }}
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: bash scripts/ci-int-e2e-test.sh int openobserve

- name: postgres
if: ${{ startsWith(github.event.review.body, '/ci-run-integration-postgres')
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
|| needs.changes.outputs.nats == 'true'
|| needs.changes.outputs.nginx == 'true'
|| needs.changes.outputs.opentelemetry == 'true'
|| needs.changes.outputs.openobserve == 'true'
|| needs.changes.outputs.postgres == 'true'
|| needs.changes.outputs.prometheus == 'true'
|| needs.changes.outputs.pulsar == 'true'
Expand Down Expand Up @@ -354,6 +355,15 @@ jobs:
timeout_minutes: 30
max_attempts: 3
command: bash scripts/ci-int-e2e-test.sh int opentelemetry

- if: (github.event_name == 'merge_group' || needs.changes.outputs.all-int == 'true' || needs.changes.outputs.openobserve == 'true') &&
(github.event_name != 'pull_request' || env.PR_HAS_ACCESS_TO_SECRETS == 'true')
name: openobserve
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3
command: bash scripts/ci-int-e2e-test.sh int openobserve

- if: ${{ github.event_name == 'merge_group' || needs.changes.outputs.all-int == 'true' || needs.changes.outputs.postgres == 'true' }}
name: postgres
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ sinks-mqtt = ["dep:rumqttc"]
sinks-nats = ["dep:async-nats", "dep:nkeys"]
sinks-new_relic_logs = ["sinks-http"]
sinks-new_relic = []
sinks-openobserve = ["sinks-http"]
sinks-papertrail = ["dep:syslog"]
sinks-prometheus = ["dep:base64", "dep:prost", "vector-lib/prometheus"]
sinks-pulsar = ["dep:apache-avro", "dep:pulsar", "dep:lru"]
Expand Down Expand Up @@ -821,6 +822,7 @@ all-integration-tests = [
"nats-integration-tests",
"nginx-integration-tests",
"opentelemetry-integration-tests",
"openobserve-integration-tests",
"postgresql_metrics-integration-tests",
"prometheus-integration-tests",
"pulsar-integration-tests",
Expand Down Expand Up @@ -885,6 +887,7 @@ mqtt-integration-tests = ["sinks-mqtt"]
nats-integration-tests = ["sinks-nats", "sources-nats"]
nginx-integration-tests = ["sources-nginx_metrics"]
opentelemetry-integration-tests = ["sources-opentelemetry", "dep:prost"]
openobserve-integration-tests = ["sinks-openobserve"]
postgresql_metrics-integration-tests = ["sources-postgresql_metrics"]
prometheus-integration-tests = ["sinks-prometheus", "sources-prometheus", "sinks-influxdb"]
pulsar-integration-tests = ["sinks-pulsar", "sources-pulsar"]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ test-integration: ## Runs all integration tests
test-integration: test-integration-amqp test-integration-appsignal test-integration-aws test-integration-axiom test-integration-azure test-integration-chronicle test-integration-clickhouse
test-integration: test-integration-databend test-integration-docker-logs test-integration-elasticsearch
test-integration: test-integration-eventstoredb test-integration-fluent test-integration-gcp test-integration-greptimedb test-integration-humio test-integration-http-client test-integration-influxdb
test-integration: test-integration-kafka test-integration-logstash test-integration-loki test-integration-mongodb test-integration-nats
test-integration: test-integration-kafka test-integration-logstash test-integration-loki test-integration-mongodb test-integration-nats test-integration-openobserve
test-integration: test-integration-nginx test-integration-opentelemetry test-integration-postgres test-integration-prometheus test-integration-pulsar
test-integration: test-integration-redis test-integration-splunk test-integration-dnstap test-integration-datadog-agent test-integration-datadog-logs test-integration-e2e-datadog-logs
test-integration: test-integration-datadog-traces test-integration-shutdown
Expand Down
2 changes: 2 additions & 0 deletions src/sinks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ pub mod mqtt;
pub mod nats;
#[cfg(feature = "sinks-new_relic")]
pub mod new_relic;
#[cfg(feature = "sinks-openobserve")]
pub mod openobserve;
#[cfg(feature = "sinks-webhdfs")]
pub mod opendal_common;
#[cfg(feature = "sinks-papertrail")]
Expand Down
53 changes: 53 additions & 0 deletions src/sinks/openobserve.rs
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 {}
1 change: 1 addition & 0 deletions website/data/redirects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ sinks:
- nats
- new_relic_logs
- new_relic
- openobserve
- papertrail
- prometheus_exporter
- prometheus_remote_write
Expand Down

0 comments on commit 688b608

Please sign in to comment.