Create an inventory startup time metric#123
Create an inventory startup time metric#123michaelasp wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
c2a9fb6 to
3e92712
Compare
|
Creating from discussion here, it would be good to have a gauge metric to track the latency of startup |
|
/assign @gauravkghildiyal |
81b4aa8 to
ca584c7
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fmuyassarov, michaelasp The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
LGTM from my side but I’d like to give @gauravkghildiyal some time to review it as well. |
ca584c7 to
18f2d61
Compare
|
New changes are detected. LGTM label has been removed. |
|
When I tested this locally, realized that inventory is run in a goroutine, so the overall latency metric is only ~1s but actually discovering devices may take longer. Moved the metric and updated the metric naming. |
3debee8 to
8d3d790
Compare
|
Going to need to take a bit more time fleshing this out, the real portion we want to track is the inventory which is in pkg/inventory which is separate from pkg/driver and currently has no metrics. |
8d3d790 to
1f97fa3
Compare
1f97fa3 to
1bce7e9
Compare
| inventoryStartupDurationSeconds = prometheus.NewGauge(prometheus.GaugeOpts{ | ||
| Namespace: "dranet", | ||
| Subsystem: "inventory", | ||
| Name: "inventory_startup_duration_seconds", |
There was a problem hiding this comment.
The final metric name for this would end up being dranet_inventory_inventory_startup_duration_seconds. Should we strip the name to startup_duration_seconds?
Also, inventory startup name doesn't seem to be doing justice to what its measuring, given it excludes the initial scan completely. If our intent is to measure the cloud-provider detection latency, should we change the name to focus on the cloud provider? (And if we do that, then maybe we can wrap the metric within getInstanceProperties?)
There was a problem hiding this comment.
That makes sense, it's more about the cloud provider latency here. Let me update this after the refactor being done with cloud provider hints #118
Add a startup time metric for the device driver.
Traces to overall latency of startup, everything from creating the plugin path to discovering interfaces the first time around.