forked from vernemq/vernemq
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add reason parameter in disconnect events (#34)
* feat: add reason parameter in disconnect events * fix : map required disconnect reason to events * fix : review revisions * fix : add empty line at the EOF. * fix : remove package import * refactor : move PUBLISH_AUTH_ERROR reason mapping to common function * add metrics for tracking different reasons * fix : update metric description * fix : remove duplicate reason mapping * fix : update reason mapping according to proto and add combination of reason code and name in metric * refactor : use macros for reason mapping * fix : test mqtt5_disconnect_sent - tcp_closed not found * fix : mqtt5 tcp closed and exit signal reason mapping --------- Co-authored-by: Vivek Pipaliya <[email protected]>
- Loading branch information
1 parent
fbb8134
commit 91599d3
Showing
36 changed files
with
1,548 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
%% -*- coding: utf-8 -*- | ||
%% Automatically generated, do not edit | ||
%% Generated by gpb_compile version 4.20.0 | ||
|
||
-ifndef(disconnect_reason_pb). | ||
-define(disconnect_reason_pb, true). | ||
|
||
-define(disconnect_reason_pb_gpb_version, "4.20.0"). | ||
|
||
-endif. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
syntax = "proto3"; | ||
|
||
package eventssidecar.v1; | ||
|
||
enum Reason { | ||
REASON_UNSPECIFIED = 0; | ||
REASON_NOT_AUTHORIZED = 1; | ||
REASON_NORMAL_DISCONNECT = 2; | ||
REASON_SESSION_TAKEN_OVER = 3; | ||
REASON_ADMINISTRATIVE_ACTION = 4; | ||
REASON_DISCONNECT_KEEP_ALIVE = 5; | ||
REASON_DISCONNECT_MIGRATION = 6; | ||
REASON_BAD_AUTHENTICATION_METHOD = 7; | ||
REASON_REMOTE_SESSION_TAKEN_OVER = 8; | ||
REASON_MQTT_CLIENT_DISCONNECT = 9; | ||
REASON_RECEIVE_MAX_EXCEEDED = 10; | ||
REASON_PROTOCOL_ERROR = 11; | ||
REASON_PUBLISH_AUTH_ERROR = 12; | ||
REASON_INVALID_PUBREC_ERROR = 13; | ||
REASON_INVALID_PUBCOMP_ERROR = 14; | ||
REASON_UNEXPECTED_FRAME_TYPE = 15; | ||
REASON_EXIT_SIGNAL_RECEIVED = 16; | ||
REASON_TCP_CLOSED = 17; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
|
||
option go_package = "source.golabs.io/courier/apis-go/eventssidecar/v1"; | ||
import "disconnect_reason.proto"; | ||
|
||
package eventssidecar.v1; | ||
|
||
message OnClientGone { | ||
google.protobuf.Timestamp timestamp = 1; | ||
string client_id = 2; | ||
string mountpoint = 3; | ||
eventssidecar.v1.Reason reason = 4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
|
||
option go_package = "source.golabs.io/courier/apis-go/eventssidecar/v1"; | ||
import "disconnect_reason.proto"; | ||
|
||
package eventssidecar.v1; | ||
|
||
message OnClientOffline { | ||
google.protobuf.Timestamp timestamp = 1; | ||
string client_id = 2; | ||
string mountpoint = 3; | ||
eventssidecar.v1.Reason reason = 4; | ||
} |
Oops, something went wrong.