Skip to content

Commit

Permalink
Add telemetry and service yaml (#1026)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisthat authored Oct 1, 2020
1 parent 43b20ec commit a275801
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 12 deletions.
50 changes: 50 additions & 0 deletions semantic_conventions/resource/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
groups:
- id: service
prefix: service
brief: >
A service instance.
attributes:
- id: name
type: string
required: always
brief: >
Logical name of the service.
note: >
MUST be the same for all instances of horizontally scaled services.
examples: ["shoppingcart"]
- id: namespace
type: string
brief: >
A namespace for `service.name`.
note: >
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.
examples: ["Shop"]
- id: instance.id
type: string
required: always
brief: >
The string ID of the service instance.
note: >
MUST be unique for each instance of the same `service.namespace,service.name` pair
(in other words `service.namespace,service.name,service.id` triplet MUST be globally unique).
The ID helps to distinguish instances of the same service that exist at the same time
(e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent
and stay the same for the lifetime of the service instance, however it is acceptable that
the ID is ephemeral and changes during important lifetime events for the service
(e.g. service restarts).
If the service has no inherent unique ID that can be used as the value of this attribute
it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID
(services aiming for reproducible UUIDs may also use Version 5, see RFC 4122
for more recommendations).
examples: ["627cc493-f310-47de-96bd-71410b7dec09"]
- id: version
type: string
brief: >
The version string of the service API or implementation.
examples: ["2.0.0"]
47 changes: 47 additions & 0 deletions semantic_conventions/resource/telemetry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
groups:
- id: telemetry
prefix: telemetry
brief: >
The telemetry SDK used to capture data recorded by the instrumentation libraries.
attributes:
- id: sdk.name
type: string
brief: >
The name of the telemetry SDK as defined above.
examples: ["opentelemetry"]
- id: sdk.language
type:
allow_custom_values: true
members:
- id: cpp
value: "cpp"
- id: dotnet
value: "dotnet"
- id: erlang
value: "erlang"
- id: go
value: "go"
- id: java
value: "java"
- id: nodejs
value: "nodejs"
- id: php
value: "php"
- id: python
value: "python"
- id: ruby
value: "ruby"
- id: webjs
value: "webjs"
brief: >
The language of the telemetry SDK.
- id: sdk.version
type: string
brief: >
The version string of the telemetry SDK.
examples: ["1.2.3"]
- id: auto.version
type: string
brief: >
The version string of the auto instrumentation agent, if used.
examples: ["1.2.3"]
49 changes: 37 additions & 12 deletions specification/resource/semantic_conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,20 @@ Certain attribute groups in this document have a **Required** column. For these

**Description:** A service instance.

| Attribute | Description | Example | Required? |
|---|---|---|---|
| service.name | Logical name of the service. <br/> MUST be the same for all instances of horizontally scaled services. | `shoppingcart` | Yes |
| service.namespace | A namespace for `service.name`.<br/>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. The field is optional. 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. | `Shop` | No |
| service.instance.id | The string ID of the service instance. <br/>MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). | `627cc493-f310-47de-96bd-71410b7dec09` | Yes |
| service.version | The version string of the service API or implementation. | `2.0.0` | No |
<!-- semconv service -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `service.name` | string | Logical name of the service. [1] | `shoppingcart` | Yes |
| `service.namespace` | string | A namespace for `service.name`. [2] | `Shop` | No |
| `service.instance.id` | string | The string ID of the service instance. [3] | `627cc493-f310-47de-96bd-71410b7dec09` | Yes |
| `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.

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

**[3]:** MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations).
<!-- endsemconv -->

Note: `service.namespace` and `service.name` are not intended to be concatenated for the purpose of forming a single globally unique name for the service. For example the following 2 sets of attributes actually describe 2 different services (despite the fact that the concatenation would result in the same string):

Expand Down Expand Up @@ -74,12 +82,29 @@ or another suitable identifier depending on the language.
The identifier `opentelemetry` is reserved and MUST NOT be used in this case.
The identifier SHOULD be stable across different versions of an implementation.

| Attribute | Description | Example | Required? |
|---|---|---|---|
| telemetry.sdk.name | The name of the telemetry SDK as defined above. | `opentelemetry` | No |
| telemetry.sdk.language | The language of the telemetry SDK.<br/> One of the following values MUST be used, if one applies: "cpp", "dotnet", "erlang", "go", "java", "nodejs", "php", "python", "ruby", "webjs" | `java` | No |
| telemetry.sdk.version | The version string of the telemetry SDK. | `1.2.3` | No |
| telemetry.auto.version | The version string of the auto instrumentation agent, if used. | `1.2.3` | No |
<!-- semconv telemetry -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `telemetry.sdk.name` | string | The name of the telemetry SDK as defined above. | `opentelemetry` | No |
| `telemetry.sdk.language` | string | The language of the telemetry SDK. | `cpp` | No |
| `telemetry.sdk.version` | string | The version string of the telemetry SDK. | `1.2.3` | No |
| `telemetry.auto.version` | string | The version string of the auto instrumentation agent, if used. | `1.2.3` | No |

`telemetry.sdk.language` MUST be one of the following or, if none of the listed values apply, a custom value:

| Value | Description |
|---|---|
| `cpp` | cpp |
| `dotnet` | dotnet |
| `erlang` | erlang |
| `go` | go |
| `java` | java |
| `nodejs` | nodejs |
| `php` | php |
| `python` | python |
| `ruby` | ruby |
| `webjs` | webjs |
<!-- endsemconv -->

## Compute Unit

Expand Down

0 comments on commit a275801

Please sign in to comment.