Nexus plugin metrics

The Nexus OSA plugin registers the codescoring metric set in the standard Nexus metrics registry. The metrics are available through the standard Nexus metrics export. Values of failure_rate and slow_call_rate are percentages from 0 to 100.

Circuit Breaker state

State metrics have the value 1 only for the current Circuit Breaker state and 0 for all other states.

MetricTypeDescription
codescoring_circuit_breaker_state_closedgaugeCircuit Breaker is in the normal CLOSED state
codescoring_circuit_breaker_state_opengaugeCircuit Breaker is OPEN, so CodeScoring requests are not allowed
codescoring_circuit_breaker_state_half_opengaugeCircuit Breaker is HALF_OPEN, so trial requests are allowed

Current Circuit Breaker window

These values describe the current Circuit Breaker sliding window and can be reset when the state changes.

MetricTypeDescription
codescoring_circuit_breaker_failure_rategaugeFailure rate calculated by Resilience4j; -1 until the minimum of 5 calls is reached
codescoring_circuit_breaker_observed_failure_rategaugeFailure rate among calls already collected, including the first 1–4 calls
codescoring_circuit_breaker_slow_call_rategaugeRate of calls classified as slow; -1 until the minimum number of calls is reached
codescoring_circuit_breaker_buffered_callsgaugeTotal number of calls in the current window, up to 10
codescoring_circuit_breaker_failed_callsgaugeNumber of failed calls in the current window
codescoring_circuit_breaker_successful_callsgaugeNumber of successful calls in the current window
codescoring_circuit_breaker_slow_callsgaugeNumber of slow calls in the current window
codescoring_circuit_breaker_not_permitted_callsgaugeNumber of calls not permitted in the current Circuit Breaker state

Cumulative Circuit Breaker events

These counters accumulate from the time the plugin instance starts.

MetricTypeDescription
codescoring_circuit_breaker_not_permitted_totalcounterCalls rejected by the Circuit Breaker without an HTTP request to CodeScoring
codescoring_circuit_breaker_failure_rate_exceeded_totalcounterEvents when the configured failure-rate threshold is reached or exceeded
codescoring_circuit_breaker_slow_call_rate_exceeded_totalcounterEvents when the configured slow-call threshold is reached or exceeded
codescoring_circuit_breaker_transitions_to_closed_totalcounterTransitions to CLOSED
codescoring_circuit_breaker_transitions_to_open_totalcounterTransitions to OPEN
codescoring_circuit_breaker_transitions_to_half_open_totalcounterTransitions to HALF_OPEN

HTTP connection pool

CodeScoring requests use one shared pool.

MetricTypeDescription
codescoring_http_pool_leasedgaugeConnections currently used by requests
codescoring_http_pool_availablegaugeOpen idle connections available for reuse
codescoring_http_pool_pendinggaugeRequests waiting for a connection to become available
codescoring_http_pool_maxgaugeConfigured maximum pool size

HTTP requests to CodeScoring

These counters describe the actual outcome of calls to the external service. HTTP 4xx responses are recorded as response errors but do not open the Circuit Breaker.

MetricTypeDescription
codescoring_requests_successes_totalcounterHTTP 200 responses with a body successfully deserialized as a CodeScoring response
codescoring_requests_io_errors_totalcounterNetwork errors, timeouts, and response-body read errors
codescoring_requests_server_errors_totalcounterHTTP 500, 502, 503, and 504 responses recorded by the Circuit Breaker as failures
codescoring_requests_auth_errors_totalcounterHTTP 401 and 403 responses
codescoring_requests_rate_limited_totalcounterHTTP 429 responses
codescoring_requests_other_client_errors_totalcounterOther HTTP 4xx responses
codescoring_requests_unexpected_responses_totalcounterOther non-success responses not included in the categories above
codescoring_requests_serialization_errors_totalcounterRequest serialization errors before an HTTP call is made
codescoring_requests_deserialization_errors_totalcounterHTTP 200 responses whose body cannot be deserialized; these errors are recorded by the Circuit Breaker
codescoring_requests_durationsummaryDuration distribution of completed HTTP requests in seconds; quantiles 0.5, 0.75, 0.95, 0.98, 0.99, and 0.999 are exported
codescoring_requests_duration_countcounterTotal number of completed HTTP requests included in the duration measurement

Scans and decisions

codescoring_scans_total counts operations that reach the shared analysis pipeline. Every such operation increments exactly one of the allowed, blocked, or skipped counters.

MetricTypeDescription
codescoring_scans_totalcounterAnalysis operations for supported artifacts started by the plugin
codescoring_scans_verdict_blocked_totalcounterOperations after which the plugin actually blocked the download
codescoring_scans_verdict_allowed_totalcounterOperations after which the plugin allowed the download, including blockOnError=false and warm-up mode
codescoring_scans_skipped_totalcounterOperations skipped without requesting a scan result: superuser, unparsed artifact, or unsupported Docker/OCI manifest
Was this page helpful?