In our scenario, fluentd-plugin-prometheus was used to collect metrics, some metrics label parsed from regexp, while some fields are not ASCII.
Result show unreadble code
fluentd conf
<source>
@type forward
port 24224
bind 0.0.0.0
</source>
- result
we get correct stdout
> 2020-05-06 15:00:18.062825596 +0800 test.log: {"log":"2020-05-05 11:17:53.755,test,テスト,49","logTime":"2020-05-05 11:17:53.755","spi":"test","spiDesc":"テスト","duration":49}
but metric labels are unreadble
> \# TYPE message_log_counter counter
> \# HELP message_log_counter The total number of log in message.
> message_log_counter{spi="test",spiDesc="銉嗐偣銉�"} 1.0
> \# TYPE message_log_gauge gauge
> \# HELP message_log_gauge The gauge number of log in message.
> message_log_gauge{spi="test",spiDesc="銉嗐偣銉�"} 49.0
what's wrong?
- version
fluent-plugin-prometheus 1.7.3
fluentd 1.10.3
ruby 2.7.1p83
In our scenario, fluentd-plugin-prometheus was used to collect metrics, some metrics label parsed from regexp, while some fields are not ASCII. Result show unreadble code
<filter **> @type record_transformer char_encoding utf-8
echo '{"log":"2020-05-05 11:17:53.755,test,テスト,49"}' |fluent-cat test.log