@@ -527,11 +527,30 @@ has_value_p(_) ->
527527 true .
528528
529529collect_metrics (_ , {Type , Fun , Items }) ->
530+ erlang :process_flag (min_heap_size , 46422 * 32 ),
531+ erlang :process_flag (min_bin_vheap_size , 46422 * 32 ),
530532 [metric (Type , labels (Item ), V ) || {Item , V } <- [{Item , Fun (Item )} || Item <- Items ], has_value_p (V )].
531533
532534labels (Item ) ->
533535 label (element (1 , Item )).
534536
537+ label (channel_exchange_metrics ) -> <<>>;
538+ label (channel_metrics ) -> <<>>;
539+ label (channel_process_metrics ) -> <<>>;
540+ label (channel_queue_exchange_metrics ) -> <<>>;
541+ label (channel_queue_metrics ) -> <<>>;
542+ label (connection_coarse_metrics ) -> <<>>;
543+ label (connection_metrics ) -> <<>>;
544+ label (exchange_metrics ) -> <<>>;
545+ label (queue_coarse_metrics ) -> <<>>;
546+ label (queue_delivery_metrics ) -> <<>>;
547+ label (queue_exchange_metrics ) -> <<>>;
548+ label (queue_metrics ) -> <<>>;
549+ label (stream_consumer_metrics ) -> <<>>;
550+ label (amqp091 ) -> <<" protocol=\" amqp091\" " >>;
551+ label (amqp10 ) -> <<" protocol=\" amqp10\" " >>;
552+ label (mqtt ) -> <<" protocol=\" mqtt\" " >>;
553+ label (http ) -> <<" protocol=\" http\" " >>;
535554label (L ) when is_binary (L ) ->
536555 L ;
537556label (M ) when is_map (M ) ->
@@ -577,14 +596,7 @@ label({I1, I2}) ->
577596 end ;
578597label (P ) when is_pid (P ) ->
579598 <<" channel=\" " , (iolist_to_binary (pid_to_list (P )))/binary , " \" " >>;
580- label (A ) when is_atom (A ) ->
581- case is_protocol (A ) of
582- true -> <<" protocol=\" " , (atom_to_binary (A , utf8 ))/binary , " \" " >>;
583- false -> <<>>
584- end .
585-
586- is_protocol (P ) ->
587- lists :member (P , [amqp091 , amqp10 , mqtt , http ]).
599+ label (_ ) -> <<>>.
588600
589601metric (counter , Labels , Value ) ->
590602 emit_counter_metric_if_defined (Labels , Value );
0 commit comments