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

update Resource spec based on the move to the SDK and named tracers #421

Merged
merged 8 commits into from
Jan 30, 2020
25 changes: 15 additions & 10 deletions specification/sdk-resource.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
# Resource SDK

A [Resource](overview.md#resources) represents the entity producing telemetry.
The primary purpose of resources as a first-class concept in the API is
A [Resource](overview.md#resources) represents the entity producing
telemetry. For example, a process producing telemetry that is running in a
container on Kubernetes has a Pod name, it is in a namespace and possibly is
part of a Deployment which also has a name. All three of these attributes can be
included in the `Resource`.

The primary purpose of resources as a first-class concept in the SDK is
decoupling of discovery of resource information from exporters. This allows for
independent development and easy customization for users that need to integrate
with closed source environments. API MUST allow for creation of `Resources` and
with closed source environments. SDK MUST allow for creation of `Resources` and
tsloughter marked this conversation as resolved.
Show resolved Hide resolved
tsloughter marked this conversation as resolved.
Show resolved Hide resolved
for associating them with telemetry.

When used with distributed tracing, a resource can be associated with the
[TracerSdk](sdk-tracing.md#tracer-sdk). When associated with `TracerSdk`, all
`Span`s produced by the `Tracer`, that is implemented by this `TracerSdk`, will
[TracerProvider](sdk-tracing.md#tracer-sdk). When associated with a
`TracerProvider`, all `Span`s produced by any `Tracer` from the provider will
automatically be associated with this `Resource`.

When used with metrics, a resource can be associated with the
[MeterSdk](sdk-metrics.md#meter-sdk). When associated with `MeterSdk`, all
`Metrics` produced by this `Meter`, that is implemented by this `MeterSdk`, will
automatically be associated with this `Resource`.
[MeterProvider](sdk-metrics.md#meter-sdk). When associated with a `MeterProvider`,
all `Metrics` produced by any `Meter` from the provider will automatically be
associated with this `Resource`.

## Resource creation

The API interface must support two ways to instantiate new resources. Those are:
The SDK must support two ways to instantiate new resources. Those are:

### Create

Expand Down Expand Up @@ -66,7 +71,7 @@ In addition to resource creation, the following operations should be provided:

### Retrieve attributes

The API should provide a way to retrieve a read only collection of attributes
The SDK should provide a way to retrieve a read only collection of attributes
associated with a resource. The attributes should consist of the name and values,
both of which should be strings.

Expand Down