Skip to content

Add Prometheus metrics for NX-API client - #446

Open
felix-kaestner wants to merge 1 commit into
refactor/gnmiextfrom
nxapi/metrics
Open

Add Prometheus metrics for NX-API client#446
felix-kaestner wants to merge 1 commit into
refactor/gnmiextfrom
nxapi/metrics

Conversation

@felix-kaestner

Copy link
Copy Markdown
Contributor

Register two metrics with controller-runtime's metrics registry:

  • nxapi_rpc_duration_seconds: histogram of HTTP round-trip latency with target and status labels
  • nxapi_rpc_commands_total: per-command counter with target, command, and status labels

Add WithTarget option to associate a device address with metrics for correlating slow-responding devices.

Comment thread internal/transport/nxapi/nxapi.go Outdated
Comment thread internal/transport/nxapi/nxapi.go Outdated
Register two metrics with controller-runtime's metrics registry:
- nxapi_rpc_duration_seconds: histogram of HTTP round-trip latency
  with target and status labels
- nxapi_rpc_commands_total: per-command counter with target, command,
  and status labels

Add WithTarget option to associate a device address with metrics
for correlating slow-responding devices.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
@github-actions

Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/internal/transport/nxapi 66.35% (-1.43%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/internal/transport/nxapi/metrics.go 100.00% (+100.00%) 1 (+1) 1 (+1) 0 🌟
github.com/ironcore-dev/network-operator/internal/transport/nxapi/nxapi.go 66.02% (-1.76%) 103 (+13) 68 (+7) 35 (+6) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

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.

2 participants