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

add docs on what privileges are needed for using metricbeat mongodb module #13932

Merged
merged 13 commits into from
Oct 22, 2019

Conversation

hwang381
Copy link
Contributor

@hwang381 hwang381 commented Oct 6, 2019

resolves #13820

@hwang381 hwang381 requested a review from a team as a code owner October 6, 2019 05:30
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

1 similar comment
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@ChrsMark
Copy link
Member

ChrsMark commented Oct 7, 2019

Hi @hwang381 thanks for working on this! In order to fix the failing test we need to execute make update under beats/metricbeat path.

In addition, I think we should also mention these privileges on each Metricset's documentation explicitly, for instance at https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-metricset-mongodb-collstats.html we could mention that top command requires "top action on cluster resource".

@hwang381
Copy link
Contributor Author

hwang381 commented Oct 7, 2019

Thanks for the feedback @ChrsMark

Regard documenting the privileges needed for every metricset in their respective doc page, do you think it would be better idea to just put the documentation in the respective metricset doc instead of putting it in the general module documentation?

Copy link
Member

@ChrsMark ChrsMark 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 addressing the comments @hwang381, it looks great now!

From my side it is ok! @jsoriano since you had the initial discussion on the issue wdyt?

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

It looks good to me, I have only added some comments about punctuation.

@hwang381 did you have the chance of testing these privileges with metricbeat and a running MongoDB?

metricbeat/module/mongodb/_meta/docs.asciidoc Outdated Show resolved Hide resolved
metricbeat/module/mongodb/_meta/docs.asciidoc Outdated Show resolved Hide resolved
metricbeat/module/mongodb/collstats/_meta/docs.asciidoc Outdated Show resolved Hide resolved
@ChrsMark
Copy link
Member

ChrsMark commented Oct 9, 2019

@hwang381 thanks for your work on this!

After revisiting the issue and mongodb docs your patch refers to, I would propose to add small snippets on each metricset's docs which will show how one can create users and grant the right privileges on them. For example on collstats I would add:

Create user with proper privileges for the metricset

Create the role

db.createRole(
   {
     role: "collstatsRole",
     privileges: [
       { resource: { cluster: true }, actions: [ "top"] },
     ],
     roles: []
   }
)

create the privileged user

db.createUser(
    {
        user: "beatstop",
        pwd: "pass",
        roles: [ "collstatsRole"]
    }
)

So, the users will be able to easily create the mongo-user required to run the spesific metricset, but also we would be able to confirm that the privileges we document will do the job.

Let me know what you think! @jsoriano feel free to add/comment on anything!

@jsoriano
Copy link
Member

jsoriano commented Oct 9, 2019

After revisiting the issue and mongodb docs your patch refers to, I would propose to add small snippets on each metricset's docs which will show how one can create users and grant the right privileges on them.

+1 to that, maybe we can also add an example with a role with all the privileges in the module docs.

@hwang381
Copy link
Contributor Author

I've integrated all the above suggestions :)

@jsoriano
Copy link
Member

ok to test

@jsoriano jsoriano added needs_backport PR is waiting to be backported to other branches. v7.4.2 v7.5.0 v6.8.5 labels Oct 21, 2019
@ChrsMark
Copy link
Member

jenkins, test this again please

@ChrsMark
Copy link
Member

ChrsMark commented Oct 22, 2019

I think that failing tests are irrelevant but we could wait until #14179 is merged which might make CI happy. wdyt @jsoriano?

@jsoriano
Copy link
Member

@ChrsMark I think we can merge this, metricbeat builds are green.

@ChrsMark
Copy link
Member

I will go along and merge this!

Thank you @hwang381 for working on this!

@ChrsMark ChrsMark merged commit 324e9a4 into elastic:master Oct 22, 2019
ChrsMark pushed a commit to ChrsMark/beats that referenced this pull request Oct 22, 2019
@ChrsMark ChrsMark removed the needs_backport PR is waiting to be backported to other branches. label Oct 22, 2019
ChrsMark pushed a commit to ChrsMark/beats that referenced this pull request Oct 22, 2019
ChrsMark pushed a commit to ChrsMark/beats that referenced this pull request Oct 22, 2019
ChrsMark pushed a commit to ChrsMark/beats that referenced this pull request Oct 22, 2019
ChrsMark added a commit that referenced this pull request Oct 22, 2019
ChrsMark added a commit that referenced this pull request Oct 23, 2019
ChrsMark added a commit that referenced this pull request Oct 23, 2019
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document privileges needed to use Metricbeat MongoDB module
6 participants