Skip to content

Commit 13e5e37

Browse files
author
Craig Pastro
authored
Remove SpanID from sampling parameters (#124)
1 parent 90413fb commit 13e5e37

File tree

4 files changed

+3
-15
lines changed

4 files changed

+3
-15
lines changed

benches/trace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn criterion_benchmark(c: &mut Criterion) {
6464
});
6565
}
6666

67-
fn trace_benchmark_group<F: Fn(&sdk::Tracer) -> ()>(c: &mut Criterion, name: &str, f: F) {
67+
fn trace_benchmark_group<F: Fn(&sdk::Tracer)>(c: &mut Criterion, name: &str, f: F) {
6868
let mut group = c.benchmark_group(name);
6969

7070
group.bench_function("always-sample", |b| {

src/api/trace/sampler.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ pub trait Sampler: Send + Sync + std::fmt::Debug {
4949
&self,
5050
parent_context: Option<&api::SpanContext>,
5151
trace_id: api::TraceId,
52-
span_id: api::SpanId,
5352
name: &str,
5453
span_kind: &api::SpanKind,
5554
attributes: &[api::KeyValue],

src/sdk/trace/sampler.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ impl api::Sampler for Sampler {
2121
&self,
2222
parent_context: Option<&api::SpanContext>,
2323
trace_id: api::TraceId,
24-
_span_id: api::SpanId,
2524
_name: &str,
2625
_span_kind: &api::SpanKind,
2726
_attributes: &[api::KeyValue],
@@ -128,7 +127,6 @@ mod tests {
128127
.should_sample(
129128
parent_context.as_ref(),
130129
trace_id,
131-
api::SpanId::from_u64(1),
132130
name,
133131
&api::SpanKind::Internal,
134132
&[],

src/sdk/trace/tracer.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,14 @@ impl Tracer {
4646
&self,
4747
parent_context: Option<&api::SpanContext>,
4848
trace_id: api::TraceId,
49-
span_id: api::SpanId,
5049
name: &str,
5150
span_kind: &api::SpanKind,
5251
attributes: &[api::KeyValue],
5352
links: &[api::Link],
5453
) -> Option<(u8, Vec<api::KeyValue>)> {
5554
let sampler = &self.provider.config().default_sampler;
56-
let sampling_result = sampler.should_sample(
57-
parent_context,
58-
trace_id,
59-
span_id,
60-
name,
61-
span_kind,
62-
attributes,
63-
links,
64-
);
55+
let sampling_result =
56+
sampler.should_sample(parent_context, trace_id, name, span_kind, attributes, links);
6557

6658
self.process_sampling_result(sampling_result, parent_context)
6759
}
@@ -182,7 +174,6 @@ impl api::Tracer for Tracer {
182174
self.make_sampling_decision(
183175
parent_span_context.as_ref(),
184176
trace_id,
185-
span_id,
186177
&builder.name,
187178
&span_kind,
188179
&attribute_options,

0 commit comments

Comments
 (0)