Skip to content

Commit

Permalink
chore(core): review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jkomyno committed Oct 18, 2024
1 parent 5ef57fc commit 0923231
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion quaint/src/connector/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ where
U: Future<Output = crate::Result<T>>,
{
let span =
info_span!("quaint:query", "db.system" = %db_system_name, "db.statement" = %query, "otel.kind" = "client");
info_span!("quaint:query", "db.system" = db_system_name, "db.statement" = %query, "otel.kind" = "client");
do_query(tag, query, params, f).instrument(span).await
}

Expand Down
10 changes: 5 additions & 5 deletions query-engine/core/src/telemetry/models.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use opentelemetry::{sdk::export::trace::SpanData, Key, KeyValue, Value};
use opentelemetry::{sdk::export::trace::SpanData, KeyValue, Value};
use serde::Serialize;
use serde_json::json;
use std::{
Expand Down Expand Up @@ -38,7 +38,7 @@ pub struct TraceSpan {
pub(super) events: Vec<Event>,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub(super) links: Vec<Link>,
pub(super) otel_kind: OtelKind,
pub(super) kind: OtelKind,
}

#[derive(Serialize, Debug, Clone, PartialEq, Eq)]
Expand All @@ -55,8 +55,8 @@ impl TraceSpan {

impl From<SpanData> for TraceSpan {
fn from(span: SpanData) -> Self {
let otel_kind = match span.attributes.get(&Key::from_static_str("otel.kind")) {
Some(Value::String(Cow::Borrowed("client"))) => OtelKind::Client,
let kind = match span.span_kind {
opentelemetry::trace::SpanKind::Client => OtelKind::Client,
_ => OtelKind::Internal,
};

Expand Down Expand Up @@ -126,7 +126,7 @@ impl From<SpanData> for TraceSpan {
attributes,
links,
events,
otel_kind,
kind,
}
}
}
Expand Down

0 comments on commit 0923231

Please sign in to comment.