Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use logforth to replace fern #16249

Merged
merged 6 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
429 changes: 265 additions & 164 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -324,19 +324,19 @@ walkdir = "2.3.2"
xorfilter-rs = "0.5"

# Observability
fastrace = { version = "0.6", features = ["enable"] }
fastrace-opentelemetry = "0.6"
fastrace = { version = "0.7", features = ["enable"] }
fastrace-opentelemetry = "0.7"
log = { version = "0.4.21", features = ["serde", "kv_unstable_std"] }
logcall = "0.1.9"
opentelemetry = { version = "0.23", features = ["trace", "logs"] }
opentelemetry-otlp = { version = "0.16", features = [
opentelemetry = { version = "0.24", features = ["trace", "logs"] }
opentelemetry-otlp = { version = "0.17", features = [
"trace",
"logs",
"grpc-tonic",
"http-proto",
"reqwest-client",
] }
opentelemetry_sdk = { version = "0.23", features = ["trace", "logs", "rt-tokio"] }
opentelemetry_sdk = { version = "0.24", features = ["trace", "logs", "rt-tokio"] }
tracing = "0.1.40"
tracing-appender = "0.2.3"
tracing-subscriber = { version = "0.3.17", features = ["env-filter", "json", "valuable"] }
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/deploy/config/databend-query-node-otlp-logs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ dir = "./.databend/logs_1"

[log.query]
on = true
otlp_endpoint = "http://127.0.0.1:4317"
otlp_endpoint = "http://127.0.0.1:4317/v1/logs"
[log.query.otlp_labels]
qkey1 = "qvalue1"
qkey2 = "qvalue2"

[log.profile]
on = true
otlp_endpoint = "http://127.0.0.1:4318"
otlp_endpoint = "http://127.0.0.1:4318/v1/logs"
otlp_protocol = "http"
[log.profile.otlp_labels]
pkey1 = "pvalue1"
Expand Down
9 changes: 6 additions & 3 deletions src/common/tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ databend-common-exception = { workspace = true }
defer = "0.2"
fastrace = { workspace = true }
fastrace-opentelemetry = { workspace = true }
fern = "0.6.2"
itertools = { workspace = true }
libc = "0.2.153"
log = { workspace = true }
logforth = { version = "0.11", git = "http://github.com/andylokandy/logforth", rev = "0ca61ca", features = [
'json',
'rolling_file',
'opentelemetry',
'fastrace',
] }
opentelemetry = { workspace = true }
opentelemetry-otlp = { workspace = true }
opentelemetry_sdk = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
strip-ansi-escapes = "0.2"
tonic = { workspace = true }
tracing-appender = { workspace = true }

[dev-dependencies]

Expand Down
13 changes: 12 additions & 1 deletion src/common/tracing/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl Default for TracingConfig {
}
}

#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OTLPProtocol {
Http,
Grpc,
Expand Down Expand Up @@ -292,6 +292,17 @@ impl<'de> serde::Deserialize<'de> for OTLPProtocol {
}
}

impl From<OTLPProtocol> for logforth::append::opentelemetry::OpentelemetryWireProtocol {
fn from(protocol: OTLPProtocol) -> Self {
match protocol {
OTLPProtocol::Http => {
logforth::append::opentelemetry::OpentelemetryWireProtocol::HttpBinary
}
OTLPProtocol::Grpc => logforth::append::opentelemetry::OpentelemetryWireProtocol::Grpc,
}
}
}

#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize)]
pub struct OTLPEndpointConfig {
pub endpoint: String,
Expand Down
Loading
Loading