-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
I'd like my traces to contain OS and process info. I'd like to add basically all the detectors available in https://pkg.go.dev/go.opentelemetry.io/otel/sdk/resource. I don't see a way to do that currently.
One option would be to add launcher.WithDetectors(detectors ...Detector) Option to launcher, so you could say:
otelShutdown, err := launcher.ConfigureOpenTelemetry(launcher.WithDetectors(resource.WithHost(), resource.WithOS()))This might need the launcher.Config type to be changed to carry detectors in it.
Another option would be to allow adding the resource explicitly:
res, err := resource.New(context.Background(), resource.WithOS(), resource.WithProcess())
if err != nil {
log.Fatalf("could not detect opentelemetry resources: %s", err)
}
otelShutdown, err := launcher.ConfigureOpenTelemetry(launcher.WithResource(res))I think for now it's possible to work around the issue by serialising the resource into an attribute map:
res, err := resource.New(context.Background(), resource.WithOS(), resource.WithProcess())
if err != nil {
log.Fatalf("could not detect opentelemetry resources: %s", err)
}
attribs := res.Attributes()
attribMap := make(map[string]string)
for _, attrib := range attribs {
attribMap[string(attrib.Key)] = attrib.Value.AsString()
}
otelShutdown, err := launcher.ConfigureOpenTelemetry(launcher.WithResourceAttributes(attribMap))The issue is that this is highly unintuitive.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels