-
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
Merged
MovieStoreGuy
merged 24 commits into
open-telemetry:main
from
rogercoll:add_podman_metadata
Apr 9, 2024
Merged
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
cbeaf84
feat: add Podman receiver metadata
rogercoll b9a3406
docs: add change log file
rogercoll 78901ea
fix: gci linter
rogercoll 64c0efc
fix: tidy module file
rogercoll 5455ff6
fix: spelling mistake
rogercoll b9935f8
fix: allow container duplicated metrics
rogercoll df281be
fix: use "By" unit type for memory metrics
rogercoll d528755
Merge branch 'main' into add_podman_metadata
rogercoll 5f3528c
docs: fix blkio metric kernel documentation url
rogercoll befc88c
Update cmd/mdatagen/validate_test.go
rogercoll 6c37699
Merge branch 'main' into add_podman_metadata
rogercoll 0cbdc4e
Merge branch 'main' into add_podman_metadata
rogercoll 1bd427e
Merge branch 'main' into add_podman_metadata
rogercoll 0032f70
Merge branch 'main' into add_podman_metadata
rogercoll afce91c
Merge branch 'main' into add_podman_metadata
rogercoll a5a0099
feat: move cpu usage metrics to seconds
rogercoll 65cf771
Merge branch 'main' into add_podman_metadata
rogercoll 91e24ff
rollback fix for networking tx/rx metrics
rogercoll b2ed9a8
Merge branch 'main' into add_podman_metadata
rogercoll fa12570
Merge branch 'main' into add_podman_metadata
rogercoll 6d89c48
Merge branch 'main' into add_podman_metadata
rogercoll 70d142c
Merge branch 'main' into add_podman_metadata
rogercoll 384cb7d
update changelog with breaking changes
rogercoll 0dfb234
Merge branch 'main' into add_podman_metadata
rogercoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
||
# 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: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| s | 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 | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| s | Sum | Int | Cumulative | true | | ||
|
||
### container.cpu.usage.total | ||
|
||
Total CPU time consumed. | ||
|
||
| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic | | ||
| ---- | ----------- | ---------- | ----------------------- | --------- | | ||
| s | 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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
opentelemetry-collector-contrib/receiver/podmanreceiver/documentation.md
Lines 65 to 71 in 91e24ff
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 comment
The 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 comment
The 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)