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

fix: OpenTelemetry schema URL panic #2012

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

disq
Copy link
Member

@disq disq commented Dec 18, 2024

resource.Merge returns an error only when schemas don't match.

@disq disq requested a review from a team as a code owner December 18, 2024 21:59
@disq disq requested a review from ronsh12 December 18, 2024 21:59
@github-actions github-actions bot added the fix label Dec 18, 2024
@disq disq requested review from erezrokah and removed request for ronsh12 December 18, 2024 22:00
schemaURL := def.SchemaURL()
if schemaURL == "" {
schemaURL = semconv.SchemaURL
}
r, err := resource.Merge(
Copy link
Member Author

@disq disq Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method always returns r (even with err, which the single value can be ErrSchemaURLConflict) so we could also do if r != nil { return r } panic(err) but in that case the resource's schema URL could be empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants