diff --git a/.chloggen/msg_hotfix-flinkmetrics.yaml b/.chloggen/msg_hotfix-flinkmetrics.yaml new file mode 100755 index 000000000000..7278e925db68 --- /dev/null +++ b/.chloggen/msg_hotfix-flinkmetrics.yaml @@ -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: diff --git a/receiver/flinkmetricsreceiver/process.go b/receiver/flinkmetricsreceiver/process.go index f04e46d78401..f208c500b581 100644 --- a/receiver/flinkmetricsreceiver/process.go +++ b/receiver/flinkmetricsreceiver/process.go @@ -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":