Skip to content

Commit

Permalink
Merge main - Fix test policies to not conflict.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsuereth committed Aug 16, 2024
2 parents 1a77174 + b6793e2 commit 5fa1fbd
Show file tree
Hide file tree
Showing 22 changed files with 476 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .chloggen/1290.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: enhancement
component: db
note: Change description of `db.client.connection.pending_requests` from cumulative to current value
issues: [ 1290 ]
22 changes: 22 additions & 0 deletions .chloggen/add_k8s_cpu_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: 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.pod.cpu.time`, `k8s.pod.cpu.usage`, `k8s.node.cpu.time`, `k8s.node.cpu.usage` 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: [1320]

# (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/add_k8s_volume_type.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: Adds `k8s.volume.name` and `k8s.volume.type` attributes to the registry

# 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: [1164]

# (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:
17 changes: 17 additions & 0 deletions .chloggen/nodejs-runtime-utilization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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: nodejs

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Adding `nodejs.eventloop.time` metric to Node.js 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: [1259]
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ body:
- area:log
- area:messaging
- area:network
- area:nodejs
- area:oci
- area:opentracing
- area:os
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 @@ -51,6 +51,7 @@ body:
- area:log
- area:messaging
- area:network
- area:nodejs
- area:oci
- area:opentracing
- area:os
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 @@ -60,6 +60,7 @@ body:
- area:log
- area:messaging
- area:network
- area:nodejs
- area:oci
- area:opentracing
- area:os
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ SEMCONVGEN_VERSION=0.25.0
# see https://github.com/open-telemetry/weaver/releases for weaver updates
WEAVER_VERSION=0.8.0

OPA_POLICY_AGENT_VERSION=0.67.1

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

Expand Down Expand Up @@ -224,6 +226,14 @@ check-policies:
--baseline-registry=https://github.com/open-telemetry/semantic-conventions/archive/refs/tags/v$(LATEST_RELEASED_SEMCONV_VERSION).zip[model] \
--policy=/policies

# Test rego policies
.PHONY: test-policies
test-policies:
docker run --rm -v $(PWD)/policies:/policies -v $(PWD)/policies_test:/policies_test \
openpolicyagent/opa:${OPA_POLICY_AGENT_VERSION} test \
--explain fails \
/policies /policies_test

# TODO: This is now duplicative with weaver policy checks. We can remove
# once github action requirements are updated.
.PHONY: compatibility-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 @@ -72,6 +72,7 @@ Currently, the following namespaces exist:
- [Log](log.md)
- [Messaging](messaging.md)
- [Network](network.md)
- [NodeJS](nodejs.md)
- [OCI](oci.md)
- [OpenTracing](opentracing.md)
- [OS](os.md)
Expand Down
13 changes: 13 additions & 0 deletions docs/attributes-registry/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Kubernetes resource attributes.
| `k8s.replicaset.uid` | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.statefulset.name` | string | The name of the StatefulSet. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.statefulset.uid` | string | The UID of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.volume.name` | string | The name of the K8s volume. | `volume0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `k8s.volume.type` | string | The type of the K8s volume. | `emptyDir`; `persistentVolumeClaim` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** K8s doesn't have support for obtaining a cluster ID. If this is ever
added, we will recommend collecting the `k8s.cluster.uid` through the
Expand All @@ -63,6 +65,17 @@ Which states:
Therefore, UIDs between clusters should be extremely unlikely to
conflict.

`k8s.volume.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 |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `configMap` | A [configMap](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `downwardAPI` | A [downwardAPI](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `emptyDir` | An [emptyDir](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `local` | A [local](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#local) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `persistentVolumeClaim` | A [persistentVolumeClaim](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `secret` | A [secret](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#secret) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

## Deprecated Kubernetes Attributes

Describes deprecated k8s attributes.
Expand Down
22 changes: 22 additions & 0 deletions docs/attributes-registry/nodejs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--- 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 -->

# NodeJS

## Node.js Attributes

Describes Node.js related attributes.

| Attribute | Type | Description | Examples | Stability |
| ------------------------ | ------ | ----------------------------- | ---------------- | ---------------------------------------------------------------- |
| `nodejs.eventloop.state` | string | The state of event loop time. | `active`; `idle` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`nodejs.eventloop.state` 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 |
| -------- | ------------ | ---------------------------------------------------------------- |
| `active` | Active time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `idle` | Idle time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
2 changes: 1 addition & 1 deletion docs/attributes-registry/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ An operating system process.

| Attribute | Type | Description | Examples | Stability |
| ----------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------- |
| `args_count` | int | Length of the process.command_args array [1] | `4` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process.args_count` | int | Length of the process.command_args array [1] | `4` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process.command` | string | The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. | `cmd/otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process.command_args` | string[] | All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. | `["cmd/otecol", "--config=config.yaml"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `process.command_line` | string | The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. | `C:\cmd\otecol --config="my directory\config.yaml"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Expand Down
2 changes: 1 addition & 1 deletion docs/database/database-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ This metric is [recommended][MetricRecommended].

| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `db.client.connection.pending_requests` | UpDownCounter | `{request}` | The number of pending requests for an open connection, cumulative for the entire pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `db.client.connection.pending_requests` | UpDownCounter | `{request}` | The number of current pending requests for an open connection | ![Experimental](https://img.shields.io/badge/-experimental-blue) |


<!-- markdownlint-restore -->
Expand Down
53 changes: 52 additions & 1 deletion docs/runtime/nodejs-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This document describes semantic conventions for Node.js Runtime metrics in Open
- [Metric: `nodejs.eventloop.delay.p90`](#metric-nodejseventloopdelayp90)
- [Metric: `nodejs.eventloop.delay.p99`](#metric-nodejseventloopdelayp99)
- [Metric: `nodejs.eventloop.utilization`](#metric-nodejseventlooputilization)
- [Metric: `nodejs.eventloop.time`](#metric-nodejseventlooptime)

<!-- tocstop -->

Expand Down Expand Up @@ -316,7 +317,7 @@ This metric is [recommended][MetricRecommended].
| `nodejs.eventloop.utilization` | Gauge | `1` | Event loop utilization. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |


**[1]:** The value range is [0.0,1.0] and can be retrieved from value [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2)
**[1]:** The value range is [0.0, 1.0] and can be retrieved from [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2)



Expand All @@ -333,6 +334,56 @@ This metric is [recommended][MetricRecommended].
<!-- markdownlint-disable -->


<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Metric: `nodejs.eventloop.time`

This metric is [recommended][MetricRecommended].

<!-- semconv metric.nodejs.eventloop.time(metric_table) -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `nodejs.eventloop.time` | Counter | `s` | Cumulative duration of time the event loop has been in each state. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |


**[1]:** Value can be retrieved from [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2)



<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

<!-- semconv metric.nodejs.eventloop.time(full) -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`nodejs.eventloop.state`](/docs/attributes-registry/nodejs.md) | string | The state of event loop time. | `active`; `idle` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

`nodejs.eventloop.state` 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 |
|---|---|---|
| `active` | Active time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `idle` | Idle time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |



<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
Expand Down
Loading

0 comments on commit 5fa1fbd

Please sign in to comment.