-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[podmanreceiver] Add metrics and resource metadata #30232
Changes from 12 commits
cbeaf84
b9a3406
78901ea
64c0efc
5455ff6
b9935f8
df281be
d528755
5f3528c
befc88c
6c37699
0cbdc4e
1bd427e
0032f70
afce91c
a5a0099
65cf771
91e24ff
b2ed9a8
fa12570
6d89c48
70d142c
384cb7d
0dfb234
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: podmanreceiver | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: "Adds metrics and resources metadata and fixes invalid mapping of networking input and output metrics" | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [28640] | ||
|
||
# (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: | ||
|
||
# If your change doesn't affect end users or the exported elements of any package, | ||
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. | ||
# Optional: The change log or logs in which this entry should be included. | ||
# e.g. '[user]' or '[user, api]' | ||
# Include 'user' if the change is relevant to end users. | ||
# Include 'api' if there is a change to a library API. | ||
# Default: '[user]' | ||
change_logs: [] |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -108,9 +108,17 @@ func TestValidate(t *testing.T) { | |||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
func TestValidateMetricDuplicates(t *testing.T) { | ||||||||||||||||||||||||||||||
allowedMetrics := map[string][]string{ | ||||||||||||||||||||||||||||||
"container.cpu.utilization": {"docker_stats", "kubeletstats"}, | ||||||||||||||||||||||||||||||
"container.memory.rss": {"docker_stats", "kubeletstats"}, | ||||||||||||||||||||||||||||||
"container.uptime": {"docker_stats", "kubeletstats"}, | ||||||||||||||||||||||||||||||
"container.cpu.utilization": {"docker_stats", "kubeletstats"}, | ||||||||||||||||||||||||||||||
"container.cpu.usage.system": {"docker_stats", "podman_stats"}, | ||||||||||||||||||||||||||||||
"container.cpu.usage.percpu": {"docker_stats", "podman_stats"}, | ||||||||||||||||||||||||||||||
"container.cpu.usage.total": {"docker_stats", "podman_stats"}, | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it okay to report the same metric with different units? As discussed above, on the Docker stats receiver we have nanoseconds opentelemetry-collector-contrib/receiver/dockerstatsreceiver/documentation.md Lines 41 to 47 in facd369
Is that okay? If seconds is the right unit, shouldn't we use it on the Docker stats receiver as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so, I would not use second's precision for the sake of convenience at the expense of precision. Instead, we should endeavor to establish distinct conventions specifically tailored to containers. Should we wait for the container's semantic convention open-telemetry/semantic-conventions#282 (nanoseconds)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
My objection here is with the use of different units on each metric, I would expect them to have the same unit (whether it is nanoseconds or seconds I agree is something we can leave open-telemetry/semantic-conventions#282 to decide on) |
||||||||||||||||||||||||||||||
"container.memory.usage.limit": {"docker_stats", "podman_stats"}, | ||||||||||||||||||||||||||||||
"container.memory.percent": {"docker_stats", "podman_stats"}, | ||||||||||||||||||||||||||||||
"container.memory.usage.total": {"docker_stats", "podman_stats"}, | ||||||||||||||||||||||||||||||
"container.network.io.usage.tx_bytes": {"docker_stats", "podman_stats"}, | ||||||||||||||||||||||||||||||
"container.network.io.usage.rx_bytes": {"docker_stats", "podman_stats"}, | ||||||||||||||||||||||||||||||
"container.memory.rss": {"docker_stats", "kubeletstats"}, | ||||||||||||||||||||||||||||||
"container.uptime": {"docker_stats", "kubeletstats"}, | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
allMetrics := map[string][]string{} | ||||||||||||||||||||||||||||||
err := filepath.Walk("../../receiver", func(path string, info fs.FileInfo, err error) error { | ||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.) | ||
|
||
# podman_stats | ||
|
||
## Default Metrics | ||
|
||
The following metrics are emitted by default. Each of them can be disabled by applying the following configuration: | ||
|
||
```yaml | ||
metrics: | ||
<metric_name>: | ||
enabled: false | ||
``` | ||
|
||
### container.blockio.io_service_bytes_recursive.read | ||
|
||
Number of bytes transferred from the disk by the container | ||
|
||
[More docs](https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt). | ||
|
||
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| {operations} | Sum | Int | Cumulative | true | | ||
|
||
### container.blockio.io_service_bytes_recursive.write | ||
|
||
Number of bytes transferred to the disk by the container | ||
|
||
[More docs](https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt). | ||
|
||
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| {operations} | Sum | Int | Cumulative | true | | ||
|
||
### container.cpu.percent | ||
|
||
Percent of CPU used by the container. | ||
|
||
| Unit | Metric Type | Value Type | | ||
| ---- | ----------- | ---------- | | ||
| 1 | Gauge | Double | | ||
|
||
### container.cpu.usage.percpu | ||
|
||
Total CPU time consumed per CPU-core. | ||
|
||
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| ns | Sum | Int | Cumulative | true | | ||
|
||
#### Attributes | ||
|
||
| Name | Description | Values | | ||
| ---- | ----------- | ------ | | ||
| core | The CPU core number when utilising per-CPU metrics. | Any Str | | ||
|
||
### container.cpu.usage.system | ||
|
||
System CPU usage. | ||
|
||
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| ns | Sum | Int | Cumulative | true | | ||
|
||
### container.cpu.usage.total | ||
|
||
Total CPU time consumed. | ||
|
||
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| ns | Sum | Int | Cumulative | true | | ||
|
||
### container.memory.percent | ||
|
||
Percentage of memory used. | ||
|
||
| Unit | Metric Type | Value Type | | ||
| ---- | ----------- | ---------- | | ||
| 1 | Gauge | Double | | ||
|
||
### container.memory.usage.limit | ||
|
||
Memory limit of the container. | ||
|
||
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| By | Sum | Int | Cumulative | false | | ||
|
||
### container.memory.usage.total | ||
|
||
Memory usage of the container. | ||
|
||
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| By | Sum | Int | Cumulative | false | | ||
|
||
### container.network.io.usage.rx_bytes | ||
|
||
Bytes received by the container. | ||
|
||
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| By | Sum | Int | Cumulative | true | | ||
|
||
### container.network.io.usage.tx_bytes | ||
|
||
Bytes sent by the container. | ||
|
||
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| By | Sum | Int | Cumulative | true | | ||
|
||
## Resource Attributes | ||
|
||
| Name | Description | Values | Enabled | | ||
| ---- | ----------- | ------ | ------- | | ||
| container.id | The ID of the container. | Any Str | true | | ||
| container.image.name | The name of the image in use by the container. | Any Str | true | | ||
| container.name | The name of the container. | Any Str | true | | ||
| container.runtime | The runtime of the container. For this receiver, it will always be 'podman'. | Any Str | true | |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear from the description what metrics and metadata are added. Can we make the migration to metadata.yaml as a no-op change for the end user and handle any other changes separately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense to me, let's make the "networking" changes into another PR. Removed in: 91e24ff