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

[pdatatest] Ignore span attribute value #27689

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

[pdatatest] Ignore span attribute value #27689

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

Comments

@atoulme
Copy link
Contributor

atoulme commented Oct 16, 2023

Component(s)

pkg/pdatatest

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

We compare spans which have unique attribute values (such as UUIDs). This creates issues when comparing two sets of spans.

Describe the solution you'd like

We want to ignore a specific span attribute value during comparison.

Describe alternatives you've considered

We use this code for now:

func ignoreSpanAttribute(attributeName string, 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)
				if _, ok := span.Attributes().Get(attributeName); ok {
					span.Attributes().PutStr(attributeName, "*")
				}
			}
		}
	}
}

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 attribute value in span comparisons for ptracetest.

**Link to tracking Issue:** 
#27689
martin-majlis-s1 pushed a commit to scalyr/opentelemetry-collector-contrib that referenced this issue Oct 20, 2023
**Description:**
Support ignore span attribute value in span comparisons for ptracetest.

**Link to tracking Issue:** 
open-telemetry#27689
sigilioso pushed a commit to carlossscastro/opentelemetry-collector-contrib that referenced this issue Oct 27, 2023
**Description:**
Support ignore span attribute value in span comparisons for ptracetest.

**Link to tracking Issue:** 
open-telemetry#27689
jmsnll pushed a commit to jmsnll/opentelemetry-collector-contrib that referenced this issue Nov 12, 2023
**Description:**
Support ignore span attribute value in span comparisons for ptracetest.

**Link to tracking Issue:** 
open-telemetry#27689
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
Projects
None yet
Development

No branches or pull requests

3 participants