-
Notifications
You must be signed in to change notification settings - Fork 270
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
Metric collector and exporter #487
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Initial features: * Metrics interface - for mocks * processing time based on Idle_pct - run show info via admin socket every 500ms, can be disabled via a command-line option * haproxy response time histogram
Two new metrics to the update/resync/reload process: * A counter which tracks update to the config or to the cluster with three distinct time series - noop (configurations match), dynamic (update without reload), full (update with reload) * A gauge which goes to zero (0) if a haproxy config validation or haproxy reload failed
A new lightweight collector and metric which correlates hostnames and NotAfter field of x509 certificates in Unix Epoch time.
jcmoraisjr
force-pushed
the
jm-metrics
branch
from
December 22, 2019 14:11
b43af30
to
0fc4a59
Compare
Add the set server command to the haproxy_response_time histogram. Set server is used by dynamic updates. The approach used is to receive a callback in HAProxyCommand(), so the func itself will register the elapsed time and register the metric. The caller, in this case instance and dynupdate, need to know an instance of Metric intf, whose `HAProxy<xxx>ResponseTime()` func should be used as a callback implementation.
Two new counters (sum and count) for cumulative time of controller tasks. The timer, already used to slice the time of an update event, receives a callback used to notify the elapsed time.
Rotate config, currently, takes the config object on curConfig and copy it to oldConfig, and also assign nil to the curConfig reference. The oldConfig reference has two meanings: 1) it is used to compare with a new curConfig in order to perform dynamic updates 2) if oldConfig != nil it means the controller has already started haproxy The 2) is used by `CalcIdleMetric()`, which cannot connect to the admin socket on its early executions on big configurations. Such configurations take some seconds to start haproxy for the first time.
Timer labels are currently used only in the config update: ingress parsing, config writing, template validation, haproxy reload. The labels are used to show partial duration of a wider event. Some of these labels was incomplete (eg `reload` what?) and not properly aligned with common practices of metric exporters.
Add the ability to configure the time.Duration between two consecutive Idle_pct readings. Zero disables the reading and the metric.
jcmoraisjr
force-pushed
the
jm-metrics
branch
from
December 30, 2019 14:43
7f4cd9b
to
f4181e3
Compare
updateSuccessful() call is pointless if the configuration wasn't persed. This would change the flag to true/ok on successful partial/dynamic update. Changing now to only update this status if the configuration was parsed, either just validating or reloading haproxy.
jcmoraisjr
force-pushed
the
jm-metrics
branch
from
December 30, 2019 14:55
f4181e3
to
f633eb0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a starting version of a metric collector and exporter