Skip to content

Commit

Permalink
[chore] fix pod and container metadata to include parent and units (#…
Browse files Browse the repository at this point in the history
…23795)

**Description:**
Add parent information to pod and container metadata.

**Link to tracking Issue:**
Fixes #23793
  • Loading branch information
atoulme authored Jun 27, 2023
1 parent c4dd245 commit 7a1061d
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 24 deletions.
18 changes: 10 additions & 8 deletions receiver/k8sclusterreceiver/internal/container/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# k8s/container

**Parent Component:** k8s_cluster

## Default Metrics

The following metrics are emitted by default. Each of them can be disabled by applying the following configuration:
Expand All @@ -18,47 +20,47 @@ Maximum resource limit set for the container. See https://kubernetes.io/docs/ref
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Double |
| {cpu} | Gauge | Double |
### k8s.container.cpu_request
Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Double |
| {cpu} | Gauge | Double |
### k8s.container.ephemeralstorage_limit
Maximum resource limit set for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Int |
| By | Gauge | Int |
### k8s.container.ephemeralstorage_request
Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Int |
| By | Gauge | Int |
### k8s.container.memory_limit
Maximum resource limit set for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Int |
| By | Gauge | Int |
### k8s.container.memory_request
Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Int |
| By | Gauge | Int |
### k8s.container.ready
Expand All @@ -82,15 +84,15 @@ Maximum resource limit set for the container. See https://kubernetes.io/docs/ref
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Int |
| By | Gauge | Int |
### k8s.container.storage_request
Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| | Gauge | Int |
| By | Gauge | Int |
## Resource Attributes
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions receiver/k8sclusterreceiver/internal/container/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ type: k8s/container

sem_conv_version: 1.18.0

parent: k8s_cluster

resource_attributes:
container.id:
description: The container id.
Expand Down Expand Up @@ -52,41 +54,49 @@ metrics:
k8s.container.cpu_request:
enabled: true
description: Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
unit: "{cpu}"
gauge:
value_type: double
k8s.container.cpu_limit:
enabled: true
description: Maximum resource limit set for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
unit: "{cpu}"
gauge:
value_type: double
k8s.container.memory_request:
enabled: true
description: Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
unit: "By"
gauge:
value_type: int
k8s.container.memory_limit:
enabled: true
description: Maximum resource limit set for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
unit: "By"
gauge:
value_type: int
k8s.container.storage_request:
enabled: true
description: Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
unit: "By"
gauge:
value_type: int
k8s.container.storage_limit:
enabled: true
description: Maximum resource limit set for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
unit: "By"
gauge:
value_type: int
k8s.container.ephemeralstorage_request:
enabled: true
description: Resource requested for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
unit: "By"
gauge:
value_type: int
k8s.container.ephemeralstorage_limit:
enabled: true
description: Maximum resource limit set for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
unit: "By"
gauge:
value_type: int
k8s.container.restarts:
Expand Down
2 changes: 2 additions & 0 deletions receiver/k8sclusterreceiver/internal/pod/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# k8s/pod

**Parent Component:** k8s_cluster

## Default Metrics

The following metrics are emitted by default. Each of them can be disabled by applying the following configuration:
Expand Down
2 changes: 2 additions & 0 deletions receiver/k8sclusterreceiver/internal/pod/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ type: k8s/pod

sem_conv_version: 1.18.0

parent: k8s_cluster

resource_attributes:
k8s.namespace.name:
description: The k8s namespace name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ resourceMetrics:
dataPoints:
- asDouble: 10
name: k8s.container.cpu_request
unit: "{cpu}"
- description: Maximum resource limit set for the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#resourcerequirements-v1-core for details
gauge:
dataPoints:
- asDouble: 20
name: k8s.container.cpu_limit
unit: "{cpu}"
scope:
name: otelcol/k8sclusterreceiver
version: latest
Loading

0 comments on commit 7a1061d

Please sign in to comment.