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

[Redis] Rename client input/output buffer metrics #7983

Closed
wants to merge 3 commits into from
Closed

[Redis] Rename client input/output buffer metrics #7983

wants to merge 3 commits into from

Conversation

andreycha
Copy link
Contributor

Hi,

In the upcoming Redis 5.0 release they changed client input/output buffer metrics: redis/redis@be88c0b. This PR is to reflect these changes.

Important:

  • merge only after 5.0 is released
  • contains breaking changes for metrics names (subject for discussion)

@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 August 16, 2018 08:53
@ruflin
Copy link
Contributor

ruflin commented Aug 16, 2018

@andreycha Thanks for bringing this up. I think on the Metricbeat side it will mean we have to support both variants as Metricbeat could be run against 5 or older versions.

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.

@andreycha thanks for addressing this issue! As @ruflin mentioned, we'll have to support both versions, would you like to do it?

We'd have to add the new fields to the fields.yml file, and we probably should fill old and new fields in the final event.

Do you know of other fields that have been renamed?

@andreycha
Copy link
Contributor Author

andreycha commented Aug 16, 2018

Hi @jsoriano , I sure can add both fields to fields.yml (and docs), but schema has to contain only one pair of fields, otherwise you get a validation error on startup, like:

2018-08-16T00:03:56.046Z ERROR schema/schema.go:41 Error on field 'biggest_input_buf': Missing field: biggest_input_buf, Error: Key client_biggest_input_buf not found
2018-08-16T00:03:56.046Z ERROR schema/schema.go:41 Error on field 'longest_output_list': Missing field: longest_output_list, Error: Key client_longest_output_list not found

If there is a breaking change in Redis, I believe there's no way to avoid it in the beat.

Regarding the other fields: I've checked INFO command output and these two fields are the only fields which have been renamed so far.

@jsoriano
Copy link
Member

@andreycha fields can be marked as optional in the schema, you could set the four fields (the old and the new ones). Once the schema is applied we could check if at least one of them of each pair is set, and set the other one for backwards compatibility.

@jsoriano
Copy link
Member

On the other hand, maybe we should wait till redis 5.0 is released in case there are more changes in field names, wdyt?

@andreycha
Copy link
Contributor Author

@jsoriano well, I can rename these ones and you can keep PR unmerged till the release.

@andreycha
Copy link
Contributor Author

@jsoriano I've updated PR, please take a look if I got everything right.

@jsoriano
Copy link
Member

@andreycha after applying the schema, could you fill the 4.x fields if there are 5.x values? this way if someone was using the 4.x fields in a dashboard or something it will continue working with 5.x.

"longest_output_list": c.Int("client_longest_output_list", s.Optional), // Redis 4.x and below
"biggest_input_buf": c.Int("client_biggest_input_buf", s.Optional), // Redis 4.x and below
"max_output_buffer": c.Int("client_recent_max_output_buffer", s.Optional), // Redis 5.0 and above
"max_input_buffer": c.Int("client_recent_max_input_buffer", s.Optional), // Redis 5.0 and above
Copy link
Member

Choose a reason for hiding this comment

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

Test build is complaining about format here, could you fix it with gofmt -w metricbeat/module/redis/?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@andreycha
Copy link
Contributor Author

andreycha commented Aug 24, 2018

@jsoriano alright, that got a bit too far. I'm absolutely not proficient in Go development and have no idea how to fix another build errors and to fill out the old fields. Shall I close this PR and open the issue instead, or it's possible that someone else can finish it?

@ghost
Copy link

ghost commented Aug 24, 2018

Hi @andreycha, we have found your signature in our records, but it seems like you have signed with a different e-mail than the one used in yout Git commit. Can you please add both of these e-mails into your Github profile (they can be hidden), so we can match your e-mails to your Github profile?

@jsoriano
Copy link
Member

@andreycha we are perfectly fine with finishing these changes, you can close this PR and open an issue if you want, as you prefer. If you open a new issue please add a comment here with the link for the record.
Thanks a lot in any case for the effort and for the heads up on this issue!

@jsoriano jsoriano self-assigned this Aug 29, 2018
@jsoriano
Copy link
Member

I have opened #8167 to continue with this, @andreycha it'd be great if you could review it, thanks!

@andreycha
Copy link
Contributor Author

Hi @jsoriano. sorry, I was on vacation. It's anyway already merged, but I took a look at it and it looks fine. Thank you!

@andreycha andreycha deleted the client-buffer-metrics branch September 3, 2018 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants