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

feat: Add Stomp (Active MQ) output plugin #7995

Merged
merged 9 commits into from
Jul 14, 2022
Merged

Conversation

amus-sal
Copy link
Contributor

@amus-sal amus-sal commented Aug 17, 2020

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

Copy link
Contributor

@ssoroka ssoroka left a comment

Choose a reason for hiding this comment

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

Thanks for the new plugin! I have some change requests for you.

plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp_test.go Show resolved Hide resolved
@amus-sal amus-sal requested a review from ssoroka August 19, 2020 09:35
Copy link
Contributor

@ssoroka ssoroka left a comment

Choose a reason for hiding this comment

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

Just needs work for certificate support

plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
@ssoroka
Copy link
Contributor

ssoroka commented Sep 10, 2020

Readme format indentation doesn't match existing examples. Still needs more tests. (minimum one green-path test that runs as -short)

@amus-sal
Copy link
Contributor Author

ust needs work for certificate support

I need more info, i think I follow the implementation of the plugin "mqtt" in correct way .

@amus-sal
Copy link
Contributor Author

minimum one green-path test that runs as -short)

for the test case , I have already added the min test case with green path.

plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp_test.go Show resolved Hide resolved
@ssoroka
Copy link
Contributor

ssoroka commented Oct 7, 2020

Your test case is skipped when testing.Short() is true. This means most of the time zero test cases will run as part of the automated test suite, and you can't be sure that future changes won't break things.

@AShabana
Copy link

AShabana commented Nov 5, 2020

Hi all , Did anyone managed to solve the merge conflict ?

@sjwang90 sjwang90 added the plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins label Jan 22, 2021
@amus-sal amus-sal changed the title Add Stomp (Active MQ) output plugin featAdd Stomp (Active MQ) output plugin Dec 8, 2021
@amus-sal amus-sal changed the title featAdd Stomp (Active MQ) output plugin Feat: Add Stomp (Active MQ) output plugin Dec 8, 2021
@amus-sal amus-sal changed the title Feat: Add Stomp (Active MQ) output plugin feat: Add Stomp (Active MQ) output plugin Dec 8, 2021
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @amus-sal for this plugin! I have some comments and want to ask you if there is a way to mockup the ActiveMQ side for unit-testing. It would be nice to test of metrics are sent in shorttesting mode...

docs/LICENSE_OF_DEPENDENCIES.md Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
plugins/outputs/stomp/README.md Outdated Show resolved Hide resolved
plugins/outputs/stomp/README.md Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp_test.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp_test.go Outdated Show resolved Hide resolved
@srebhan srebhan self-assigned this Dec 20, 2021
@srebhan
Copy link
Member

srebhan commented Feb 4, 2022

@amus-sal any news here?

@amus-sal
Copy link
Contributor Author

amus-sal commented Feb 8, 2022

update with the required comments

@amus-sal amus-sal requested a review from srebhan February 8, 2022 14:52
@amus-sal
Copy link
Contributor Author

amus-sal commented Feb 8, 2022

@srebhan check now

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks for the update @amus-sal! I have some more comments. Please also check the linter warnings. You can check those offline using make lint-branch and use markdownlint on your README.md file.

plugins/outputs/stomp/README.md Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
@amus-sal
Copy link
Contributor Author

Thanks @srebhan, check the updated pr with your suggestions

@amus-sal amus-sal requested a review from srebhan March 10, 2022 14:18
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Nice update @amus-sal! I have some more smaller comments... Please take a look.

plugins/outputs/stomp/README.md Show resolved Hide resolved
Comment on lines 18 to 19
Username string `toml:"username,omitempty"`
Password string `toml:"password,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the omitempty setting

Suggested change
Username string `toml:"username,omitempty"`
Password string `toml:"password,omitempty"`
Username string `toml:"username"`
Password string `toml:"password"`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need them as there are versions of AMQ supports integration without authentication.

Copy link
Member

Choose a reason for hiding this comment

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

Well that's true, but in any case the value will be nil which means an empty string. omitempty only has an effect when serializing this struct which should never be the case actually.

plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Show resolved Hide resolved
plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
plugins/outputs/stomp/stomp_test.go Outdated Show resolved Hide resolved
@amus-sal
Copy link
Contributor Author

Check now

@amus-sal amus-sal requested a review from srebhan March 11, 2022 11:23
@amus-sal
Copy link
Contributor Author

any updates ?

@amus-sal
Copy link
Contributor Author

any updates regarding my PR ?

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Hey @amus-sal, sorry the late reply and thanks for the nice update. I have three minor comments but we are very close...

plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
Comment on lines 18 to 19
Username string `toml:"username,omitempty"`
Password string `toml:"password,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Well that's true, but in any case the value will be nil which means an empty string. omitempty only has an effect when serializing this struct which should never be the case actually.

plugins/outputs/stomp/stomp.go Outdated Show resolved Hide resolved
@powersj
Copy link
Contributor

powersj commented Jun 17, 2022

Take a look at https://github.com/influxdata/telegraf/pull/7995/files if shows 23 files are changed. When you are only adding two originally. It does look like those other files contain changes we added recently.

@amus-sal
Copy link
Contributor Author

Take a look at https://github.com/influxdata/telegraf/pull/7995/files if shows 23 files are changed. When you are only adding two originally. It does look like those other files contain changes we added recently.

I did fetch upstream with the original repo and this is the output correct me if I am wrong is this right step ?

@sspaink
Copy link
Contributor

sspaink commented Jun 29, 2022

@amus-sal looks like there are changes in this pull request that are unrelated to your Stomp output plugin, usually rebasing vs merging your changes avoids this I think. What I recommend doing is to save your changes, copy your Stomp output plugin into a separate directory and perhaps also copy this branch just in case. Then reset your branch to master, then copy your output plugin back into the branch and force push your changes. This should essentially be a manual rebase, let me know if that makes sense or if you need more help!

@srebhan
Copy link
Member

srebhan commented Jul 4, 2022

@amus-sal I think your rebase went out-of-control. I suggest you save your plugin code and reset your branch to master. Then add the plugin back in. Let me know if you need help!

@amus-sal amus-sal reopened this Jul 4, 2022
@amus-sal
Copy link
Contributor Author

amus-sal commented Jul 4, 2022

can you check it now ?

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Looks much better! Thanks for the update @amus-sal.

@srebhan srebhan requested a review from powersj July 5, 2022 14:51
go.mod Outdated
@@ -406,3 +406,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)

require github.com/go-stomp/stomp v2.1.4+incompatible // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

The linter is failing and I think its because of this, when I locally run go mod tidy it removes the // indirect comment and that seems to fix it. Could you also move this to be inside the require block instead of on its own? Locally when I run go mod tidy it puts it in line 65

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but indirect related to the state if using the lib inside the module but I did an update for it but still exist, I think the problems that the plugin path "o export data for "github.com/influxdata/telegraf/plugins/outputs/stomp"\n\n" "is not yet pushed to remote repo. btw I run Golangci-lint locally and it works well with both

@srebhan
Copy link
Member

srebhan commented Jul 7, 2022

@amus-sal did you run make tidy before pushing?

@amus-sal
Copy link
Contributor Author

amus-sal commented Jul 8, 2022

yes I did and no changes found

@amus-sal
Copy link
Contributor Author

any help in that ?

@srebhan
Copy link
Member

srebhan commented Jul 11, 2022

@amus-sal I see you referenced a sample.conf file (the one that is embedded into your plugin code), but there is none in your PR. Did you maybe forget to check that in?

@amus-sal
Copy link
Contributor Author

I have added the sample confirmation and did make tidy and the error of lint plugin is related to other input plugins, can you check please ?

@powersj
Copy link
Contributor

powersj commented Jul 13, 2022

Hi @amus-sal,

Thanks for all the work on this PR! We are nearly there.

@sspaink got tests running, and it looks like there is a missing license now in the docs/LICENSE_OF_DEPENDENCIES.md file because of pulling in go-stomp/stomp as a direct dependency:

@@ -108,0 +109 @@
+github.com/go-stomp/stomp [Apache License 2.0](https://github.com/go-stomp/stomp/blob/master/LICENSE.txt)

Can you add that package and specify it uses the Apache License 2.0 license?

Thanks!

@powersj
Copy link
Contributor

powersj commented Jul 14, 2022

Thanks for all the work on this!

@powersj powersj merged commit b0819ba into influxdata:master Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new plugin plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants