Skip to content

Commit

Permalink
Fix empty measurement field causing agent crash (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhihonl authored Nov 3, 2023
1 parent 38a4016 commit 3628565
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions translator/translate/otel/receiver/adapter/translators.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ func fromInputs(conf *confmap.Conf, validInputs map[string]bool, baseKey string)
if skipInputSet.Contains(inputName) {
// logs agent is separate from otel agent
continue
} else if measurement := common.GetArray[any](conf, common.ConfigKey(cfgKey, common.MeasurementKey)); measurement != nil && len(measurement) == 0 {
log.Printf("W! Agent will not emit any metrics for %s due to empty measurement field ", inputName)
continue
} else if multipleInputSet.Contains(inputName) {
translators.Merge(fromMultipleInput(conf, inputName, ""))
} else {
Expand Down

0 comments on commit 3628565

Please sign in to comment.