Skip to content

Commit

Permalink
Add yaml for FaaS and Host resource attributes (#1056)
Browse files Browse the repository at this point in the history
* Add yaml for FaaS and Host resource attributes

* Address feedback

Co-authored-by: Armin Ruech <[email protected]>
  • Loading branch information
thisthat and arminru authored Oct 12, 2020
1 parent 0410b9e commit 7e0c102
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 17 deletions.
35 changes: 35 additions & 0 deletions semantic_conventions/resource/faas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
groups:
- id: faas_resource
prefix: faas
brief: >
A serverless instance.
attributes:
- id: name
type: string
required: always
brief: >
The name of the function being executed.
examples: ['my-function']
- id: id
type: string
required: always
brief: >
The unique ID of the function being executed.
note: >
For example, in AWS Lambda this field corresponds to the
[ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
value, in GCP to the URI of the resource, and in Azure to the
[FunctionDirectory](https://github.com/Azure/azure-functions-host/wiki/Retrieving-information-about-the-currently-running-function)
field.
examples: ['arn:aws:lambda:us-west-2:123456789012:function:my-function']
- id: version
type: string
brief: >
The version string of the function being executed as defined in
[Version Attributes](https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions#version-attributes).
examples: ['2.0.0']
- id: instance
type: string
brief: >
The execution environment ID as a string.
examples: ['my-function:instance-0001']
39 changes: 39 additions & 0 deletions semantic_conventions/resource/host.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
groups:
- id: host
prefix: host
brief: >
A host is defined as a general computing instance.
attributes:
- id: id
type: string
brief: >
Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider.
examples: ['opentelemetry-test']
- id: name
type: string
brief: >
Name of the host. On Unix systems, it may contain what the hostname
command returns, or the fully qualified hostname, or another name
specified by the user.
examples: ['opentelemetry-test']
- id: type
type: string
brief: >
Type of host. For Cloud, this must be the machine type.
examples: ['n1-standard-1']
- id: image.name
type: string
brief: >
Name of the VM image or OS install the host was instantiated from.
examples: ['infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905']
- id: image.id
type: string
brief: >
VM image ID. For Cloud, this value is from the provider.
examples: ['ami-07b06b442921831e5']
- id: image.version
type: string
brief: >
The version string of the VM image as defined in
[Version Attributes](https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions#version-attributes).
examples: ['0.1']
19 changes: 10 additions & 9 deletions specification/resource/semantic_conventions/faas.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

**Description:** A serverless instance.

| Label | Description | Example | Required |
|---|---|---|--|
| faas.name | The name of the function being executed. | `my-function` | Yes |
| faas.id | The unique name of the function being executed. <br /> For example, in AWS Lambda this field corresponds to the [ARN] value, in GCP to the URI of the resource, and in Azure to the [FunctionDirectory] field. | `arn:aws:lambda:us-west-2:123456789012:function:my-function` | Yes |
| faas.version | The version string of the function being executed. | `2.0.0` | No |
| faas.instance | The execution environment ID as a string. | `my-function:instance-0001` | No |
<!-- semconv faas_resource -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `faas.name` | string | The name of the function being executed. | `my-function` | Yes |
| `faas.id` | string | The unique ID of the function being executed. [1] | `arn:aws:lambda:us-west-2:123456789012:function:my-function` | Yes |
| `faas.version` | string | The version string of the function being executed as defined in [Version Attributes](https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions#version-attributes). | `2.0.0` | No |
| `faas.instance` | string | The execution environment ID as a string. | `my-function:instance-0001` | No |

Note: The resource attribute `faas.instance` differs from the span attribute `faas.execution`. For more information see the [Semantic conventions for FaaS spans](../../trace/semantic_conventions/faas.md#difference-between-execution-and-instance).
**[1]:** For example, in AWS Lambda this field corresponds to the [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) value, in GCP to the URI of the resource, and in Azure to the [FunctionDirectory](https://github.com/Azure/azure-functions-host/wiki/Retrieving-information-about-the-currently-running-function) field.
<!-- endsemconv -->

[ARN]:https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
[FunctionDirectory]: https://github.com/Azure/azure-functions-host/wiki/Retrieving-information-about-the-currently-running-function
Note: The resource attribute `faas.instance` differs from the span attribute `faas.execution`. For more information see the [Semantic conventions for FaaS spans](../../trace/semantic_conventions/faas.md#difference-between-execution-and-instance).
18 changes: 10 additions & 8 deletions specification/resource/semantic_conventions/host.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

**Description:** A host is defined as a general computing instance.

| Attribute | Description | Example |
|---|---|---|
| host.id | Unique host id.<br/> For Cloud this must be the instance_id assigned by the cloud provider | `opentelemetry-test` |
| host.name | Name of the host.<br/>On Unix systems, it may contain what the `hostname` command returns, or the fully qualified hostname, or another name specified by the user. | `opentelemetry-test` |
| host.type | Type of host.<br/> For Cloud this must be the machine type.| `n1-standard-1` |
| host.image.name | Name of the VM image or OS install the host was instantiated from. | `infra-ami-eks-worker-node-7d4ec78312`, `CentOS-8-x86_64-1905` |
| host.image.id | VM image id. For Cloud, this value is from the provider. | `ami-07b06b442921831e5` |
| host.image.version | The version string of the VM image. | `0.1` |
<!-- semconv host -->
| Attribute | Type | Description | Example | Required |
|---|---|---|---|---|
| `host.id` | string | Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. | `opentelemetry-test` | No |
| `host.name` | string | Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. | `opentelemetry-test` | No |
| `host.type` | string | Type of host. For Cloud, this must be the machine type. | `n1-standard-1` | No |
| `host.image.name` | string | Name of the VM image or OS install the host was instantiated from. | `infra-ami-eks-worker-node-7d4ec78312`<br>`CentOS-8-x86_64-1905` | No |
| `host.image.id` | string | VM image ID. For Cloud, this value is from the provider. | `ami-07b06b442921831e5` | No |
| `host.image.version` | string | The version string of the VM image as defined in [Version Attributes](https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions#version-attributes). | `0.1` | No |
<!-- endsemconv -->

0 comments on commit 7e0c102

Please sign in to comment.