File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
spring-boot-admin-server-ui/src/main/frontend/services Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -67,12 +67,24 @@ class Instance {
6767 }
6868
6969 async fetchMetric ( metric , tags ) {
70- const params = tags ? {
71- tag : Object . entries ( tags )
70+ const params = new URLSearchParams ( ) ;
71+ if ( tags ) {
72+ let firstElementDuplicated = false ;
73+ Object . entries ( tags )
7274 . filter ( ( [ , value ] ) => typeof value !== 'undefined' && value !== null )
73- . map ( ( [ name , value ] ) => `${ name } :${ value } ` )
74- . join ( ',' )
75- } : { } ;
75+ . forEach ( ( [ name , value ] ) => {
76+ params . append ( 'tag' , `${ name } :${ value } ` ) ;
77+
78+ if ( ! firstElementDuplicated ) {
79+ // workaround for tags that contains comma
80+ // take a look at https://github.com/spring-projects/spring-framework/issues/23820#issuecomment-543087878
81+ // If there is single tag specified and name or value contains comma then it will be incorrectly split into several parts
82+ // To bypass it we duplicate first tag.
83+ params . append ( 'tag' , `${ name } :${ value } ` ) ;
84+ firstElementDuplicated = true ;
85+ }
86+ } )
87+ }
7688 return this . axios . get ( uri `actuator/metrics/${ metric } ` , {
7789 params
7890 } ) ;
You can’t perform that action at this time.
0 commit comments