fix: metrics macro with description
This commit is contained in:
parent
756797b258
commit
cde4cb1358
|
@ -19,206 +19,240 @@
|
||||||
|
|
||||||
%% Bytes sent and received
|
%% Bytes sent and received
|
||||||
-define(BYTES_METRICS, [
|
-define(BYTES_METRICS, [
|
||||||
%% Total bytes received
|
{counter, 'bytes.received', <<"Number of bytes received ">>},
|
||||||
{counter, 'bytes.received'},
|
{counter, 'bytes.sent', <<"Number of bytes sent on this connection">>}
|
||||||
%% Total bytes sent
|
|
||||||
{counter, 'bytes.sent'}
|
|
||||||
]).
|
]).
|
||||||
|
|
||||||
%% Packets sent and received
|
%% Packets sent and received
|
||||||
-define(PACKET_METRICS, [
|
-define(PACKET_METRICS, [
|
||||||
%% All Packets received
|
{counter, 'packets.received', <<"Number of received packet">>},
|
||||||
{counter, 'packets.received'},
|
{counter, 'packets.sent', <<"Number of sent packet">>},
|
||||||
%% All Packets sent
|
{counter, 'packets.connect.received', <<"Number of received CONNECT packet">>},
|
||||||
{counter, 'packets.sent'},
|
{counter, 'packets.connack.sent', <<"Number of sent CONNACK packet">>},
|
||||||
%% CONNECT Packets received
|
{counter, 'packets.connack.error',
|
||||||
{counter, 'packets.connect.received'},
|
<<"Number of received CONNECT packet with unsuccessful connections">>},
|
||||||
%% CONNACK Packets sent
|
{counter, 'packets.connack.auth_error',
|
||||||
{counter, 'packets.connack.sent'},
|
<<"Number of received CONNECT packet with failed authentication">>},
|
||||||
%% CONNACK error sent
|
{counter, 'packets.publish.received', <<"Number of received PUBLISH packet">>},
|
||||||
{counter, 'packets.connack.error'},
|
|
||||||
%% CONNACK auth_error sent
|
|
||||||
{counter, 'packets.connack.auth_error'},
|
|
||||||
%% PUBLISH packets received
|
|
||||||
{counter, 'packets.publish.received'},
|
|
||||||
%% PUBLISH packets sent
|
%% PUBLISH packets sent
|
||||||
{counter, 'packets.publish.sent'},
|
{counter, 'packets.publish.sent', <<"Number of sent PUBLISH packet">>},
|
||||||
%% PUBLISH packet_id inuse
|
%% PUBLISH packet_id inuse
|
||||||
{counter, 'packets.publish.inuse'},
|
{counter, 'packets.publish.inuse',
|
||||||
|
<<"Number of received PUBLISH packet with occupied identifiers">>},
|
||||||
%% PUBLISH failed for error
|
%% PUBLISH failed for error
|
||||||
{counter, 'packets.publish.error'},
|
{counter, 'packets.publish.error',
|
||||||
|
<<"Number of received PUBLISH packet that cannot be published">>},
|
||||||
%% PUBLISH failed for auth error
|
%% PUBLISH failed for auth error
|
||||||
{counter, 'packets.publish.auth_error'},
|
{counter, 'packets.publish.auth_error',
|
||||||
|
<<"Number of received PUBLISH packets with failed the Authorization check">>},
|
||||||
%% PUBLISH(QoS2) packets dropped
|
%% PUBLISH(QoS2) packets dropped
|
||||||
{counter, 'packets.publish.dropped'},
|
{counter, 'packets.publish.dropped',
|
||||||
|
<<"Number of messages discarded due to the receiving limit">>},
|
||||||
%% PUBACK packets received
|
%% PUBACK packets received
|
||||||
{counter, 'packets.puback.received'},
|
{counter, 'packets.puback.received', <<"Number of received PUBACK packet">>},
|
||||||
%% PUBACK packets sent
|
%% PUBACK packets sent
|
||||||
{counter, 'packets.puback.sent'},
|
{counter, 'packets.puback.sent', <<"Number of sent PUBACK packet">>},
|
||||||
%% PUBACK packet_id inuse
|
%% PUBACK packet_id inuse
|
||||||
{counter, 'packets.puback.inuse'},
|
{counter, 'packets.puback.inuse',
|
||||||
|
<<"Number of received PUBACK packet with occupied identifiers">>},
|
||||||
%% PUBACK packets missed
|
%% PUBACK packets missed
|
||||||
{counter, 'packets.puback.missed'},
|
{counter, 'packets.puback.missed', <<"Number of received packet with identifiers.">>},
|
||||||
%% PUBREC packets received
|
%% PUBREC packets received
|
||||||
{counter, 'packets.pubrec.received'},
|
{counter, 'packets.pubrec.received', <<"Number of received PUBREC packet">>},
|
||||||
%% PUBREC packets sent
|
%% PUBREC packets sent
|
||||||
{counter, 'packets.pubrec.sent'},
|
{counter, 'packets.pubrec.sent', <<"Number of sent PUBREC packet">>},
|
||||||
%% PUBREC packet_id inuse
|
%% PUBREC packet_id inuse
|
||||||
{counter, 'packets.pubrec.inuse'},
|
{counter, 'packets.pubrec.inuse',
|
||||||
|
<<"Number of received PUBREC packet with occupied identifiers">>},
|
||||||
%% PUBREC packets missed
|
%% PUBREC packets missed
|
||||||
{counter, 'packets.pubrec.missed'},
|
{counter, 'packets.pubrec.missed',
|
||||||
|
<<"Number of received PUBREC packet with unknown identifiers">>},
|
||||||
%% PUBREL packets received
|
%% PUBREL packets received
|
||||||
{counter, 'packets.pubrel.received'},
|
{counter, 'packets.pubrel.received', <<"Number of received PUBREL packet">>},
|
||||||
%% PUBREL packets sent
|
%% PUBREL packets sent
|
||||||
{counter, 'packets.pubrel.sent'},
|
{counter, 'packets.pubrel.sent', <<"Number of sent PUBREL packet">>},
|
||||||
%% PUBREL packets missed
|
%% PUBREL packets missed
|
||||||
{counter, 'packets.pubrel.missed'},
|
{counter, 'packets.pubrel.missed',
|
||||||
|
<<"Number of received PUBREC packet with unknown identifiers">>},
|
||||||
%% PUBCOMP packets received
|
%% PUBCOMP packets received
|
||||||
{counter, 'packets.pubcomp.received'},
|
{counter, 'packets.pubcomp.received', <<"Number of received PUBCOMP packet">>},
|
||||||
%% PUBCOMP packets sent
|
%% PUBCOMP packets sent
|
||||||
{counter, 'packets.pubcomp.sent'},
|
{counter, 'packets.pubcomp.sent', <<"Number of sent PUBCOMP packet">>},
|
||||||
%% PUBCOMP packet_id inuse
|
%% PUBCOMP packet_id inuse
|
||||||
{counter, 'packets.pubcomp.inuse'},
|
{counter, 'packets.pubcomp.inuse',
|
||||||
|
<<"Number of received PUBCOMP packet with occupied identifiers">>},
|
||||||
%% PUBCOMP packets missed
|
%% PUBCOMP packets missed
|
||||||
{counter, 'packets.pubcomp.missed'},
|
{counter, 'packets.pubcomp.missed', <<"Number of missed PUBCOMP packet">>},
|
||||||
%% SUBSCRIBE Packets received
|
%% SUBSCRIBE Packets received
|
||||||
{counter, 'packets.subscribe.received'},
|
{counter, 'packets.subscribe.received', <<"Number of received SUBSCRIBE packet">>},
|
||||||
%% SUBSCRIBE error
|
%% SUBSCRIBE error
|
||||||
{counter, 'packets.subscribe.error'},
|
{counter, 'packets.subscribe.error',
|
||||||
|
<<"Number of received SUBSCRIBE packet with failed subscriptions">>},
|
||||||
%% SUBSCRIBE failed for not auth
|
%% SUBSCRIBE failed for not auth
|
||||||
{counter, 'packets.subscribe.auth_error'},
|
{counter, 'packets.subscribe.auth_error',
|
||||||
|
<<"Number of received SUBACK packet with failed Authorization check">>},
|
||||||
%% SUBACK packets sent
|
%% SUBACK packets sent
|
||||||
{counter, 'packets.suback.sent'},
|
{counter, 'packets.suback.sent', <<"Number of sent SUBACK packet">>},
|
||||||
%% UNSUBSCRIBE Packets received
|
%% UNSUBSCRIBE Packets received
|
||||||
{counter, 'packets.unsubscribe.received'},
|
{counter, 'packets.unsubscribe.received', <<"Number of received UNSUBSCRIBE packet">>},
|
||||||
%% UNSUBSCRIBE error
|
%% UNSUBSCRIBE error
|
||||||
{counter, 'packets.unsubscribe.error'},
|
{counter, 'packets.unsubscribe.error',
|
||||||
|
<<"Number of received UNSUBSCRIBE packet with failed unsubscriptions">>},
|
||||||
%% UNSUBACK Packets sent
|
%% UNSUBACK Packets sent
|
||||||
{counter, 'packets.unsuback.sent'},
|
{counter, 'packets.unsuback.sent', <<"Number of sent UNSUBACK packet">>},
|
||||||
%% PINGREQ packets received
|
%% PINGREQ packets received
|
||||||
{counter, 'packets.pingreq.received'},
|
{counter, 'packets.pingreq.received', <<"Number of received PINGREQ packet">>},
|
||||||
%% PINGRESP Packets sent
|
%% PINGRESP Packets sent
|
||||||
{counter, 'packets.pingresp.sent'},
|
{counter, 'packets.pingresp.sent', <<"Number of sent PUBRESP packet">>},
|
||||||
%% DISCONNECT Packets received
|
%% DISCONNECT Packets received
|
||||||
{counter, 'packets.disconnect.received'},
|
{counter, 'packets.disconnect.received', <<"Number of received DISCONNECT packet">>},
|
||||||
%% DISCONNECT Packets sent
|
%% DISCONNECT Packets sent
|
||||||
{counter, 'packets.disconnect.sent'},
|
{counter, 'packets.disconnect.sent', <<"Number of sent DISCONNECT packet">>},
|
||||||
%% Auth Packets received
|
%% Auth Packets received
|
||||||
{counter, 'packets.auth.received'},
|
{counter, 'packets.auth.received', <<"Number of received AUTH packet">>},
|
||||||
%% Auth Packets sent
|
%% Auth Packets sent
|
||||||
{counter, 'packets.auth.sent'}
|
{counter, 'packets.auth.sent', <<"Number of sent AUTH packet">>}
|
||||||
]).
|
]).
|
||||||
|
|
||||||
%% Messages sent/received and pubsub
|
%% Messages sent/received and pubsub
|
||||||
-define(MESSAGE_METRICS, [
|
-define(MESSAGE_METRICS, [
|
||||||
%% All Messages received
|
%% All Messages received
|
||||||
{counter, 'messages.received'},
|
{counter, 'messages.received', <<
|
||||||
|
"Number of messages received from the client, equal to the sum of "
|
||||||
|
"messages.qos0.received\fmessages.qos1.received and messages.qos2.received"
|
||||||
|
>>},
|
||||||
%% All Messages sent
|
%% All Messages sent
|
||||||
{counter, 'messages.sent'},
|
{counter, 'messages.sent', <<
|
||||||
|
"Number of messages sent to the client, equal to the sum of "
|
||||||
|
"messages.qos0.sent\fmessages.qos1.sent and messages.qos2.sent"
|
||||||
|
>>},
|
||||||
%% QoS0 Messages received
|
%% QoS0 Messages received
|
||||||
{counter, 'messages.qos0.received'},
|
{counter, 'messages.qos0.received', <<"Number of QoS 0 messages received from clients">>},
|
||||||
%% QoS0 Messages sent
|
%% QoS0 Messages sent
|
||||||
{counter, 'messages.qos0.sent'},
|
{counter, 'messages.qos0.sent', <<"Number of QoS 0 messages sent to clients">>},
|
||||||
%% QoS1 Messages received
|
%% QoS1 Messages received
|
||||||
{counter, 'messages.qos1.received'},
|
{counter, 'messages.qos1.received', <<"Number of QoS 1 messages received from clients">>},
|
||||||
%% QoS1 Messages sent
|
%% QoS1 Messages sent
|
||||||
{counter, 'messages.qos1.sent'},
|
{counter, 'messages.qos1.sent', <<"Number of QoS 1 messages sent to clients">>},
|
||||||
%% QoS2 Messages received
|
%% QoS2 Messages received
|
||||||
{counter, 'messages.qos2.received'},
|
{counter, 'messages.qos2.received', <<"Number of QoS 2 messages received from clients">>},
|
||||||
%% QoS2 Messages sent
|
%% QoS2 Messages sent
|
||||||
{counter, 'messages.qos2.sent'},
|
{counter, 'messages.qos2.sent', <<"Number of QoS 2 messages sent to clients">>},
|
||||||
%% PubSub Metrics
|
%% PubSub Metrics
|
||||||
|
|
||||||
%% Messages Publish
|
%% Messages Publish
|
||||||
{counter, 'messages.publish'},
|
{counter, 'messages.publish',
|
||||||
|
<<"Number of messages published in addition to system messages">>},
|
||||||
%% Messages dropped due to no subscribers
|
%% Messages dropped due to no subscribers
|
||||||
{counter, 'messages.dropped'},
|
{counter, 'messages.dropped',
|
||||||
|
<<"Number of messages dropped before forwarding to the subscription process">>},
|
||||||
%% Messages that failed validations
|
%% Messages that failed validations
|
||||||
{counter, 'messages.validation_failed'},
|
{counter, 'messages.validation_failed', <<"Number of message validation failed">>},
|
||||||
%% Messages that passed validations
|
%% Messages that passed validations
|
||||||
{counter, 'messages.validation_succeeded'},
|
{counter, 'messages.validation_succeeded', <<"Number of message validation successful">>},
|
||||||
%% % Messages that failed transformations
|
%% % Messages that failed transformations
|
||||||
{counter, 'messages.transformation_failed'},
|
{counter, 'messages.transformation_failed', <<"Number fo message transformation failed">>},
|
||||||
%% % Messages that passed transformations
|
%% % Messages that passed transformations
|
||||||
{counter, 'messages.transformation_succeeded'},
|
{counter, 'messages.transformation_succeeded',
|
||||||
|
<<"Number fo message transformation succeeded">>},
|
||||||
%% QoS2 Messages expired
|
%% QoS2 Messages expired
|
||||||
{counter, 'messages.dropped.await_pubrel_timeout'},
|
{counter, 'messages.dropped.await_pubrel_timeout',
|
||||||
|
<<"Number of messages dropped due to waiting PUBREL timeout">>},
|
||||||
%% Messages dropped
|
%% Messages dropped
|
||||||
{counter, 'messages.dropped.no_subscribers'},
|
{counter, 'messages.dropped.no_subscribers',
|
||||||
|
<<"Number of messages dropped due to no subscribers">>},
|
||||||
%% Messages forward
|
%% Messages forward
|
||||||
{counter, 'messages.forward'},
|
{counter, 'messages.forward', <<"Number of messages forwarded to other nodes">>},
|
||||||
%% Messages delayed
|
%% Messages delayed
|
||||||
{counter, 'messages.delayed'},
|
{counter, 'messages.delayed', <<"Number of delay-published messages">>},
|
||||||
%% Messages delivered
|
%% Messages delivered
|
||||||
{counter, 'messages.delivered'},
|
{counter, 'messages.delivered',
|
||||||
|
<<"Number of messages forwarded to the subscription process internally">>},
|
||||||
%% Messages acked
|
%% Messages acked
|
||||||
{counter, 'messages.acked'},
|
{counter, 'messages.acked', <<"Number of received PUBACK and PUBREC packet">>},
|
||||||
%% Messages persistently stored
|
%% Messages persistently stored
|
||||||
{counter, 'messages.persisted'}
|
{counter, 'messages.persisted', <<"Number of message persisted">>}
|
||||||
]).
|
]).
|
||||||
|
|
||||||
%% Delivery metrics
|
%% Delivery metrics
|
||||||
-define(DELIVERY_METRICS, [
|
-define(DELIVERY_METRICS, [
|
||||||
%% All Dropped during delivery
|
%% All Dropped during delivery
|
||||||
{counter, 'delivery.dropped'},
|
{counter, 'delivery.dropped', <<"Total number of discarded messages when sending">>},
|
||||||
%% Dropped due to no_local
|
%% Dropped due to no_local
|
||||||
{counter, 'delivery.dropped.no_local'},
|
{counter, 'delivery.dropped.no_local', <<
|
||||||
|
"Number of messages that were dropped due to the No Local subscription "
|
||||||
|
"option when sending"
|
||||||
|
>>},
|
||||||
%% Dropped due to message too large
|
%% Dropped due to message too large
|
||||||
{counter, 'delivery.dropped.too_large'},
|
{counter, 'delivery.dropped.too_large', <<
|
||||||
|
"The number of messages that were dropped because the length exceeded "
|
||||||
|
"the limit when sending"
|
||||||
|
>>},
|
||||||
%% Dropped qos0 message
|
%% Dropped qos0 message
|
||||||
{counter, 'delivery.dropped.qos0_msg'},
|
{counter, 'delivery.dropped.qos0_msg', <<
|
||||||
|
"Number of messages with QoS 0 that were dropped because the message "
|
||||||
|
"queue was full when sending"
|
||||||
|
>>},
|
||||||
%% Dropped due to queue full
|
%% Dropped due to queue full
|
||||||
{counter, 'delivery.dropped.queue_full'},
|
{counter, 'delivery.dropped.queue_full', <<
|
||||||
|
"Number of messages with a non-zero QoS that were dropped because the "
|
||||||
|
"message queue was full when sending"
|
||||||
|
>>},
|
||||||
%% Dropped due to expired
|
%% Dropped due to expired
|
||||||
{counter, 'delivery.dropped.expired'}
|
{counter, 'delivery.dropped.expired',
|
||||||
|
<<"Number of messages dropped due to message expiration on sending">>}
|
||||||
]).
|
]).
|
||||||
|
|
||||||
%% Client Lifecircle metrics
|
%% Client Lifecircle metrics
|
||||||
-define(CLIENT_METRICS, [
|
-define(CLIENT_METRICS, [
|
||||||
{counter, 'client.connect'},
|
{counter, 'client.connect', <<"Number of client connections">>},
|
||||||
{counter, 'client.connack'},
|
{counter, 'client.connack', <<"Number of CONNACK packet sent">>},
|
||||||
{counter, 'client.connected'},
|
{counter, 'client.connected', <<"Number of successful client connections">>},
|
||||||
{counter, 'client.authenticate'},
|
{counter, 'client.authenticate', <<"Number of client authentications">>},
|
||||||
{counter, 'client.auth.anonymous'},
|
{counter, 'client.auth.anonymous', <<"Number of clients who log in anonymously">>},
|
||||||
{counter, 'client.authorize'},
|
{counter, 'client.authorize', <<"Number of Authorization rule checks">>},
|
||||||
{counter, 'client.subscribe'},
|
{counter, 'client.subscribe', <<"Number of client subscriptions">>},
|
||||||
{counter, 'client.unsubscribe'},
|
{counter, 'client.unsubscribe', <<"Number of client unsubscriptions">>},
|
||||||
{counter, 'client.disconnected'}
|
{counter, 'client.disconnected', <<"Number of client disconnects">>}
|
||||||
]).
|
]).
|
||||||
|
|
||||||
%% Session Lifecircle metrics
|
%% Session Lifecircle metrics
|
||||||
-define(SESSION_METRICS, [
|
-define(SESSION_METRICS, [
|
||||||
{counter, 'session.created'},
|
{counter, 'session.created', <<"Number of sessions created">>},
|
||||||
{counter, 'session.resumed'},
|
{counter, 'session.resumed',
|
||||||
%% Session taken over by another client (Connect with clean_session|clean_start=false)
|
<<"Number of sessions resumed because Clean Session or Clean Start is false">>},
|
||||||
{counter, 'session.takenover'},
|
{counter, 'session.takenover',
|
||||||
%% Session taken over by another client (Connect with clean_session|clean_start=true)
|
<<"Number of sessions takenover because Clean Session or Clean Start is false">>},
|
||||||
{counter, 'session.discarded'},
|
{counter, 'session.discarded',
|
||||||
{counter, 'session.terminated'}
|
<<"Number of sessions dropped because Clean Session or Clean Start is true">>},
|
||||||
|
{counter, 'session.terminated', <<"Number of terminated sessions">>}
|
||||||
]).
|
]).
|
||||||
|
|
||||||
%% Statistic metrics for ACL checking
|
%% Statistic metrics for ACL checking
|
||||||
-define(STASTS_ACL_METRICS, [
|
-define(STASTS_ACL_METRICS, [
|
||||||
{counter, 'authorization.allow'},
|
{counter, 'authorization.allow', <<"Number of Authorization allow">>},
|
||||||
{counter, 'authorization.deny'},
|
{counter, 'authorization.deny', <<"Number of Authorization deny">>},
|
||||||
{counter, 'authorization.cache_hit'},
|
{counter, 'authorization.cache_hit', <<"Number of Authorization hits the cache">>},
|
||||||
{counter, 'authorization.cache_miss'}
|
{counter, 'authorization.cache_miss', <<"Number of Authorization cache missing">>}
|
||||||
]).
|
]).
|
||||||
|
|
||||||
%% Statistic metrics for auth checking
|
%% Statistic metrics for auth checking
|
||||||
-define(STASTS_AUTHN_METRICS, [
|
-define(STASTS_AUTHN_METRICS, [
|
||||||
{counter, 'authentication.success'},
|
{counter, 'authentication.success', <<"Number of successful client Authentication">>},
|
||||||
{counter, 'authentication.success.anonymous'},
|
{counter, 'authentication.success.anonymous',
|
||||||
{counter, 'authentication.failure'}
|
<<"Number of successful client Authentication due to anonymous">>},
|
||||||
|
{counter, 'authentication.failure', <<"Number of failed client Authentication">>}
|
||||||
]).
|
]).
|
||||||
|
|
||||||
%% Overload protection counters
|
%% Overload protection counters
|
||||||
-define(OLP_METRICS, [
|
-define(OLP_METRICS, [
|
||||||
{counter, 'overload_protection.delay.ok'},
|
{counter, 'overload_protection.delay.ok', <<"Number of overload protection delayed">>},
|
||||||
{counter, 'overload_protection.delay.timeout'},
|
{counter, 'overload_protection.delay.timeout',
|
||||||
{counter, 'overload_protection.hibernation'},
|
<<"Number of overload protection delay timeout">>},
|
||||||
{counter, 'overload_protection.gc'},
|
{counter, 'overload_protection.hibernation', <<"Number of overload protection hibernation">>},
|
||||||
{counter, 'overload_protection.new_conn'}
|
{counter, 'overload_protection.gc', <<"Number of overload protection garbage collection">>},
|
||||||
|
{counter, 'overload_protection.new_conn',
|
||||||
|
<<"Number of overload protection close new incoming connection">>}
|
||||||
]).
|
]).
|
||||||
|
|
||||||
-endif.
|
-endif.
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
-define(SERVER, ?MODULE).
|
-define(SERVER, ?MODULE).
|
||||||
|
|
||||||
olp_metrics() ->
|
olp_metrics() ->
|
||||||
lists:map(fun({_, Metric}) -> Metric end, ?OLP_METRICS).
|
lists:map(fun({_, Metric, _}) -> Metric end, ?OLP_METRICS).
|
||||||
|
|
||||||
-record(state, {next_idx = 1}).
|
-record(state, {next_idx = 1}).
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ init([]) ->
|
||||||
]),
|
]),
|
||||||
% Store reserved indices
|
% Store reserved indices
|
||||||
ok = lists:foreach(
|
ok = lists:foreach(
|
||||||
fun({Type, Name}) ->
|
fun({Type, Name, _Desc}) ->
|
||||||
Idx = reserved_idx(Name),
|
Idx = reserved_idx(Name),
|
||||||
Metric = #metric{name = Name, type = Type, idx = Idx},
|
Metric = #metric{name = Name, type = Type, idx = Idx},
|
||||||
true = ets:insert(?TAB, Metric),
|
true = ets:insert(?TAB, Metric),
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
-include_lib("typerefl/include/types.hrl").
|
-include_lib("typerefl/include/types.hrl").
|
||||||
-include_lib("hocon/include/hocon_types.hrl").
|
-include_lib("hocon/include/hocon_types.hrl").
|
||||||
|
-include_lib("emqx/include/emqx_metrics.hrl").
|
||||||
|
|
||||||
-import(hoconsc, [mk/2, ref/2]).
|
-import(hoconsc, [mk/2, ref/2]).
|
||||||
|
|
||||||
|
@ -125,198 +126,13 @@ properties() ->
|
||||||
]),
|
]),
|
||||||
lists:reverse(
|
lists:reverse(
|
||||||
lists:foldl(
|
lists:foldl(
|
||||||
fun({_Type, MetricName}, Acc) ->
|
fun({_Type, MetricName, Desc}, Acc) ->
|
||||||
[m(MetricName) | Acc]
|
[m(MetricName, Desc) | Acc]
|
||||||
end,
|
end,
|
||||||
[],
|
[],
|
||||||
Metrics
|
Metrics
|
||||||
)
|
)
|
||||||
).
|
).
|
||||||
|
|
||||||
m('actions.failure' = K) ->
|
|
||||||
m(K, <<"Number of failure executions of the rule engine action">>);
|
|
||||||
m('actions.success' = K) ->
|
|
||||||
m(K, <<"Number of successful executions of the rule engine action">>);
|
|
||||||
m('bytes.received' = K) ->
|
|
||||||
m(K, <<"Number of bytes received ">>);
|
|
||||||
m('bytes.sent' = K) ->
|
|
||||||
m(K, <<"Number of bytes sent on this connection">>);
|
|
||||||
m('client.auth.anonymous' = K) ->
|
|
||||||
m(K, <<"Number of clients who log in anonymously">>);
|
|
||||||
m('client.authenticate' = K) ->
|
|
||||||
m(K, <<"Number of client authentications">>);
|
|
||||||
m('client.check_authz' = K) ->
|
|
||||||
m(K, <<"Number of Authorization rule checks">>);
|
|
||||||
m('client.connack' = K) ->
|
|
||||||
m(K, <<"Number of CONNACK packet sent">>);
|
|
||||||
m('client.connect' = K) ->
|
|
||||||
m(K, <<"Number of client connections">>);
|
|
||||||
m('client.connected' = K) ->
|
|
||||||
m(K, <<"Number of successful client connections">>);
|
|
||||||
m('client.disconnected' = K) ->
|
|
||||||
m(K, <<"Number of client disconnects">>);
|
|
||||||
m('client.subscribe' = K) ->
|
|
||||||
m(K, <<"Number of client subscriptions">>);
|
|
||||||
m('client.unsubscribe' = K) ->
|
|
||||||
m(K, <<"Number of client unsubscriptions">>);
|
|
||||||
m('delivery.dropped' = K) ->
|
|
||||||
m(K, <<"Total number of discarded messages when sending">>);
|
|
||||||
m('delivery.dropped.expired' = K) ->
|
|
||||||
m(K, <<"Number of messages dropped due to message expiration on sending">>);
|
|
||||||
m('delivery.dropped.no_local' = K) ->
|
|
||||||
m(K, <<
|
|
||||||
"Number of messages that were dropped due to the No Local subscription "
|
|
||||||
"option when sending"
|
|
||||||
>>);
|
|
||||||
m('delivery.dropped.qos0_msg' = K) ->
|
|
||||||
m(K, <<
|
|
||||||
"Number of messages with QoS 0 that were dropped because the message "
|
|
||||||
"queue was full when sending"
|
|
||||||
>>);
|
|
||||||
m('delivery.dropped.queue_full' = K) ->
|
|
||||||
m(K, <<
|
|
||||||
"Number of messages with a non-zero QoS that were dropped because the "
|
|
||||||
"message queue was full when sending"
|
|
||||||
>>);
|
|
||||||
m('delivery.dropped.too_large' = K) ->
|
|
||||||
m(K, <<
|
|
||||||
"The number of messages that were dropped because the length exceeded "
|
|
||||||
"the limit when sending"
|
|
||||||
>>);
|
|
||||||
m('messages.acked' = K) ->
|
|
||||||
m(K, <<"Number of received PUBACK and PUBREC packet">>);
|
|
||||||
m('messages.delayed' = K) ->
|
|
||||||
m(K, <<"Number of delay-published messages">>);
|
|
||||||
m('messages.delivered' = K) ->
|
|
||||||
m(K, <<"Number of messages forwarded to the subscription process internally">>);
|
|
||||||
m('messages.dropped' = K) ->
|
|
||||||
m(K, <<"Total number of messages dropped before forwarding to the subscription process">>);
|
|
||||||
m('messages.dropped.await_pubrel_timeout' = K) ->
|
|
||||||
m(K, <<"Number of messages dropped due to waiting PUBREL timeout">>);
|
|
||||||
m('messages.dropped.no_subscribers' = K) ->
|
|
||||||
m(K, <<"Number of messages dropped due to no subscribers">>);
|
|
||||||
m('messages.forward' = K) ->
|
|
||||||
m(K, <<"Number of messages forwarded to other nodes">>);
|
|
||||||
m('messages.publish' = K) ->
|
|
||||||
m(K, <<"Number of messages published in addition to system messages">>);
|
|
||||||
m('messages.qos0.received' = K) ->
|
|
||||||
m(K, <<"Number of QoS 0 messages received from clients">>);
|
|
||||||
m('messages.qos0.sent' = K) ->
|
|
||||||
m(K, <<"Number of QoS 0 messages sent to clients">>);
|
|
||||||
m('messages.qos1.received' = K) ->
|
|
||||||
m(K, <<"Number of QoS 1 messages received from clients">>);
|
|
||||||
m('messages.qos1.sent' = K) ->
|
|
||||||
m(K, <<"Number of QoS 1 messages sent to clients">>);
|
|
||||||
m('messages.qos2.received' = K) ->
|
|
||||||
m(K, <<"Number of QoS 2 messages received from clients">>);
|
|
||||||
m('messages.qos2.sent' = K) ->
|
|
||||||
m(K, <<"Number of QoS 2 messages sent to clients">>);
|
|
||||||
m('messages.received' = K) ->
|
|
||||||
m(K, <<
|
|
||||||
"Number of messages received from the client, equal to the sum of "
|
|
||||||
"messages.qos0.received\fmessages.qos1.received and messages.qos2.received"
|
|
||||||
>>);
|
|
||||||
%% m(
|
|
||||||
%% 'messages.retained',
|
|
||||||
%% <<"Number of retained messages">>
|
|
||||||
%% ),
|
|
||||||
m('messages.sent' = K) ->
|
|
||||||
m(K, <<
|
|
||||||
"Number of messages sent to the client, equal to the sum of "
|
|
||||||
"messages.qos0.sent\fmessages.qos1.sent and messages.qos2.sent"
|
|
||||||
>>);
|
|
||||||
m('packets.auth.received' = K) ->
|
|
||||||
m(K, <<"Number of received AUTH packet">>);
|
|
||||||
m('packets.auth.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent AUTH packet">>);
|
|
||||||
m('packets.connack.auth_error' = K) ->
|
|
||||||
m(K, <<"Number of received CONNECT packet with failed authentication">>);
|
|
||||||
m('packets.connack.error' = K) ->
|
|
||||||
m(K, <<"Number of received CONNECT packet with unsuccessful connections">>);
|
|
||||||
m('packets.connack.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent CONNACK packet">>);
|
|
||||||
m('packets.connect.received' = K) ->
|
|
||||||
m(K, <<"Number of received CONNECT packet">>);
|
|
||||||
m('packets.disconnect.received' = K) ->
|
|
||||||
m(K, <<"Number of received DISCONNECT packet">>);
|
|
||||||
m('packets.disconnect.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent DISCONNECT packet">>);
|
|
||||||
m('packets.pingreq.received' = K) ->
|
|
||||||
m(K, <<"Number of received PINGREQ packet">>);
|
|
||||||
m('packets.pingresp.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent PUBRESP packet">>);
|
|
||||||
m('packets.puback.inuse' = K) ->
|
|
||||||
m(K, <<"Number of received PUBACK packet with occupied identifiers">>);
|
|
||||||
m('packets.puback.missed' = K) ->
|
|
||||||
m(K, <<"Number of received packet with identifiers.">>);
|
|
||||||
m('packets.puback.received' = K) ->
|
|
||||||
m(K, <<"Number of received PUBACK packet">>);
|
|
||||||
m('packets.puback.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent PUBACK packet">>);
|
|
||||||
m('packets.pubcomp.inuse' = K) ->
|
|
||||||
m(K, <<"Number of received PUBCOMP packet with occupied identifiers">>);
|
|
||||||
m('packets.pubcomp.missed' = K) ->
|
|
||||||
m(K, <<"Number of missed PUBCOMP packet">>);
|
|
||||||
m('packets.pubcomp.received' = K) ->
|
|
||||||
m(K, <<"Number of received PUBCOMP packet">>);
|
|
||||||
m('packets.pubcomp.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent PUBCOMP packet">>);
|
|
||||||
m('packets.publish.auth_error' = K) ->
|
|
||||||
m(K, <<"Number of received PUBLISH packets with failed the Authorization check">>);
|
|
||||||
m('packets.publish.dropped' = K) ->
|
|
||||||
m(K, <<"Number of messages discarded due to the receiving limit">>);
|
|
||||||
m('packets.publish.error' = K) ->
|
|
||||||
m(K, <<"Number of received PUBLISH packet that cannot be published">>);
|
|
||||||
m('packets.publish.inuse' = K) ->
|
|
||||||
m(K, <<"Number of received PUBLISH packet with occupied identifiers">>);
|
|
||||||
m('packets.publish.received' = K) ->
|
|
||||||
m(K, <<"Number of received PUBLISH packet">>);
|
|
||||||
m('packets.publish.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent PUBLISH packet">>);
|
|
||||||
m('packets.pubrec.inuse' = K) ->
|
|
||||||
m(K, <<"Number of received PUBREC packet with occupied identifiers">>);
|
|
||||||
m('packets.pubrec.missed' = K) ->
|
|
||||||
m(K, <<"Number of received PUBREC packet with unknown identifiers">>);
|
|
||||||
m('packets.pubrec.received' = K) ->
|
|
||||||
m(K, <<"Number of received PUBREC packet">>);
|
|
||||||
m('packets.pubrec.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent PUBREC packet">>);
|
|
||||||
m('packets.pubrel.missed' = K) ->
|
|
||||||
m(K, <<"Number of received PUBREC packet with unknown identifiers">>);
|
|
||||||
m('packets.pubrel.received' = K) ->
|
|
||||||
m(K, <<"Number of received PUBREL packet">>);
|
|
||||||
m('packets.pubrel.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent PUBREL packet">>);
|
|
||||||
m('packets.received' = K) ->
|
|
||||||
m(K, <<"Number of received packet">>);
|
|
||||||
m('packets.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent packet">>);
|
|
||||||
m('packets.suback.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent SUBACK packet">>);
|
|
||||||
m('packets.subscribe.auth_error' = K) ->
|
|
||||||
m(K, <<"Number of received SUBACK packet with failed Authorization check">>);
|
|
||||||
m('packets.subscribe.error' = K) ->
|
|
||||||
m(K, <<"Number of received SUBSCRIBE packet with failed subscriptions">>);
|
|
||||||
m('packets.subscribe.received' = K) ->
|
|
||||||
m(K, <<"Number of received SUBSCRIBE packet">>);
|
|
||||||
m('packets.unsuback.sent' = K) ->
|
|
||||||
m(K, <<"Number of sent UNSUBACK packet">>);
|
|
||||||
m('packets.unsubscribe.error' = K) ->
|
|
||||||
m(K, <<"Number of received UNSUBSCRIBE packet with failed unsubscriptions">>);
|
|
||||||
m('packets.unsubscribe.received' = K) ->
|
|
||||||
m(K, <<"Number of received UNSUBSCRIBE packet">>);
|
|
||||||
m('rules.matched' = K) ->
|
|
||||||
m(K, <<"Number of rule matched">>);
|
|
||||||
m('session.created' = K) ->
|
|
||||||
m(K, <<"Number of sessions created">>);
|
|
||||||
m('session.discarded' = K) ->
|
|
||||||
m(K, <<"Number of sessions dropped because Clean Session or Clean Start is true">>);
|
|
||||||
m('session.resumed' = K) ->
|
|
||||||
m(K, <<"Number of sessions resumed because Clean Session or Clean Start is false">>);
|
|
||||||
m('session.takenover' = K) ->
|
|
||||||
m(K, <<"Number of sessions takenover because Clean Session or Clean Start is false">>);
|
|
||||||
m('session.terminated' = K) ->
|
|
||||||
m(K, <<"Number of terminated sessions">>).
|
|
||||||
|
|
||||||
m(K, Desc) ->
|
m(K, Desc) ->
|
||||||
{K, mk(non_neg_integer(), #{desc => Desc})}.
|
{K, mk(non_neg_integer(), #{desc => Desc})}.
|
||||||
|
|
Loading…
Reference in New Issue