Change:
} }) } <ins> } func TestKonnectivityClientMetrics(t *testing.T) { testcases := []struct { name    string metrics []string trigger func() want    string }{ { name:    "stream packets", metrics: []string{"konnectivity_network_proxy_client_stream_packets_total"}, trigger: func() { clientmetrics.Metrics.ObservePacket(ccmetrics.SegmentFromClient, client.PacketType_DIAL_REQ) }, want: ` # HELP konnectivity_network_proxy_client_stream_packets_total Count of packets processed, by segment and packet type (example: from_client, DIAL_REQ) # TYPE konnectivity_network_proxy_client_stream_packets_total counter konnectivity_network_proxy_client_stream_packets_total{packet_type="DIAL_REQ",segment="from_client"} 1 `, }, { name:    "stream errors", metrics: []string{"konnectivity_network_proxy_client_stream_errors_total"}, trigger: func() { clientmetrics.Metrics.ObserveStreamError(ccmetrics.SegmentToClient, errors.New("example"), client.PacketType_DIAL_RSP) }, want: ` # HELP konnectivity_network_proxy_client_stream_errors_total Count of gRPC stream errors, by segment, grpc Code, packet type. (example: from_agent, Code.Unavailable, DIAL_RSP) # TYPE konnectivity_network_proxy_client_stream_errors_total counter konnectivity_network_proxy_client_stream_errors_total{code="Unknown",packet_type="DIAL_RSP",segment="to_client"} 1 `, }, { name:    "dial failure", metrics: []string{"konnectivity_network_proxy_client_dial_failure_total"}, trigger: func() { clientmetrics.Metrics.ObserveDialFailure(clientmetrics.DialFailureTimeout) }, want: ` # HELP konnectivity_network_proxy_client_dial_failure_total Number of dial failures observed, by reason (example: remote endpoint error) # TYPE konnectivity_network_proxy_client_dial_failure_total counter konnectivity_network_proxy_client_dial_failure_total{reason="timeout"} 1 `, }, { name:    "client connections", metrics: []string{"konnectivity_network_proxy_client_client_connections"}, trigger: func() { clientmetrics.Metrics.GetClientConnectionsMetric().WithLabelValues("dialing").Inc() }, want: ` # HELP konnectivity_network_proxy_client_client_connections Number of open client connections, by status (Example: dialing) # TYPE konnectivity_network_proxy_client_client_connections gauge konnectivity_network_proxy_client_client_connections{status="dialing"} 1 `, }, } for _, tc := range testcases { t.Run(tc.name, func(t *testing.T) { tc.trigger() if err := testutil.GatherAndCompare(legacyregistry.DefaultGatherer, strings.NewReader(tc.want), tc.metrics...); err != nil { t.Errorf("GatherAndCompare error: %v", err) } }) } </ins> }

Discussion:
At (originally ) component-base metrics exposed Registerer API for raw prometheus registration, and I took dependency in The resulting does not seem to emit the new metrics (example: ). The metrics handler should emit the registered metrics. Falling back to does work. So there is some material difference with . 24, 1.25, 1.26 GKE No response No response No response No response
There are no sig labels on this issue. Please add an appropriate label by using one of the following commands: - Please see the for a listing of the SIGs, working groups, and committees available. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/assign
/assign jkh52