Skip to content

Commit a611ef2

Browse files
svrnmcartermp
andauthoredOct 16, 2023
Add concept page for resources (open-telemetry#3365)
Co-authored-by: Phillip Carter <pcarter@fastmail.com>
1 parent 9caf791 commit a611ef2

File tree

16 files changed

+96
-65
lines changed

16 files changed

+96
-65
lines changed
 

‎.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Hugo-generated assets
22
.hugo_build.lock
33
/public
4-
resources/
4+
/resources
55

66
# npm assets
77
node_modules/

‎.textlintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"allowlist": {
1313
"allow": [
1414
"/{{%.*%}}/",
15+
"/{{.*-}}/",
1516
"/<http://.*>/",
1617
"medium.com/opentelemetry",
1718
"github.com/open-telemetry",

‎content/en/docs/concepts/components.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,18 @@ For more information, see
8888

8989
### Resource Detectors
9090

91-
A resource represents the entity producing telemetry as resource attributes. For
92-
example, a process producing telemetry that is running in a container on
93-
Kubernetes has a Pod name, a namespace, and possibly a deployment name. All
94-
three of these attributes can be included in the resource.
91+
A [resource](/docs/concepts/resources/) represents the entity producing
92+
telemetry as resource attributes. For example, a process producing telemetry
93+
that is running in a container on Kubernetes has a Pod name, a namespace, and
94+
possibly a deployment name. All three of these attributes can be included in the
95+
resource.
9596

9697
The language specific implementations of OpenTelemetry provide resource
97-
detection from the environment variable OTEL_RESOURCE_DETECTION and for many
98+
detection from the environment variable `OTEL_RESOURCE_ATTRIBUTES` and for many
9899
common entities, like process runtime, service, host or operating system.
99100

101+
For more information, see [Resources](/docs/concepts/resources/).
102+
100103
### Cross Service Propagators
101104

102105
Propagation is the mechanism that moves data between services and processes.

‎content/en/docs/concepts/distributions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Distributions
33
description: >-
44
A distribution, not to be confused with a fork, is customized version of an
55
OpenTelemetry component.
6-
weight: 90
6+
weight: 190
77
---
88

99
The OpenTelemetry projects consists of multiple [components](../components) that

‎content/en/docs/concepts/glossary.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Glossary
33
description: >-
44
Terminology you may or may not be familiar with used by the OpenTelemetry
55
project.
6-
weight: 100
6+
weight: 200
77
---
88

99
The OpenTelemetry project uses terminology you may or may not be familiar with.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Resources
3+
weight: 70
4+
---
5+
6+
## Introduction
7+
8+
{{% docs/instrumentation/resources-intro %}}
9+
10+
If you use [Jaeger](https://www.jaegertracing.io/) as your observability
11+
backend, resource attributes are grouped under the **Process** tab:
12+
13+
![A screenshot from Jaeger showing an example output of resource attributes associated to a trace](screenshot-jaeger-resources.png)
14+
15+
A resource is added to the `TraceProvider` or `MetricProvider` when they are
16+
created during initialization. This association can not be changed later. After
17+
a resource is added, all spans and metrics produced from a `Tracer` or `Meter`
18+
from the provider will have the resource associated with them.
19+
20+
## Semantic Attributes with SDK-provided Default Value
21+
22+
There are attributes provided by the OpenTelemetry SDK. One of them is the
23+
`service.name`, which represents the logical name of the service. By default,
24+
SDKs will assign the value `unknown_service` for this value, so it is
25+
recommended to set it explicitly, either in code or via setting the environment
26+
variable `OTEL_SERVICE_NAME`.
27+
28+
Additionally, the SDK will also provides the following resource attributes to
29+
identify itself: `telemetry.sdk.name`, `telemetry.sdk.language` and
30+
`telemetry.sdk.version`.
31+
32+
## Resource Detectors
33+
34+
Most language-specific SDKs provide a set of resource detectors that can be used
35+
to automatically detect resource information from the environment. Common
36+
resource detectors include:
37+
38+
- [Operating System](/docs/specs/semconv/resource/os/)
39+
- [Host](/docs/specs/semconv/resource/host/)
40+
- [Process and Process Runtime](/docs/specs/semconv/resource/process/)
41+
- [Container](/docs/specs/semconv/resource/container/)
42+
- [Kubernetes](/docs/specs/semconv/resource/k8s/)
43+
- [Cloud-Provider-Specific Attributes](/docs/specs/semconv/resource/#cloud-provider-specific-attributes)
44+
- [and more](/docs/specs/semconv/resource/)
45+
46+
## Custom resources
47+
48+
You can also provide your own resource attributes. You can either provide them
49+
in code or via populating the environment variable `OTEL_RESOURCE_ATTRIBUTES`.
50+
If applicable, use the
51+
[semantic conventions for your resource attributes](/docs/specs/semconv/resource).
52+
For example, you can provide the name of your
53+
[deployment environment](/docs/specs/semconv/resource/deployment-environment/)
54+
using `deployment.environment`:
55+
56+
```shell
57+
env OTEL_RESOURCE_ATTRIBUTES=deployment.environment=production yourApp
58+
```
Loading

‎content/en/docs/concepts/sampling/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Sampling
33
description:
44
Learn about sampling, and the different sampling options available in
55
OpenTelemetry.
6-
weight: 50
6+
weight: 80
77
---
88

99
With distributed tracing, you observe requests as they move from one service to

‎content/en/docs/concepts/sdk-configuration/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: SDK Configuration
3-
weight: 51
3+
weight: 101
44
---
55

66
OpenTelemetry SDKs support configuration in each language and with environment

‎content/en/docs/instrumentation/erlang/resources.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,7 @@ cSpell:ignore: behaviour
99
<!-- markdownlint-disable no-duplicate-heading -->
1010
<!-- markdownlint-capture -->
1111

12-
A [resource](/docs/specs/otel/overview/#resources) represents an entity
13-
producing telemetry as attributes. For example, an OTP Release producing
14-
telemetry that is running in a container on Kubernetes has an OTP Release name,
15-
a Pod name, a namespace, and possibly a deployment name. All four of these
16-
attributes can be included in the resource.
17-
18-
In your observability backend, you can use resource information to better
19-
investigate interesting behavior. For example, if your trace or metrics data
20-
indicate latency in your system, you can narrow it down to a specific container,
21-
pod, or Kubernetes deployment.
12+
{{% docs/instrumentation/resources-intro "an OTP Release" %}}
2213

2314
## Using resource detectors
2415

‎content/en/docs/instrumentation/go/resources.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ weight: 70
44
cSpell:ignore: sdktrace thirdparty
55
---
66

7-
Resources are a special type of attribute that apply to all spans generated by a
8-
process. These should be used to represent underlying metadata about a process
9-
that's non-ephemeral &mdash; for example, the hostname of a process, or its
10-
instance ID.
7+
{{% docs/instrumentation/resources-intro %}}
118

129
Resources should be assigned to a tracer provider at its initialization, and are
1310
created much like attributes:

‎content/en/docs/instrumentation/java/resources.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,7 @@ weight: 70
44
cSpell:ignore: getenv myhost SIGINT uuidgen WORKDIR
55
---
66

7-
A [resource](/docs/specs/otel/resource/sdk/) represents the entity producing
8-
telemetry as resource attributes. For example, a process producing telemetry
9-
that is running in a container on Kubernetes has a Pod name, a namespace, and
10-
possibly a deployment name. All three of these attributes can be included in the
11-
resource.
12-
13-
In your observability backend, you can use resource information to better
14-
investigate interesting behavior. For example, if your trace or metrics data
15-
indicate latency in your system, you can narrow it down to a specific container,
16-
pod, or Kubernetes deployment.
7+
{{% docs/instrumentation/resources-intro %}}
178

189
If you use the Javaagent for
1910
[automatic instrumentation](/docs/instrumentation/java/automatic) you can learn

‎content/en/docs/instrumentation/js/resources.md

+3-12
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,10 @@ cSpell:ignore: myhost SIGINT uuidgen WORKDIR
55
description: Add details about your applications' environment to your telemetry
66
---
77

8-
A [resource][] represents the entity producing telemetry as resource attributes.
9-
For example, a process producing telemetry that is running in a container on
10-
Kubernetes has a Pod name, a namespace, and possibly a deployment name. All
11-
three of these attributes can be included in the resource.
8+
{{% docs/instrumentation/resources-intro %}}
129

13-
In your observability backend, you can use resource information to better
14-
investigate interesting behavior. For example, if your trace or metrics data
15-
indicate latency in your system, you can narrow it down to a specific container,
16-
pod, or Kubernetes deployment.
17-
18-
Below you will find some introductions on how to set up resource detection with
19-
the Node.js SDK.
10+
Below you will find introductions on how to set up resource detection with the
11+
Node.js SDK.
2012

2113
## Setup
2214

@@ -261,7 +253,6 @@ to get details about your [Cloud] environment or [Deployment][]. You will find a
261253
list
262254
[here](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/detectors/node).
263255
264-
[resource]: /docs/specs/otel/resource/sdk/
265256
[getting started - node.js]: /docs/instrumentation/js/getting-started/nodejs/
266257
[process and process runtime resources]:
267258
/docs/specs/otel/resource/semantic_conventions/process/

‎content/en/docs/instrumentation/net/resources.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@ weight: 70
44
cSpell:ignore: myhost pcarter uuidgen
55
---
66

7-
A [resource][] represents the entity producing telemetry as resource attributes.
8-
For example, a process producing telemetry that is running in a container on
9-
Kubernetes has a Pod name, a namespace, and possibly a deployment name. All
10-
three of these attributes can be included in the resource.
11-
12-
In your observability backend, you can use resource information to better
13-
investigate interesting behavior. For example, if your trace or metrics data
14-
indicate latency in your system, you can narrow it down to a specific container,
15-
pod, or Kubernetes deployment.
7+
{{% docs/instrumentation/resources-intro %}}
168

179
## Setup
1810

@@ -145,7 +137,6 @@ code, the values in code take precedence.
145137
There are more resource detectors you can add to your configuration, for example
146138
to get details about your [Cloud] environment or [Deployment][].
147139

148-
[resource]: /docs/specs/otel/resource/sdk/
149140
[getting started]: /docs/instrumentation/net/getting-started/
150141
[host]: /docs/specs/otel/resource/semantic_conventions/host/
151142
[cloud]: /docs/specs/otel/resource/semantic_conventions/cloud/

‎content/en/docs/instrumentation/php/resources.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,7 @@ title: Resources
33
weight: 70
44
---
55

6-
A resource represents the entity producing telemetry as resource attributes. For
7-
example, a process producing telemetry that is running in a container on
8-
Kubernetes has a Pod name, a namespace, and possibly a deployment name. All
9-
three of these attributes can be included in the resource.
10-
11-
In your observability backend, you can use resource information to better
12-
investigate interesting behavior. For example, if your trace or metrics data
13-
indicate latency in your system, you can narrow it down to a specific container,
14-
pod, or Kubernetes deployment.
6+
{{% docs/instrumentation/resources-intro %}}
157

168
## Resource Detection
179

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{ $processWord := default ("a process") (.Get 0) -}}
2+
{{ $resourceHRef := "/docs/concepts/resources/" }}
3+
4+
{{ if eq .Page.RelPermalink $resourceHRef }}
5+
{{ $resourceHRef = "/docs/specs/otel/resource/sdk/" }} {{ end -}}
6+
7+
A [resource]({{ $resourceHRef }}) represents the entity producing telemetry as
8+
resource attributes. For example, {{ $processWord }} producing telemetry that is
9+
running in a container on Kubernetes has {{ $processWord }} name, a pod name, a
10+
namespace, and possibly a deployment name. All four of these attributes can be
11+
included in the resource.
12+
13+
In your observability backend, you can use resource information to better
14+
investigate interesting behavior. For example, if your trace or metrics data
15+
indicate latency in your system, you can narrow it down to a specific container,
16+
pod, or Kubernetes deployment.

0 commit comments

Comments
 (0)
Please sign in to comment.