Skip to content

Commit

Permalink
feat(core): add mongodb-specific "db.collection.name" and "db.operati…
Browse files Browse the repository at this point in the history
…on.name" attributes in spans
  • Loading branch information
jkomyno committed Oct 18, 2024
1 parent 001a865 commit 5ef57fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ where
user_facing = true,
"db.system" = SYSTEM_NAME,
"db.statement" = %Arc::clone(&query_string),
"db.collection.name" = %builder.collection().unwrap_or_else(|| "raw"),

Check failure on line 76 in query-engine/connectors/mongodb-query-connector/src/root_queries/mod.rs

View workflow job for this annotation

GitHub Actions / clippy linting

unnecessary closure used to substitute value for `Option::None`
"db.operation.name" = builder.query_type(),
"otel.kind" = "client"
);

Expand Down
9 changes: 8 additions & 1 deletion query-engine/core/src/telemetry/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ use std::{
time::{Duration, SystemTime},
};

const ACCEPT_ATTRIBUTES: &[&str] = &["db.system", "db.statement", "itx_id", "otel.kind"];
const ACCEPT_ATTRIBUTES: &[&str] = &[
"db.system",
"db.statement",
"db.collection.name",
"db.operation.name",
"itx_id",
"otel.kind",
];

#[derive(Serialize, Debug, Clone, PartialEq, Eq)]
pub enum OtelKind {
Expand Down

0 comments on commit 5ef57fc

Please sign in to comment.