Skip to content

Commit

Permalink
Add OTEL_SERVICE_NAME environment variable (open-telemetry#1677)
Browse files Browse the repository at this point in the history
* Add OTEL_SERVICE_NAME environment variable

Closes open-telemetry#709
  • Loading branch information
iNikem authored May 24, 2021
1 parent 8544dd5 commit cfd3374
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ release.

### SDK Configuration

- Add `OTEL_SERVICE_NAME` environment variable. ([#1677](https://github.com/open-telemetry/opentelemetry-specification/pull/1677))

## v1.3.0 (2021-05-05)

### Context
Expand Down
1 change: 1 addition & 0 deletions spec-compliance-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Note: Support for environment variables is optional.
|Feature |Go |Java|JS |Python|Ruby|Erlang|PHP|Rust|C++|.Net|Swift|
|----------------------------------------------|---|----|---|------|----|------|---|----|---|----|-----|
|OTEL_RESOURCE_ATTRIBUTES | + | + | + | + | + | + | - | + | + | + | - |
|OTEL_SERVICE_NAME | | | | | | | | | | | |
|OTEL_LOG_LEVEL | - | - | + | [-][py1059] | + | + | - | | - | - | - |
|OTEL_PROPAGATORS | - | + | | + | + | + | - | - | - | - | - |
|OTEL_BSP_* | - | + | | + | + | + | - | + | - | - | - |
Expand Down
13 changes: 12 additions & 1 deletion specification/resource/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@ Attributes are grouped logically by the type of the concept that they described.

Certain attribute groups in this document have a **Required** column. For these groups if any attribute from the particular group is present in the Resource then all attributes that are marked as Required MUST be also present in the Resource. However it is also valid if the entire attribute group is omitted (i.e. none of the attributes from the particular group are present even though some of them are marked as Required in this document).

## Attributes with Special Handling

Given their significance some resource attributes are treated specifically as described below.

### Semantic Attributes with Dedicated Environment Variable

These are the attributes which MAY be configurable via a dedicated environment variable
as specified in [OpenTelemetry Environment Variable Specification](../../sdk-environment-variables.md):

- [`service.name`](#service)

## Semantic Attributes with SDK-provided Default Value

These are the the attributes which MUST be provided by the SDK
These are the attributes which MUST be provided by the SDK
as specified in the [Resource SDK specification](../sdk.md#sdk-provided-resource-attributes):

- [`service.name`](#service)
Expand Down
1 change: 1 addition & 0 deletions specification/sdk-environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ For example, the value `12000` indicates 12000 milliseconds, i.e., 12 seconds.
| Name | Description | Default | Notes |
| ------------------------ | ------------------------------------------------- | --------------------------------- | ----------------------------------- |
| OTEL_RESOURCE_ATTRIBUTES | Key-value pairs to be used as resource attributes | | See [Resource SDK](./resource/sdk.md#specifying-resource-information-via-an-environment-variable) for more details. |
| OTEL_SERVICE_NAME | Sets the value of the [`service.name`](./resource/semantic_conventions/README.md#service) resource attribute | | If `service.name` is also provided in `OTEL_RESOURCE_ATTRIBUTES`, then `OTEL_SERVICE_NAME` takes precedence. |
| OTEL_LOG_LEVEL | Log level used by the SDK logger | "info" | |
| OTEL_PROPAGATORS | Propagators to be used as a comma separated list | "tracecontext,baggage" | Values MUST be deduplicated in order to register a `Propagator` only once. |
| OTEL_TRACES_SAMPLER | Sampler to be used for traces | "parentbased_always_on" | See [Sampling](./trace/sdk.md#sampling) |
Expand Down

0 comments on commit cfd3374

Please sign in to comment.