Skip to content

quarkus_websockets_server_connections_opened_errors_total metric doesn't increment when exception is thrown on websocket opening #47409

@mjurc

Description

@mjurc

Describe the bug

Websocket.next endpoint throwing exception on opening of connection doesn't increment count of quarkus_websockets_server_connections_opened_errors_total{uri=${ENDPOINT}} metric counter.

For example, I have a following websocket:

@WebSocket(path = "/failing")
public class FailingWebsocket {
    @OnOpen()
    public void onOpen() {
        throw new RuntimeException("Websocket failed to open");
    }
.
.
.
}

But opening a connection on it doesn't increment the counter. Same happens for the quarkus_websockets_client_connections_opened_errors_total{uri=${ENDPOINT}} counter.

Expected behavior

The quarkus_websockets_server_connections_opened_errors_total{uri=${ENDPOINT}} counter is incremented.

Actual behavior

The quarkus_websockets_server_connections_opened_errors_total{uri=${ENDPOINT}} counter is not incremented.

How to Reproduce?

Either invoke the aforementioned websocket.next via devui, or run the automated test:

git clone [email protected]:mjurc/quarkus-test-suite.git --branch QUARKUS-5667 && cd quarkus-test-suite
./mvnw clean verify -pl websockets/websocket-next -Dit.test=OpenShiftWebSocketsNextMetricsIT#serverErrorMetricsTest

Output of uname -a or ver

Linux donnager 6.14.2-300.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 10 21:50:55 UTC 2025 x86_64 GNU/Linux

Output of java -version

Java version: 21.0.6, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-21-openjdk

Quarkus version or git rev

main, 3.20.0

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937) Maven home: /home/mjurc/.m2/wrapper/dists/apache-maven-3.9.9/3477a4f1 Java version: 21.0.6, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-21-openjdk Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "6.14.2-300.fc42.x86_64", arch: "amd64", family: "unix"

Additional information

No response

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions