Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: merge procstat plugin as list, then it will not fail if there ar… #141

Merged
merged 2 commits into from
Dec 14, 2020

Conversation

yimuniao
Copy link
Contributor

…e two procstat plugins defined in different json

Description of the issue

It is to fix: #133
procstat input exists in different json files causes translator failure.

Description of changes

consder procstat as a list, merge all of the porcstat configuration to a list.

Attent: it will not merge the same contents, like following there are two procstat segments, they will merged into one, and finally, there will be 3 procstat plugins. althoughTest1Program exist in two segments, we will not merge two Test1Program into 1.

      "procstat": [{
        "exe": "Test1Program",
        "measurement": [
          "pid_count"
        ]
      }]

and

      "procstat": [
        {
          "exe": "Test1Program",
          "measurement": [
            "pid_count"
          ]
        },
        {
          "exe": "Test2Program",
          "measurement": [
            "pid_count"
          ]
        }]

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

unittest

…e two procstat plugins defined in different json
@@ -39,6 +39,7 @@ var testDataList = []TestData{
{"MixedSection_LogsMetricCollectedConfig", 10, 2, false},
{"SeparateSection_LogsMetricAndLog", 11, 2, false},
{"SeparateSection_PrometheusAndLog", 12, 2, false},
{"SeparateSection_PrometheusAndLog", 13, 2, false},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give the new test a correspond ing name.

@yimuniao yimuniao merged commit e22c7cc into aws:master Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't append procstat to config
2 participants