Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions serve/opentelemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ import (

// newResource returns a resource describing this application.
func newResource(p *plugin.Plugin) *resource.Resource {
def := resource.Default()
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.

resource.Default(),
def,
resource.NewWithAttributes(
semconv.SchemaURL,
schemaURL,
semconv.ServiceName("cloudquery-"+p.Name()),
semconv.ServiceVersion(p.Version()),
),
Expand Down
Loading