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

scrape: catch errors when creating HTTP clients #5182

Merged
merged 3 commits into from Feb 13, 2019

Conversation

Projects
None yet
3 participants
@simonpasquier
Copy link
Member

commented Feb 4, 2019

This PR adds 4 new (counter) metrics:

  • prometheus_target_scrape_pools_total
  • prometheus_target_scrape_pools_failed_total
  • prometheus_target_scrape_pool_reloads_total
  • prometheus_target_scrape_pool_reloads_failed_total

Closes #5172

The other option would be to enforce the validity of the TLS configuration when unmarshaling the configuration but that would break promtool check config.

scrape: catch errors when creating HTTP clients
This change makes sure that no scrape pool is created with a nil HTTP
client.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

@simonpasquier simonpasquier requested review from brian-brazil and juliusv Feb 4, 2019

Show resolved Hide resolved scrape/manager.go Outdated
Address Tariq's comment
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Name: "prometheus_target_scrape_pool_reloads_total",
Help: "Total number of reloads on a scrape pool.",
},
[]string{"scrape_job"},

This comment has been minimized.

Copy link
@brian-brazil

brian-brazil Feb 11, 2019

Member

There could be a lot of scrape jobs, I'd not have this label.

This comment has been minimized.

Copy link
@simonpasquier

simonpasquier Feb 11, 2019

Author Member

Fine for me. Note that prometheus_target_sync_length_seconds and prometheus_target_scrape_pool_sync_total already include that label.

Address Brian's comment
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
@brian-brazil

This comment has been minimized.

Copy link
Member

commented Feb 12, 2019

👍

@simonpasquier simonpasquier merged commit 12708ac into prometheus:master Feb 13, 2019

3 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@simonpasquier simonpasquier deleted the simonpasquier:fix-scrape-nil-client branch Feb 13, 2019

yeya24 added a commit to yeya24/prometheus that referenced this pull request Feb 16, 2019

scrape: catch errors when creating HTTP clients (prometheus#5182)
* scrape: catch errors when creating HTTP clients

This change makes sure that no scrape pool is created with a nil HTTP
client.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Address Tariq's comment

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Address Brian's comment

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

@simonpasquier simonpasquier referenced this pull request Mar 1, 2019

Merged

*: cut 2.8.0-rc.0 #5287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.