@@ -525,11 +525,30 @@ has_value_p(_) ->
525525 true .
526526
527527collect_metrics (_ , {Type , Fun , Items }) ->
528+ erlang :process_flag (min_heap_size , 46422 * 32 ),
529+ erlang :process_flag (min_bin_vheap_size , 46422 * 32 ),
528530 [metric (Type , labels (Item ), V ) || {Item , V } <- [{Item , Fun (Item )} || Item <- Items ], has_value_p (V )].
529531
530532labels (Item ) ->
531533 label (element (1 , Item )).
532534
535+ label (channel_exchange_metrics ) -> <<>>;
536+ label (channel_metrics ) -> <<>>;
537+ label (channel_process_metrics ) -> <<>>;
538+ label (channel_queue_exchange_metrics ) -> <<>>;
539+ label (channel_queue_metrics ) -> <<>>;
540+ label (connection_coarse_metrics ) -> <<>>;
541+ label (connection_metrics ) -> <<>>;
542+ label (exchange_metrics ) -> <<>>;
543+ label (queue_coarse_metrics ) -> <<>>;
544+ label (queue_delivery_metrics ) -> <<>>;
545+ label (queue_exchange_metrics ) -> <<>>;
546+ label (queue_metrics ) -> <<>>;
547+ label (stream_consumer_metrics ) -> <<>>;
548+ label (amqp091 ) -> <<" protocol=\" amqp091\" " >>;
549+ label (amqp10 ) -> <<" protocol=\" amqp10\" " >>;
550+ label (mqtt ) -> <<" protocol=\" mqtt\" " >>;
551+ label (http ) -> <<" protocol=\" http\" " >>;
533552label (L ) when is_binary (L ) ->
534553 L ;
535554label (M ) when is_map (M ) ->
@@ -575,14 +594,7 @@ label({I1, I2}) ->
575594 end ;
576595label (P ) when is_pid (P ) ->
577596 <<" channel=\" " , (iolist_to_binary (pid_to_list (P )))/binary , " \" " >>;
578- label (A ) when is_atom (A ) ->
579- case is_protocol (A ) of
580- true -> <<" protocol=\" " , (atom_to_binary (A , utf8 ))/binary , " \" " >>;
581- false -> <<>>
582- end .
583-
584- is_protocol (P ) ->
585- lists :member (P , [amqp091 , amqp10 , mqtt , http ]).
597+ label (_ ) -> <<>>.
586598
587599metric (counter , Labels , Value ) ->
588600 emit_counter_metric_if_defined (Labels , Value );
0 commit comments