amazon-cloudwatch-agent icon indicating copy to clipboard operation
amazon-cloudwatch-agent copied to clipboard

change processor to check index

Open ymtaye opened this issue 1 year ago • 2 comments

Description of the issue

The JMX processor was always processing the JMX object as an array. We need to support consider when there is only one JMX object

Description of changes

Changes the processor to set the jmx object based on pipeline index

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

jmx filterprocessor unit test

(24-04-05 16:03:45) <0> [~/workspace/amazon-cloudwatch-agent/translator/translate/otel/processor/jmxfilterprocessor]
dev-dsk-vtayyare-1e-8e662f70 % go test -v
=== RUN   TestTranslator
=== RUN   TestTranslator/ConfigWithJmxTargetNoMetricName
=== RUN   TestTranslator/ConfigWithJmxTargetWithMetricName
=== RUN   TestTranslator/ConfigWithMultipleJmxTargetWithNoMetricName
=== RUN   TestTranslator/ConfigWithMultipleJmxTargetAlternating
=== RUN   TestTranslator/ConfigWithMultiple
=== RUN   TestTranslator/WithCompleteConfig
=== RUN   TestTranslator/ConfigWithNoJmxSet
--- PASS: TestTranslator (0.00s)
    --- PASS: TestTranslator/ConfigWithJmxTargetNoMetricName (0.00s)
    --- PASS: TestTranslator/ConfigWithJmxTargetWithMetricName (0.00s)
    --- PASS: TestTranslator/ConfigWithMultipleJmxTargetWithNoMetricName (0.00s)
    --- PASS: TestTranslator/ConfigWithMultipleJmxTargetAlternating (0.00s)
    --- PASS: TestTranslator/ConfigWithMultiple (0.00s)
    --- PASS: TestTranslator/WithCompleteConfig (0.00s)
    --- PASS: TestTranslator/ConfigWithNoJmxSet (0.00s)
PASS
ok  	github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/processor/jmxfilterprocessor	0.029s

(24-04-05 16:03:49) <0> [~/workspace/amazon-cloudwatch-agent/translator/translate/otel/processor/jmxfilterprocessor]

Requirements

Before commit the code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

ymtaye avatar Mar 29 '24 16:03 ymtaye

This PR was marked stale due to lack of activity.

github-actions[bot] avatar Apr 13 '24 00:04 github-actions[bot]

This PR was marked stale due to lack of activity.

github-actions[bot] avatar May 21 '24 00:05 github-actions[bot]