-
Notifications
You must be signed in to change notification settings - Fork 364
fix: Dockerstats receiver otel golden-metrics #2407
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
Open
NSSPKrishna
wants to merge
7
commits into
newrelic:main
Choose a base branch
from
NSSPKrishna:NR-483459
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f61ce0a
fix: Dockerstats receiver otel golden-metrics
7396f8f
Merge branch 'main' into NR-483459
bgalmesnr 77ee972
Merge branch 'main' into NR-483459
lujop 937d018
chore: Summary metrics staging file
7ceea85
Merge branch 'main' into NR-483459
lujop 1dea3a6
chore: Using sum aggregator for the otel queries
6255644
Merge branch 'main' into NR-483459
nr-cmorenoin 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 hidden or 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,46 @@ | ||
| cpuUsage: | ||
| title: CPU usage (cores) | ||
| queries: | ||
| newRelic: | ||
| select: max(docker.container.cpuUsedCores) or max(k8s.container.cpuUsedCores) as 'CPU used cores' | ||
| opentelemetry: | ||
| # Emulate a rate calculation using timestamps to get CPU cores used | ||
| # container.cpu.usage.total is in nanoseconds, divide by 1E9 to get seconds, then by time delta for cores | ||
| # See: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/dockerstatsreceiver/metadata.yaml | ||
| select: (sum(container.cpu.usage.total) / 1E9) / sum((endTimestamp - timestamp) / 1000) AS 'CPU usage (cores)' | ||
| cpuUtilization: | ||
| title: CPU utilization (%) | ||
| unit: PERCENTAGE | ||
| queries: | ||
| newRelic: | ||
| select: max(docker.container.cpuPercent) or max(k8s.container.cpuCoresUtilization) AS 'CPU Utilization (%)' | ||
| opentelemetry: | ||
| # via dockerstatsreceiver & kubeletstatsreceiver – which send equivalent value named container.cpu.usage, container.cpu.utilization (deprecated) | ||
| select: max(container.cpu.usage or container.cpu.utilization) AS 'CPU Utilization (%)' | ||
| memoryUsage: | ||
| title: Memory usage (bytes) | ||
| unit: BYTES | ||
| queries: | ||
| newRelic: | ||
| select: max(docker.container.memoryUsageBytes) or max(docker.container.memoryPrivateWorkingSet) or max(k8s.container.memoryWorkingSetBytes) AS 'Memory used (bytes)' | ||
| opentelemetry: | ||
| # via dockerstatsreceiver OR kubeletstatsreceiver respectively | ||
| select: max(container.memory.usage.total) or max(container.memory.usage) AS 'Memory used (bytes)' | ||
| storageUsage: | ||
| title: Storage usage (bytes) | ||
| unit: BYTES | ||
| queries: | ||
| newRelic: | ||
| select: max(docker.container.ioTotalBytes) or max(k8s.container.fsUsedPercent) AS 'Storage used (bytes)' | ||
| opentelemetry: | ||
| # via dockerstatsreceiver OR kubeletstatsreceiver respectively | ||
| select: max(container.blockio.io_service_bytes_recursive) or max(container.filesystem.usage) AS 'Storage used (bytes)' | ||
| networkTrafficTotal: | ||
| title: Network traffic (bytes per second) | ||
| unit: BYTES_PER_SECOND | ||
| queries: | ||
| newRelic: | ||
| select: max(docker.container.networkRxBytesPerSecond) + max(docker.container.networkTxBytesPerSecond) AS 'Network traffic (bytes per second)' | ||
| opentelemetry: | ||
| # Emulate a rate calculation using timestamps to get bytes per second | ||
| select: (sum(container.network.io.usage.rx_bytes) / sum((endTimestamp - timestamp) / 1000)) + (sum(container.network.io.usage.tx_bytes) / sum((endTimestamp - timestamp) / 1000)) AS 'Network traffic (bytes per second)' | ||
This file contains hidden or 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,25 @@ | ||
| containerState: | ||
| title: Container state | ||
| unit: STRING | ||
| tag: | ||
| key: container.state | ||
| cpuUsage: | ||
| goldenMetric: cpuUsage | ||
| title: CPU usage (cores) | ||
| unit: COUNT | ||
| cpuUtilization: | ||
| goldenMetric: cpuUtilization | ||
| unit: PERCENTAGE | ||
| title: CPU utilization (%) | ||
| storageUsage: | ||
| goldenMetric: storageUsage | ||
| title: Storage usage (bytes) | ||
| unit: BYTES | ||
| memoryUsage: | ||
| goldenMetric: memoryUsage | ||
| title: Memory usage (bytes) | ||
| unit: BYTES | ||
| networkTrafficTotal: | ||
| goldenMetric: networkTrafficTotal | ||
| title: Network traffic (bytes per second) | ||
| unit: BYTES_PER_SECOND |
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 max this way correct, in some places you use the or inside and in others outside?
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.
There are two fields that a customer can set up in their OTel configuration, enabling the ingestion of either or both simultaneously, specifically for the dockerstats receiver. The other queries listed here pertain to metrics from the Kubernetes receiver, which are separate and not currently within scope. Just as a note, this change has already been merged into the main branch.