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_exporter v1.0.0 #256

Merged
merged 1 commit into from
May 22, 2019
Merged

redis_exporter v1.0.0 #256

merged 1 commit into from
May 22, 2019

Conversation

oliver006
Copy link
Owner

@oliver006 oliver006 commented May 1, 2019

This PR introduces breaking changes and will be released as v1.0.0

Why

This project was started over four years ago and a lot has changed since. This is an effort to get the redis_exporter to more closely adhere to the Best Practices for Writing Exporters and clean up the code.

The biggest change is that the exporter no longer directly supports configuring (and scraping) multiple redis instances but pushes that responsibility to the Prometheus server. If this is how you currently use the exporter, then have a look at this section how to configure the Prometheus server to scrape multiple instances.

However, if you already use the exporter as intended by the Prometheus project and scrape only one instance (and e.g. use the --redis.addr and --redis.password cmd line flags) then little to nothing will change for you.

Breaking changes in this PR:

  • The exporter will no longer directly do any Service Discovery and/or scrape multiple redis instances at once.
    All this functionality should happen in the Prometheus server.
    You can still scrape multiple redis instances with one exporter, see the README for an example Prometheus server configuration.
  • The exporter now uses ConstMetrics to correctly export counters and gauges. as per the best practices
  • total_system_memory_bytes will not be included by default any longer, use a command line flag to include it anyway.
  • renamed latency_spike_milliseconds -> latency_spike_seconds
  • renamed all the cpu metrics to end with _seconds
  • last_scrape_duration and scrape_error metrics are now per-instance (if you scrape multiple instances) and scrape_error includes the error as a label value
  • Tile38 metrics are only scraped if --is-tile38 command line flag is set
  • Put the release file in a folder inside the .tar.gz #173 Put the release file in a folder inside the .tar.gz

New features:


Todo

  • remove 1.0.0-rc drone step
  • fix up link to README in this PR to link to master for future reference

@oliver006 oliver006 self-assigned this May 1, 2019
@codecov
Copy link

codecov bot commented May 1, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@42235be). Click here to learn what that means.
The diff coverage is 81.56%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #256   +/-   ##
========================================
  Coverage          ?   74.2%           
========================================
  Files             ?       2           
  Lines             ?     663           
  Branches          ?       0           
========================================
  Hits              ?     492           
  Misses            ?     143           
  Partials          ?      28
Impacted Files Coverage Δ
main.go 0% <0%> (ø)
exporter.go 86.31% <89.51%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 42235be...038b87b. Read the comment docs.

@oliver006 oliver006 force-pushed the oh_1.0_here_we_come branch from 6a7f840 to e928651 Compare May 2, 2019 01:51
@oliver006 oliver006 changed the title [wip] [wip] redis-exporter 1.0 May 2, 2019
@oliver006 oliver006 changed the title [wip] redis-exporter 1.0 [wip] redis_exporter 1.0 May 2, 2019
@oliver006 oliver006 changed the title [wip] redis_exporter 1.0 [wip] redis_exporter 1.0.0 May 2, 2019
@oliver006 oliver006 force-pushed the oh_1.0_here_we_come branch 3 times, most recently from bfd9d4b to 636d56a Compare May 8, 2019 13:24
@oliver006 oliver006 changed the title [wip] redis_exporter 1.0.0 [wip] redis_exporter v1.0.0 May 8, 2019
@oliver006 oliver006 force-pushed the oh_1.0_here_we_come branch from 7fca386 to feaa114 Compare May 8, 2019 19:38
@oliver006 oliver006 mentioned this pull request May 8, 2019
@oliver006 oliver006 force-pushed the oh_1.0_here_we_come branch 3 times, most recently from aac1be8 to 460e89b Compare May 9, 2019 18:32
@oliver006
Copy link
Owner Author

man-crossing-street

@oliver006
Copy link
Owner Author

This is available on docker as v1.0.0-rc.1

docker run -d --name redis_exporter -p 9121:9121 oliver006/redis_exporter:v1.0.0-rc.1

