Skip to content

Commit 73e13fe

Browse files
Fix merge conflicts errors
1 parent ed981e1 commit 73e13fe

File tree

4 files changed

+5
-52
lines changed

4 files changed

+5
-52
lines changed

data-pipeline/src/stats_exporter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ fn encode_bucket(key: BucketKey, bucket: Bucket) -> pb::ClientGroupedStats {
229229
span_kind: String::new(),
230230
db_type: String::new(),
231231
peer_tags: Vec::new(),
232-
is_trace_root: false,
232+
is_trace_root: pb::Trilean::False.into(),
233233
}
234234
}
235235

ddcommon/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ pub mod header {
2424
pub const DATADOG_CONTAINER_ID: HeaderName = HeaderName::from_static("datadog-container-id");
2525
pub const DATADOG_ENTITY_ID: HeaderName = HeaderName::from_static("datadog-entity-id");
2626
pub const DATADOG_TRACE_COUNT: HeaderName = HeaderName::from_static("x-datadog-trace-count");
27-
2827
pub const DATADOG_API_KEY: HeaderName = HeaderName::from_static("dd-api-key");
28+
2929
pub const APPLICATION_JSON: HeaderValue = HeaderValue::from_static("application/json");
3030
pub const APPLICATION_MSGPACK: HeaderValue = HeaderValue::from_static("application/msgpack");
3131
}

ddcommon/src/tag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl Tag {
132132
}
133133

134134
pub fn into_string(self) -> String {
135-
self.value
135+
self.value.to_string()
136136
}
137137
}
138138

trace-normalization/src/normalizer.rs

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30,57 +30,10 @@ fn normalize_span(s: &mut pb::Span) -> anyhow::Result<()> {
3030
normalize_utils::normalize_span_start_duration(&mut s.start, &mut s.duration);
3131
normalize_utils::normalize_span_type(&mut s.r#type);
3232

33-
s.name = normalized_name;
34-
35-
if s.resource.is_empty() {
36-
s.resource.clone_from(&s.name)
37-
}
38-
39-
// ParentID, TraceID and SpanID set in the client could be the same
40-
// Supporting the ParentID == TraceID == SpanID for the root span, is compliant
41-
// with the Zipkin implementation. Furthermore, as described in the PR
42-
// https://github.com/openzipkin/zipkin/pull/851 the constraint that the
43-
// root span's ``trace id = span id`` has been removed
44-
if s.parent_id == s.trace_id && s.parent_id == s.span_id {
45-
s.parent_id = 0;
46-
}
47-
48-
// Start & Duration as nanoseconds timestamps
49-
// if s.Start is very little, less than year 2000 probably a unit issue so discard
50-
if s.duration < 0 {
51-
s.duration = 0;
52-
}
53-
if s.duration > i64::MAX - s.start {
54-
s.duration = 0;
55-
}
56-
if s.start < YEAR_2000_NANOSEC_TS {
57-
let now = match SystemTime::now()
58-
.duration_since(SystemTime::UNIX_EPOCH)
59-
.map(|t| t.as_nanos() as i64)
60-
{
61-
Ok(time) => time,
62-
Err(err) => {
63-
anyhow::bail!(format!("Normalizer Error: {err}"))
64-
}
65-
};
66-
s.start = now - s.duration;
67-
if s.start < 0 {
68-
s.start = now;
69-
}
70-
}
71-
72-
if s.r#type.len() > MAX_TYPE_LEN {
73-
s.r#type = normalize_utils::truncate_utf8(&s.r#type, MAX_TYPE_LEN).to_string();
33+
if let Some(env_tag) = s.meta.get_mut("env") {
34+
normalize_utils::normalize_tag(env_tag);
7435
}
7536

76-
if s.meta.contains_key("env") {
77-
if let Some(env_tag) = s.meta.get("env") {
78-
if let Ok(normalized_tag) = normalize_utils::normalize_tag(env_tag) {
79-
s.meta.insert("env".to_string(), normalized_tag);
80-
}
81-
}
82-
};
83-
8437
if let Some(code) = s.meta.get("http.status_code") {
8538
if !is_valid_status_code(code) {
8639
s.meta.remove("http.status_code");

0 commit comments

Comments
 (0)