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 input: fix percentage value parsing #6163

Merged
merged 1 commit into from
Jul 24, 2019

Conversation

melor
Copy link
Contributor

@melor melor commented Jul 24, 2019

Percentage values would get interpreted incorrectly as tags because they
did not pass the int/float conversion.

Required for all PRs:

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

@melor
Copy link
Contributor Author

melor commented Jul 24, 2019

Before: used_memory_dataset_perc and used_memory_peak_perc get included as tags for all metrics:

redis_used_cpu_sys{aof_last_bgrewrite_status="ok",aof_last_write_status="ok",cloud="google-europe-west1",host="redis1-1",maxmemory_policy="noeviction",port="19044",project="test",rdb_last_bgsave_status="ok",redis_version="5.0.4",replication_role="master",server="fda7:a938:5bfe:5fa6::1",service="redis1",service_type="redis",used_memory_dataset_perc="20.54%",used_memory_peak_perc="91.40%"} 9.739602

redis_used_cpu_sys_children{aof_last_bgrewrite_status="ok",aof_last_write_status="ok",cloud="google-europe-west1",host="redis1-1",maxmemory_policy="noeviction",port="19044",project="test",rdb_last_bgsave_status="ok",redis_version="5.0.4",replication_role="master",server="fda7:a938:5bfe:5fa6::1",service="redis1",service_type="redis",used_memory_dataset_perc="20.54%",used_memory_peak_perc="91.40%"} 0.001035

After: used_memory_dataset_perc and used_memory_peak_perc are separate outputs and no longer as tags:

redis_used_cpu_user{aof_last_bgrewrite_status="ok",aof_last_write_status="ok",cloud="google-europe-west1",host="redis1-1",maxmemory_policy="noeviction",port="19044",project="test",rdb_last_bgsave_status="ok",redis_version="5.0.4",replication_role="master",server="fda7:a938:5bfe:5fa6::1",service="redis1",service_type="redis"} 9.907533

redis_used_cpu_user_children{aof_last_bgrewrite_status="ok",aof_last_write_status="ok",cloud="google-europe-west1",host="redis1-1",maxmemory_policy="noeviction",port="19044",project="test",rdb_last_bgsave_status="ok",redis_version="5.0.4",replication_role="master",server="fda7:a938:5bfe:5fa6::1",service="redis1",service_type="redis"} 0

redis_used_memory_peak_perc{aof_last_bgrewrite_status="ok",aof_last_write_status="ok",cloud="google-europe-west1",host="redis1-1",maxmemory_policy="noeviction",port="19044",project="test",rdb_last_bgsave_status="ok",redis_version="5.0.4",replication_role="master",server="fda7:a938:5bfe:5fa6::1",service="redis1",service_type="redis"} 91.4

redis_used_memory_dataset_perc{aof_last_bgrewrite_status="ok",aof_last_write_status="ok",cloud="google-europe-west1",host="redis1-1",maxmemory_policy="noeviction",port="19044",project="test",rdb_last_bgsave_status="ok",redis_version="5.0.4",replication_role="master",server="fda7:a938:5bfe:5fa6::1",service="redis1",service_type="redis"} 20.57

Example values queries thru the Prometheus output interface.

@GeorgeMac
Copy link
Contributor

Cheers for the contribution @melor !

Would you mind adding a case to the tests to validate this?

@GeorgeMac GeorgeMac added area/redis fix pr to fix corresponding bug labels Jul 24, 2019
Percentage values would get interpreted incorrectly as tags because they
did not pass the int/float conversion.
@melor
Copy link
Contributor Author

melor commented Jul 24, 2019

Related: #5036

@danielnelson danielnelson added this to the 1.12.0 milestone Jul 24, 2019
@danielnelson danielnelson merged commit 4177407 into influxdata:master Jul 24, 2019
bitcharmer pushed a commit to bitcharmer/telegraf that referenced this pull request Oct 18, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redis fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants