Skip to content

Commit

Permalink
[chore] Fix failing test case for flinkmetrics (open-telemetry#23143)
Browse files Browse the repository at this point in the history
On failure to read job metrics, this type can be nil causing a panic.
  • Loading branch information
MovieStoreGuy authored Jun 6, 2023
1 parent 4ed6328 commit e4c3488
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .chloggen/msg_hotfix-flinkmetrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use this changelog template to create an entry for release notes.
# If your change doesn't affect end users, such as a test fix or a tooling change,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: flink metrics receiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Fixed error when failing to read job manager metrics

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [23143]

# (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:
3 changes: 3 additions & 0 deletions receiver/flinkmetricsreceiver/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
)

func (s *flinkmetricsScraper) processJobmanagerMetrics(now pcommon.Timestamp, jobmanagerMetrics *models.JobmanagerMetrics) {
if jobmanagerMetrics == nil {
return
}
for _, metric := range jobmanagerMetrics.Metrics {
switch metric.ID {
case "Status.JVM.CPU.Load":
Expand Down

0 comments on commit e4c3488

Please sign in to comment.