kspan icon indicating copy to clipboard operation
kspan copied to clipboard

Add support for user defined OTEL resource attributes

Open clly opened this issue 3 years ago • 5 comments

This will add support for pulling in opentelemetry's default attributes It adds sdk information, service.name and discrete key/value entries as specified on the environment and local host information such as the hostname and instance.

clly avatar Jun 24 '21 20:06 clly

Thanks for the PR.

Can you describe how those attributes are useful for Kspan? It generates spans that claim to come from many different components such as kubectl, scheduler, controller-manager, so I wonder if it would be confusing that they all have the same host information.

bboreham avatar Jul 10 '21 17:07 bboreham

Sorry about that. One of the default attributes is also anything that exists in the OTEL_RESOURCE_ATTRIBUTES environment variable.

This change pulls that in as well as all the SDK and local host/runtime environment information

clly avatar Jul 11 '21 14:07 clly

It is possible to only pull in the environment variable attributes instead of everything. If that's preferred let me know and I can change it

clly avatar Jul 12 '21 16:07 clly

Yes, might be safer to start just with the env-vars.

bboreham avatar Jul 13 '21 09:07 bboreham

I've updated the PR to only pull in resources from the environment

clly avatar Jul 23 '21 03:07 clly