Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 37 additions & 8 deletions opentelemetry-guidelines.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
# OpenTelemetry Guidelines

This document provides guidance for language instrumentation agents that use
OpAMP.
This document provides guidance for OpenTelemetry agents that use OpAMP.

## Scope
## Collector

This guidance is intended for OpenTelemetry Collector.

### Identifying Attributes

The OpenTelemetry Collector SHOULD specify the following attributes in
`AgentDescription.identifying_attributes`:

- `service.name` should be set to the same value that the Agent uses in its own telemetry.
- `service.namespace` if it is used in the environment where the Agent runs.
- `service.version` should be set to version number of the Agent build.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also goes against #312... Shouldn't this be non-identifying attribute?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I follow. Why is this against #312?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

service.version isn't listed in the set of required identifying attributes. Why do we recommend to set it there for the collector?

- `service.instance.id` should be set. It may be set equal to the Agent's
instance uid (equal to ServerToAgent.instance_uid field) or any other value
that uniquely identifies the Agent in combination with other attributes.
- any other attributes that are necessary for uniquely identifying the Agent's
own telemetry.
Comment on lines +20 to +21
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this given #312?


These values SHOULD match the values that the Collector uses in the Resource of its
own telemetry.

### Non-identifying Attributes

The following attributes SHOULD be included in `AgentDescription.non_identifying_attributes`:

- `os.type`, `os.version` - to describe where the Collector runs.
- `host.\*` to describe the host the Collector runs on.
- `cloud.\*` to describe the cloud where the host is located.
- any other relevant Resource attributes that describe this Collector and the
environment it runs in.
- any user-defined attributes that the end user would like to associate with
this Collector.

## SDKs

This guidance is intended for OpenTelemetry language agents that run as part of an instrumented
application process. Examples include auto-instrumentation language agents and similar
instrumentation runtimes built with OpenTelemetry SDKs.

This guidance does not apply to standalone agents such as the OpenTelemetry
Collector.

## Identifying Attributes
### Identifying Attributes

Language instrumentation agents MUST copy the following OpenTelemetry SDK
`Resource` attributes into `AgentDescription.identifying_attributes`:
Expand All @@ -24,7 +53,7 @@ Language instrumentation agents MUST copy the following OpenTelemetry SDK
These identifying attributes MUST match the values that the agent uses in the
Resource of its own telemetry.

## Non-identifying Attributes
### Non-identifying Attributes

Language instrumentation agents SHOULD copy all other OpenTelemetry SDK
`Resource` attributes into `AgentDescription.non_identifying_attributes`,
Expand Down
16 changes: 2 additions & 14 deletions specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -1204,18 +1204,6 @@ Attributes that identify the Agent.
Keys/values are according to OpenTelemetry [resource semantic
conventions](https://opentelemetry.io/docs/specs/semconv/resource/).

For standalone running Agents (such as OpenTelemetry Collector) the following
attributes SHOULD be specified:

- service.name should be set to the same value that the Agent uses in its own telemetry.
- service.namespace if it is used in the environment where the Agent runs.
- service.version should be set to version number of the Agent build.
- service.instance.id should be set. It may be set equal to the Agent's
instance uid (equal to ServerToAgent.instance_uid field) or any other value
that uniquely identifies the Agent in combination with other attributes.
- any other attributes that are necessary for uniquely identifying the Agent's
own telemetry.

The Agent SHOULD also include these attributes in the Resource of its own
telemetry. The combination of identifying attributes SHOULD be sufficient to
uniquely identify the Agent's own telemetry in the destination system to which
Expand All @@ -1226,9 +1214,9 @@ the Agent sends its own telemetry.
Attributes that do not necessarily identify the Agent but help describe where it
runs.

The following attributes SHOULD be included:
Here are some examples of attributes that may be a good fit for non-identifying attributes:

- os.type, os.version - to describe where the Agent runs.
- os.\* to describe where the Agent runs.
- host.\* to describe the host the Agent runs on.
- cloud.\* to describe the cloud where the host is located.
- any other relevant Resource attributes that describe this Agent and the
Comment on lines +1219 to 1222
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept these as generic recommendations. There is also slightly specific requirements for the Collector in opentelemetry-guidelines.md.

I am not sure how to best differentiate the too, but I felt like some generic recommendations are still useful to have in this file.

Expand Down