Skip to content

Commit

Permalink
Merge branch 'main' into karthik/add-additional-genai-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopgrassi authored May 28, 2024
2 parents 77bdde8 + c53f76f commit 1c0616d
Show file tree
Hide file tree
Showing 28 changed files with 668 additions and 20 deletions.
22 changes: 22 additions & 0 deletions .chloggen/go-runtime-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: new_component

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: go

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add new go namespace for Go runtime metrics

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [535]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
22 changes: 22 additions & 0 deletions .chloggen/k8s-waiting-status.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: "k8s"

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "add k8s.container.status.current_waiting_reason resource attribute"

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [996]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ body:
- area:file
- area:gcp
- area:gen-ai
- area:go
- area:graphql
- area:heroku
- area:host
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/change_proposal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ body:
- area:file
- area:gcp
- area:gen-ai
- area:go
- area:graphql
- area:heroku
- area:host
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/new-conventions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ body:
- area:file
- area:gcp
- area:gen-ai
- area:go
- area:graphql
- area:heroku
- area:host
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ This and earlier versions were released as part of [the Specification](https://g
([#2827](https://github.com/open-telemetry/opentelemetry-specification/pull/2827))
- Define semantic conventions yaml for non-otlp conventions
([#2850](https://github.com/open-telemetry/opentelemetry-specification/pull/2850))
- Add more semantic convetion attributes of Apache RocketMQ
- Add more semantic convention attributes of Apache RocketMQ
([#2881](https://github.com/open-telemetry/opentelemetry-specification/pull/2881))
- Add `process.runtime.jvm.memory.usage_after_last_gc` metric to semantic conventions.
([#2901](https://github.com/open-telemetry/opentelemetry-specification/pull/2901))
Expand Down
37 changes: 31 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ CHLOGGEN_CONFIG := .chloggen/config.yaml
SEMCONVGEN_VERSION=0.24.0
WEAVER_VERSION=0.2.0

# From where to resolve the containers (e.g. "otel/weaver").
CONTAINER_REPOSITORY=docker.io

# Per container overrides for the repository resolution.
WEAVER_CONTAINER_REPOSITORY=$(CONTAINER_REPOSITORY)
SEMCONVGEN_CONTAINER_REPOSITORY=$(CONTAINER_REPOSITORY)

# Fully qualified references to containers used in this Makefile.
WEAVER_CONTAINER=$(WEAVER_CONTAINER_REPOSITORY)/otel/weaver:$(WEAVER_VERSION)
SEMCONVGEN_CONTAINER=$(SEMCONVGEN_CONTAINER_REPOSITORY)/otel/semconvgen:$(SEMCONVGEN_VERSION)

# TODO: add `yamllint` step to `all` after making sure it works on Mac.
.PHONY: all
all: install-tools markdownlint markdown-link-check misspell table-check compatibility-check schema-check \
Expand Down Expand Up @@ -52,7 +63,7 @@ markdown-link-check:
# This target runs markdown-toc on all files that contain
# a comment <!-- tocstop -->.
#
# The recommended way to prepate a .md file for markdown-toc is
# The recommended way to prepare a .md file for markdown-toc is
# to add these comments:
#
# <!-- toc -->
Expand Down Expand Up @@ -96,7 +107,7 @@ yamllint:
.PHONY: table-generation
table-generation:
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec -v $(PWD)/templates:/weaver/templates \
otel/weaver:${WEAVER_VERSION} registry update-markdown \
$(WEAVER_CONTAINER) registry update-markdown \
--registry=/source \
--attribute-registry-base-url=/docs/attributes-registry \
--templates=/weaver/templates \
Expand All @@ -107,7 +118,7 @@ table-generation:
.PHONY: attribute-registry-generation
attribute-registry-generation:
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec -v $(PWD)/templates:/weaver/templates \
otel/weaver:${WEAVER_VERSION} registry generate \
$(WEAVER_CONTAINER) registry generate \
--registry=/source \
--templates=/weaver/templates \
markdown \
Expand All @@ -118,19 +129,33 @@ attribute-registry-generation:
.PHONY: table-check
table-check:
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec -v $(PWD)/templates:/weaver/templates \
otel/weaver:${WEAVER_VERSION} registry update-markdown \
$(WEAVER_CONTAINER) registry update-markdown \
--registry=/source \
--attribute-registry-base-url=/docs/attributes-registry \
--templates=/weaver/templates \
--target=markdown \
--dry-run \
/spec

LATEST_RELEASED_SEMCONV_VERSION := $(shell git describe --tags --abbrev=0 | sed 's/v//g')

# A previous iteration of calculating "LATEST_RELEASED_SEMCONV_VERSION"
# relied on "git describe". However, that approach does not work with
# light-weight developer forks/branches that haven't synced tags. Hence the
# more complex implementation of this using "git ls-remote".
#
# The output of "git ls-remote" looks something like this:
#
# e531541025992b68177a68b87628c5dc75c4f7d9 refs/tags/v1.21.0
# cadfe53949266d33476b15ca52c92f682600a29c refs/tags/v1.22.0
# ...
#
# .. which is why some additional processing is required to extract the
# latest version number and strip off the "v" prefix.
LATEST_RELEASED_SEMCONV_VERSION := $(shell git ls-remote --tags https://github.com/open-telemetry/semantic-conventions.git | cut -f 2 | sort --reverse | head -n 1 | tr '/' ' ' | cut -d ' ' -f 3 | sed 's/v//g')
.PHONY: compatibility-check
compatibility-check:
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec --pull=always \
otel/semconvgen:$(SEMCONVGEN_VERSION) -f /source compatibility --previous-version $(LATEST_RELEASED_SEMCONV_VERSION)
$(SEMCONVGEN_CONTAINER) -f /source compatibility --previous-version $(LATEST_RELEASED_SEMCONV_VERSION)

.PHONY: schema-check
schema-check:
Expand Down
1 change: 1 addition & 0 deletions docs/attributes-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Currently, the following namespaces exist:
- [File](file.md)
- [GCP](gcp.md)
- [Gen AI](gen-ai.md)
- [Go](go.md)
- [GraphQL](graphql.md)
- [Heroku](heroku.md)
- [Host](host.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/attributes-registry/cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The following well-known definitions MUST be used if you set this attribute and
- **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
Take care not to use the "invoked ARN" directly but replace any
[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
with the resolved function version, as the same runtime instance may be invokable with
with the resolved function version, as the same runtime instance may be invocable with
multiple different aliases.
- **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
- **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function,
Expand Down
24 changes: 24 additions & 0 deletions docs/attributes-registry/go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--- Hugo front matter used to generate the website version of this page:
--->

<!-- NOTE: THIS FILE IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/attribute_namespace.md.j2 -->

# Go

## Go Attributes

This document defines Go related attributes.

| Attribute | Type | Description | Examples | Stability |
| ---------------- | ------ | ------------------- | ---------------- | ---------------------------------------------------------------- |
| `go.memory.type` | string | The type of memory. | `other`; `stack` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`go.memory.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| ------- | ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `stack` | Memory allocated from the heap that is reserved for stack space, whether or not it is currently in-use. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `other` | Memory used by the Go runtime, excluding other categories of memory usage described in this enumeration. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** Computed from `/memory/classes/heap/stacks:bytes`.
1 change: 1 addition & 0 deletions docs/attributes-registry/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Kubernetes resource attributes.
| `k8s.cluster.uid` | string | A pseudo-ID for the cluster, set to the UID of the `kube-system` namespace. [1] | `218fc5a9-a5f1-4b54-aa05-46717d0ab26d` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.container.name` | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.container.restart_count` | int | Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. | | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.container.status.current_waiting_reason` | string | Current waiting reason of the Container. | `CrashLoopBackOff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.container.status.last_terminated_reason` | string | Last terminated reason of the Container. | `Evicted`; `Error` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.cronjob.name` | string | The name of the CronJob. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.cronjob.uid` | string | The UID of the CronJob. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand Down
2 changes: 1 addition & 1 deletion docs/faas/faas-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The following well-known definitions MUST be used if you set this attribute and
* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
Take care not to use the "invoked ARN" directly but replace any
[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
with the resolved function version, as the same runtime instance may be invokable with
with the resolved function version, as the same runtime instance may be invocable with
multiple different aliases.
* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function,
Expand Down
2 changes: 1 addition & 1 deletion docs/general/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ over all attribute values SHOULD be equal to the **limit**.
out of its **limit** should be called `entity.utilization`. For example,
`system.memory.utilization` for the fraction of memory in use. Utilization can
be with respect to a fixed limit or a soft limit. Utilization values are
represended as a ratio and are typically in the range `[0, 1]`, but may go above 1
represented as a ratio and are typically in the range `[0, 1]`, but may go above 1
in case of exceeding a soft limit.

- **time** - an instrument that measures passage of time should be called
Expand Down
2 changes: 1 addition & 1 deletion docs/general/trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aliases: [docs/specs/semconv/general/trace-general]

**Status**: [Mixed][DocumentStatus]

In OpenTelemetry spans can be created freely and it’s up to the implementor to
In OpenTelemetry spans can be created freely and it’s up to the implementer to
annotate them with attributes specific to the represented operation. Spans
represent specific operations in and between systems. Some of these operations
represent calls that use well-known protocols like HTTP or database calls.
Expand Down
2 changes: 1 addition & 1 deletion docs/resource/cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The following well-known definitions MUST be used if you set this attribute and
* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
Take care not to use the "invoked ARN" directly but replace any
[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
with the resolved function version, as the same runtime instance may be invokable with
with the resolved function version, as the same runtime instance may be invocable with
multiple different aliases.
* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function,
Expand Down
2 changes: 1 addition & 1 deletion docs/resource/faas.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The following well-known definitions MUST be used if you set this attribute and
* **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).
Take care not to use the "invoked ARN" directly but replace any
[alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
with the resolved function version, as the same runtime instance may be invokable with
with the resolved function version, as the same runtime instance may be invocable with
multiple different aliases.
* **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)
* **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) of the invoked function,
Expand Down
1 change: 1 addition & 0 deletions docs/resource/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ to a running container.
|---|---|---|---|---|---|
| [`k8s.container.name`](/docs/attributes-registry/k8s.md) | string | The name of the Container from Pod specification, must be unique within a Pod. Container runtime usually uses different globally unique name (`container.name`). | `redis` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.container.restart_count`](/docs/attributes-registry/k8s.md) | int | Number of times the container was restarted. This attribute can be used to identify a particular container (running or stopped) within a container spec. | | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.container.status.current_waiting_reason`](/docs/attributes-registry/k8s.md) | string | Current waiting reason of the Container. | `CrashLoopBackOff` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`k8s.container.status.last_terminated_reason`](/docs/attributes-registry/k8s.md) | string | Last terminated reason of the Container. | `Evicted`; `Error` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |


Expand Down
1 change: 1 addition & 0 deletions docs/runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Also consider the
semantic conventions when instrumenting runtime environments.

- [JVM](jvm-metrics.md)
- [Go](go-metrics.md)

### Attributes

Expand Down
Loading

0 comments on commit 1c0616d

Please sign in to comment.