swift-distributed-tracing icon indicating copy to clipboard operation
swift-distributed-tracing copied to clipboard

Add Resource type to Tracing API

Open slashmo opened this issue 4 years ago • 4 comments

OpenTelemetry defines a Resource as part of its spec: https://github.com/open-telemetry/opentelemetry-specification/blob/v0.7.0/specification/resource/sdk.md

Resource captures information about the entity for which telemetry is recorded. For example, metrics exposed by a Kubernetes container can be linked to a resource that specifies the cluster, namespace, pod, and container name.

A resource is passed along when sending spans to the Otel collector.

Resources also have attributes with semantic conventions similar to spans: https://github.com/open-telemetry/opentelemetry-specification/blob/v0.7.0/specification/resource/semantic_conventions/README.md

It might be a good idea to expose the resource API as well as part of the Tracing library, but as the resources (e.g. which cloud provider the app is running on or whether it's running in a Docker container) are usually unknown to frameworks and instead known by the application developer, this API could also live in a specific tracer implementation.

slashmo avatar Jan 26 '21 17:01 slashmo

I'm leaving this as something we can add later, trying to figure out how to make a 1.0 soon

ktoso avatar Feb 24 '23 08:02 ktoso

selfish bump

wibed avatar Nov 28 '23 09:11 wibed

@wibed Thanks for the bump 🙏 Do you have a particular use case in mind for having the concept of resources in the library?

slashmo avatar Nov 28 '23 10:11 slashmo

id like to use resources as a cheap key:value store. new to the whole tracing situation i am not sure which solution is better suited though

wibed avatar Nov 28 '23 11:11 wibed