Skip to content

Commit c167cab

Browse files
committed
Use constant for inflight link attribute
1 parent 58ed17b commit c167cab

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

lib/internal/src/telemetry/traces/spans/attributes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub const HIVE_ERROR_PATH: &str = "hive.error.path";
4343
/// Internal Hive attributes
4444
pub const HIVE_INFLIGHT_ROLE: &str = "hive.inflight.role";
4545
pub const HIVE_INFLIGHT_KEY: &str = "hive.inflight.key";
46+
pub const HIVE_INFLIGHT_LINK_RELATIONSHIP: &str = "hive.inflight.relationship";
4647

4748
/// Generic/Common attributes
4849
pub const CACHE_HIT: &str = "cache.hit";

lib/internal/src/telemetry/traces/spans/http_request.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ use tracing_opentelemetry::OpenTelemetrySpanExt;
1313

1414
use crate::telemetry::traces::{
1515
disabled_span, is_tracing_enabled,
16-
spans::{attributes, kind::HiveSpanKind, TARGET_NAME},
16+
spans::{
17+
attributes::{self, HIVE_INFLIGHT_LINK_RELATIONSHIP},
18+
kind::HiveSpanKind,
19+
TARGET_NAME,
20+
},
1721
};
1822

1923
pub struct HttpServerRequestSpan {
@@ -306,10 +310,10 @@ impl HttpInflightRequestSpan {
306310

307311
self.span.add_link_with_attributes(
308312
leader_span_context.clone(),
309-
vec![
310-
KeyValue::new("link.type", "deduplication.waits_for"),
311-
KeyValue::new("hive.inflight.relationship", "joiner_to_leader"),
312-
],
313+
vec![KeyValue::new(
314+
HIVE_INFLIGHT_LINK_RELATIONSHIP,
315+
"joiner_to_leader",
316+
)],
313317
);
314318
}
315319

0 commit comments

Comments
 (0)