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 6 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 a language-specific name based on the running service
(typically inferred from process name, language, plaform, etc).
If this fallback fails, the name MUST default to `unknown_service`.
examples: ["shoppingcart"]
- id: namespace
type: string
Expand Down
4 changes: 4 additions & 0 deletions specification/resource/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ 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` specific attributes
MUST have fallback values if they were not specified, e.g. `service.name`.
See [Resource standard attributes]((semantic_conventions/README.md)).
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved

Required parameters:

- [`Attributes`](../common/common.md#attributes)
Expand Down
2 changes: 1 addition & 1 deletion specification/resource/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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 a language-specific name based on the running service (typically inferred from process name, language, plaform, etc). If this fallback fails, the name MUST default to `unknown_service`.

**[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