@oliver006 oliver006 force-pushed the oh_1.0_here_we_come branch from 6d6c689 to 36cdf48 Compare May 10, 2019 14:12
@oliver006
Copy link
Owner Author

@SuperQ - this PR addresses the issue you raised in #228 - do you mind having a look, at the feature in particular and maybe the PR in general? Could always some more feedback here, esp if the general direction makes sense.

@brian-brazil - this PR addresses #31 that you raised a million years ago. Mind having a look if the general idea of the changes is somewhat sane? (cc @jkohen re: issue #178 )

Copy link
Contributor

@brian-brazil brian-brazil left a comment

Choose a reason for hiding this comment

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

This looks better from a quick peek.

README.md Outdated Show resolved Hide resolved
exporter/redis.go Outdated Show resolved Hide resolved
exporter/redis.go Outdated Show resolved Hide resolved
exporter/redis.go Outdated Show resolved Hide resolved
exporter/redis.go Outdated Show resolved Hide resolved
exporter/redis.go Outdated Show resolved Hide resolved
exporter/redis.go Outdated Show resolved Hide resolved
exporter/redis.go Outdated Show resolved Hide resolved
exporter/redis.go Outdated Show resolved Hide resolved
@oliver006
Copy link
Owner Author

oliver006 commented May 10, 2019

Thanks @brian-brazil - that's good feedback.

main.go Outdated Show resolved Hide resolved
@oliver006 oliver006 changed the title [wip] redis_exporter v1.0.0 redis_exporter v1.0.0 May 17, 2019
main.go Show resolved Hide resolved
@oliver006 oliver006 force-pushed the oh_1.0_here_we_come branch from 365b467 to 038b87b Compare May 22, 2019 14:08
@oliver006
Copy link
Owner Author

Let's do this.

@oliver006 oliver006 merged commit 0e0639d into master May 22, 2019
@oliver006
Copy link
Owner Author

Github has issues with notifications right now, the exporter binaries and docker image for 1.0.0 will be available as soon as these have been resolved.

@roman-vynar
Copy link

The exporter will no longer directly do any Service Discovery and/or scrape multiple redis instances at once.

That's very sad. We are running multiple redis containers on a single instance which means we now need to run multiple redis_exporter processes :(

We use Prometheus and we do Service Discovery but we don't want to run multiple redis_exporters :(

@SuperQ
Copy link
Contributor

SuperQ commented May 23, 2019

You don't need multiple exporters. The new version can still scrape multiple redis instances. It is configured more like the blackbox exporter.

@oliver006
Copy link
Owner Author

oliver006 commented May 23, 2019

@roman-vynar - see here for more information how to configure Prometheus to scrape multiple hosts.

@amangupta0297
Copy link

amangupta0297 commented Sep 11, 2020

Hi,

Can anyone help me with redis exporter metrics
redis version: 3.0.3
redis-exporter version: 1.10.0
exporter running at : 9121
grafana dashboard: 763

prometheus config:

  • job_name: 'redis_exporter'
    static_configs:
    • targets: ['DNS:9121']

target is healthy under prometheus, but still data is not coming over grafana.

When i see, the metrics

curl http://DNS:9121/metrics | grep redis

redis_exporter_build_info{build_date="2018-09-20-18:15:12",commit_sha="8bb0b841e9a70b0348f69483e58fea01d521c47a",golang_version="go1.10.4",version="v0.21.2"} 1
redis_exporter_last_scrape_duration_seconds 0.000292674
redis_exporter_last_scrape_error 1
redis_exporter_scrapes_total 125
redis_up{addr="redis://localhost:6379",alias=""} 0

issue: only very few metrics are coming, because of which data is not coming over grafana.

metrics required:

  1. redis_uptime_in_seconds
  2. redis_connected_clients
  3. redis_memory_used_bytes/ redis_memory_max_bytes

none of the data is coming, can anyone help. What am i missing

Thanks in advance

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.

promtool check metrics issues Export counters as counters Parallelize requests
6 participants