File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,35 @@ def influx_tag_parser(tag)
240240 tag . delete ( 'broker-service' )
241241 end
242242
243+ if tag . include? ( 'postgres' ) && tag . include? ( 'databases' )
244+ n = tag . index ( 'databases' )
245+ db_name = tag [ n + 1 ]
246+ tag_set = "#{ tag_set } database=#{ db_name } ,"
247+ tag . delete_at ( n + 1 )
248+ end
249+
250+ if tag . include? ( 'postgres' ) && tag . include? ( 'replication_slots' )
251+ n = tag . index ( 'replication_slots' )
252+ slot_name = tag [ n + 1 ]
253+ tag_set = "#{ tag_set } replication_slot=#{ slot_name } "
254+ tag . delete_at ( n + 1 )
255+ end
256+
257+ if tag . include? ( 'postgres' ) && tag . include? ( 'replication_subs' )
258+ n = tag . index ( 'replication_subs' )
259+ slot_name = tag [ n + 1 ]
260+ tag_set = "#{ tag_set } replication_slot=#{ slot_name } "
261+ tag . delete_at ( n + 1 )
262+ end
263+
264+ if tag . include? ( 'postgres' ) && [ 'table_stats' , 'index_stats' , 'toast_stats' ] . any? { |e | tag . include? ( e ) }
265+ metric = [ 'table_stats' , 'index_stats' , 'toast_stats' ] . find { |e | tag . include? ( e ) }
266+ n = tag . index ( metric )
267+ relation = tag [ n + 1 ]
268+ tag_set = "#{ tag_set } relation=#{ relation } "
269+ tag . delete_at ( n + 1 )
270+ end
271+
243272 if tag . include? ( 'Queue' )
244273 n = tag . index ( 'Queue' )
245274 amq_destination_name = tag [ n + 1 ]
You can’t perform that action at this time.
0 commit comments