Skip to content

Commit

Permalink
feature to support OpenTelemetry logs to be ingested on Parseable
Browse files Browse the repository at this point in the history
fixes: #312
  • Loading branch information
nikhilsinhaparseable committed Feb 13, 2024
1 parent fb3fd21 commit af2e2d9
Show file tree
Hide file tree
Showing 13 changed files with 1,234 additions and 9 deletions.
169 changes: 162 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ http-auth-basic = "0.3.3"
serde_repr = "0.1.17"
hashlru = { version = "0.11.0", features = ["serde"] }
path-clean = "1.0.1"
prost = "0.12.3"


[build-dependencies]
cargo_toml = "0.15"
Expand All @@ -112,6 +114,7 @@ ureq = "2.6"
vergen = { version = "8.1", features = ["build", "git", "cargo", "gitcl"] }
zip = { version = "0.6", default_features = false, features = ["deflate"] }
url = "2.4.0"
prost-build = "0.12.3"

[dev-dependencies]
maplit = "1.0"
Expand Down
1 change: 1 addition & 0 deletions server/src/handlers/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ mod llm;
mod logstream;
mod middleware;
mod oidc;
mod otel;
mod query;
mod rbac;
mod role;
Expand Down
4 changes: 2 additions & 2 deletions server/src/handlers/http/ingest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ use crate::handlers::{
use crate::metadata::STREAM_INFO;
use crate::utils::header_parsing::{collect_labelled_headers, ParseHeaderError};

use super::kinesis;
use super::logstream::error::CreateStreamError;
use super::{kinesis, otel};

// Handler for POST /api/v1/ingest
// ingests events by extracting stream name from header
Expand Down Expand Up @@ -67,7 +67,7 @@ async fn flatten_and_push_logs(
let log_source: String = log_source.to_str().unwrap().to_owned();
match log_source.as_str() {
LOG_SOURCE_KINESIS => json = kinesis::flatten_kinesis_logs(&body),
LOG_SOURCE_OTEL => {}
LOG_SOURCE_OTEL => json = otel::flatten_otel_logs(&body),
_ => {
log::warn!("Unknown log source: {}", log_source);
push_logs(stream_name.to_string(), req.clone(), body).await?;
Expand Down
Loading

0 comments on commit af2e2d9

Please sign in to comment.