Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ptracetest] Allow to ignore span ID #27685

Closed
atoulme opened this issue Oct 16, 2023 · 1 comment
Closed

[ptracetest] Allow to ignore span ID #27685

atoulme opened this issue Oct 16, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed pkg/pdatatest

Comments

@atoulme
Copy link
Contributor

atoulme commented Oct 16, 2023

Component(s)

pkg/pdatatest

Is your feature request related to a problem? Please describe.

The current implementation of ptracetest compares tests but doesn't allow to ignore span IDs of spans.

Describe the solution you'd like

I would like to remove all notion of equality by span ID.

Describe alternatives you've considered

Right now I change span IDs to the following:

func ignoreSpanID(traces ptrace.Traces) {
	for i := 0; i < traces.ResourceSpans().Len(); i++ {
		rs := traces.ResourceSpans().At(i)
		for j := 0; j < rs.ScopeSpans().Len(); j++ {
			ss := rs.ScopeSpans().At(j)
			for k := 0; k < ss.Spans().Len(); k++ {
				span := ss.Spans().At(k)
				span.SetSpanID(pcommon.NewSpanIDEmpty())
			}
		}
	}
}

I apply this change to the expected and actual sets.

Additional context

No response

@atoulme atoulme added enhancement New feature or request needs triage New item requiring triage labels Oct 16, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@djaglowski djaglowski added help wanted Extra attention is needed good first issue Good for newcomers and removed needs triage New item requiring triage labels Oct 16, 2023
dmitryax pushed a commit that referenced this issue Oct 19, 2023
**Description:** 
Support ignore span ID in span comparisons for ptracetest.

**Link to tracking Issue:** 

#27685

**Testing:** 
make chlog-validate 
go test for pdatatest

**Documentation:**
martin-majlis-s1 pushed a commit to scalyr/opentelemetry-collector-contrib that referenced this issue Oct 20, 2023
**Description:** 
Support ignore span ID in span comparisons for ptracetest.

**Link to tracking Issue:** 

open-telemetry#27685

**Testing:** 
make chlog-validate 
go test for pdatatest

**Documentation:**
sigilioso pushed a commit to carlossscastro/opentelemetry-collector-contrib that referenced this issue Oct 27, 2023
**Description:** 
Support ignore span ID in span comparisons for ptracetest.

**Link to tracking Issue:** 

open-telemetry#27685

**Testing:** 
make chlog-validate 
go test for pdatatest

**Documentation:**
jmsnll pushed a commit to jmsnll/opentelemetry-collector-contrib that referenced this issue Nov 12, 2023
**Description:** 
Support ignore span ID in span comparisons for ptracetest.

**Link to tracking Issue:** 

open-telemetry#27685

**Testing:** 
make chlog-validate 
go test for pdatatest

**Documentation:**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed pkg/pdatatest
Projects
None yet
Development

No branches or pull requests

3 participants