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 fields to info metricset of Redis module #7695

Merged
merged 20 commits into from Jul 30, 2018
Merged

Add fields to info metricset of Redis module #7695

merged 20 commits into from Jul 30, 2018

Conversation

a3dho3yn
Copy link
Contributor

Memory fragmentation ratio, active defragmentation stats, slave status and some other fields was missing from info metricset.

@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?

@ruflin ruflin requested a review from jsoriano July 24, 2018 13:08
@a3dho3yn a3dho3yn changed the title Add fields to info metricset of Redis module Add fields to info metricset of Redis module Jul 24, 2018
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.

Thanks for these improvements! 🙂

- name: used.rss
type: long
format: bytes
description: >
Used memory rss.

Number of bytes that Redis allocated as seen by the operating system (a.k.a resident set size).
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for these improvements in the descriptions! 🙂

"priority": c.Int("slave_priority", s.Optional),
"is_readonly": c.Bool("slave_read_only", s.Optional),
},
// ToDo find a way to add dynamic object of slaves: "slaves": s.Str("slaveXXX")
Copy link
Member

Choose a reason for hiding this comment

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

Maybe slaves data could be in a specific metricset.

But something interesting we could add here are some aggregated metrics obtained from this list of slaves, like number of slaves in each state, average/min/max lag, min/max offset...

This can be left for another PR in any case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here and in some other scenarios, I need a dynamic array in the schema. Is there any way to do so? Something like this JSON:

{
  "slaves": [
      {
          "host": "localhost:6380",
          "lag": 2
      },
      {
          "host": "localhost:6381",
          "lag": 0
      },   
  ]
}

Copy link
Member

@jsoriano jsoriano Jul 25, 2018

Choose a reason for hiding this comment

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

This kind of structure can be problematic metric-wise, to make it useful, slaves should be a nested object, if not the event would be indexed as something like:

{
  "slaves": {
    "host": ["localhost:6380", "localhost:6381"]
    "lag": [2, 0],
  }  
}

With this it is not possible, or very difficult, to make proper queries with filters or aggregations.

The problem with nested objects is that we are not using them in beats and they would require some additional support, as well as some performance tests. Kibana would also need better support for queries and visualizations on these kind of fields.

This is why I proposed to have an additional metricset, that could have events with fields like:

"slave": {
    "host": "localhost:6380",
    "lag": 2
}

Or to have by now aggregations directly on the existing metricset.

@jsoriano
Copy link
Member

jenkins, test this

@jsoriano
Copy link
Member

@a3dho3yn you will need to update the branch and resolve the conflicts.

},
},
"slowlog": s.Object{
"count": c.Int("slowlog_len"),
Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to add this to the fields.yml file 🙂

@a3dho3yn
Copy link
Contributor Author

I don't know why test_template (from test_base.py) fails :(

description: >
Ratio between used_memory_rss and used_memory
- name: fragmentation.bytes
type: bytes
Copy link
Member

Choose a reason for hiding this comment

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

@a3dho3yn I have run the failing test locally, and it seems that the failure is caused by this, bytes can be used as format, but not as type.


- name: master_offset
type: long
description:

deprecated: true
Copy link
Member

Choose a reason for hiding this comment

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

After merging #7779 today, deprecated needs to be set to the version the field is going to be deprecated on, in this case set it to 6.5.

@jsoriano
Copy link
Member

@a3dho3yn run make update after modifying the fields

@a3dho3yn
Copy link
Contributor Author

I've run make update but surprisingly it did not updated docs :|

@jsoriano
Copy link
Member

Oh yes, sorry, you also need to update your branch with master.

@jsoriano
Copy link
Member

jenkins, test this please

@jsoriano jsoriano merged commit ce9048c into elastic:master Jul 30, 2018
@jsoriano
Copy link
Member

@a3dho3yn merged, thanks a lot for this contribution and the others you are working on 😃

Just curious, are you using the provided dashboards for redis and rabbitmq? We'd be happy to accept contributions also there if you have any proposal 🙂

@a3dho3yn
Copy link
Contributor Author

a3dho3yn commented Jul 30, 2018

Thank you very much for all the help to complete these PRs.
We just started using ELK stack for monitoring our applications and databases. I didn't work with dashboards yet, but I think I will start working with them soon and then I will contribute if I find some deficiencies or issues :)

jsoriano pushed a commit to jsoriano/beats that referenced this pull request Aug 20, 2018
Add memory fragmentation ratio, active defragmentation stats, slave status and some other fields that were missing from info metricset.

(cherry picked from commit ce9048c)
ruflin pushed a commit that referenced this pull request Aug 23, 2018
Add memory fragmentation ratio, active defragmentation stats, slave status and some other fields that were missing from info metricset.

(cherry picked from commit ce9048c)
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.

4 participants