Skip to content

Commit

Permalink
rollback fix for networking tx/rx metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Jan 27, 2024
1 parent 65cf771 commit 91e24ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .chloggen/add_podman_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ change_type: enhancement
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"
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]
Expand Down
4 changes: 2 additions & 2 deletions receiver/podmanreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ func (r *metricsReceiver) recordCPUMetrics(now pcommon.Timestamp, stats *contain
}

func (r *metricsReceiver) recordNetworkMetrics(now pcommon.Timestamp, stats *containerStats) {
r.mb.RecordContainerNetworkIoUsageRxBytesDataPoint(now, int64(stats.NetInput))
r.mb.RecordContainerNetworkIoUsageTxBytesDataPoint(now, int64(stats.NetOutput))
r.mb.RecordContainerNetworkIoUsageRxBytesDataPoint(now, int64(stats.NetOutput))
r.mb.RecordContainerNetworkIoUsageTxBytesDataPoint(now, int64(stats.NetInput))
}

func (r *metricsReceiver) recordMemoryMetrics(now pcommon.Timestamp, stats *containerStats) {
Expand Down
4 changes: 2 additions & 2 deletions receiver/podmanreceiver/record_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ func assertStatsEqualToMetrics(t *testing.T, podmanStats *containerStats, md pme
case "container.memory.percent":
assertMetricEqual(t, m, pmetric.MetricTypeGauge, []point{{doubleVal: podmanStats.MemPerc}})
case "container.network.io.usage.tx_bytes":
assertMetricEqual(t, m, pmetric.MetricTypeSum, []point{{intVal: podmanStats.NetOutput}})
case "container.network.io.usage.rx_bytes":
assertMetricEqual(t, m, pmetric.MetricTypeSum, []point{{intVal: podmanStats.NetInput}})
case "container.network.io.usage.rx_bytes":
assertMetricEqual(t, m, pmetric.MetricTypeSum, []point{{intVal: podmanStats.NetOutput}})

case "container.blockio.io_service_bytes_recursive.write":
assertMetricEqual(t, m, pmetric.MetricTypeSum, []point{{intVal: podmanStats.BlockOutput}})
Expand Down

0 comments on commit 91e24ff

Please sign in to comment.