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

Define the fallback case for service.name #1269

Merged
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
4 changes: 4 additions & 0 deletions semantic_conventions/resource/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ groups:
Logical name of the service.
note: >
MUST be the same for all instances of horizontally scaled services.
Although this is a required attribute, if the value was not specified, SDKs
MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process),
e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value
MUST be set to `unknown_service`.
examples: ["shoppingcart"]
- id: namespace
type: string
Expand Down
3 changes: 3 additions & 0 deletions specification/resource/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ The interface MUST provide a way to create a new resource, from [`Attributes`](.
Examples include a factory method or a constructor for a resource
object. A factory method is recommended to enable support for cached objects.

Note that certain **required** `Resource` attributes MUST be set to a default value if they were not specified.
See [Attributes with Default Value](semantic_conventions/README.md#attributes-with-default-value).

Required parameters:

- [`Attributes`](../common/common.md#attributes)
Expand Down
9 changes: 8 additions & 1 deletion specification/resource/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This document defines standard attributes for resources. These attributes are ty

- [TODOs](#todos)
- [Document Conventions](#document-conventions)
- [Attributes with Default Value](#attributes-with-default-value)
- [Service](#service)
- [Telemetry SDK](#telemetry-sdk)
- [Compute Unit](#compute-unit)
Expand All @@ -32,6 +33,12 @@ 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 Default Value

The SDK MUST set a default value for the following attributes if they were not specified:
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

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

## Service

**type:** `service`
Expand All @@ -46,7 +53,7 @@ Certain attribute groups in this document have a **Required** column. For these
| `service.instance.id` | string | The string ID of the service instance. [3] | `627cc493-f310-47de-96bd-71410b7dec09` | Yes |
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
| `service.version` | string | The version string of the service API or implementation. | `2.0.0` | No |

**[1]:** MUST be the same for all instances of horizontally scaled services.
**[1]:** MUST be the same for all instances of horizontally scaled services. Although this is a required attribute, if the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`.
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

**[2]:** A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.

Expand Down