You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
<source>
@type prometheus
port 24231
bind 0.0.0.0
metrics_path /metrics
aggregated_metrics_path /aggregated_metrics
</source>
<filter **>
@type record_transformer
char_encoding utf-8
</filter>
<filter test.log>
@type parser
key_name log
reserve_time true
reserve_data true
emit_invalid_record_to_error true
<parse>
@type regexp
expression /(?<logTime>^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}),(?<spi>.*),(?<spiDesc>.*),(?<duration>\d+)$/
time_key logTime
time_format %Y-%m-%d %H:%M:%S.%L
keep_time_key true
null_empty_string true
types duration:integer,spiDesc:string
</parse>
</filter>
<match test.log>
@type copy
<store>
@type stdout
</store>
<store>
@type prometheus
<metric>
name message_log_counter
type counter
desc The total number of log in message.
<labels>
spi ${spi}
spiDesc ${spiDesc}
</labels>
</metric>
<metric>
name message_log_gauge
type gauge
desc The gauge number of log in message.
key duration
<labels>
spi ${spi}
spiDesc ${spiDesc}
</labels>
</metric>
</store>
</match>
# 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
The text was updated successfully, but these errors were encountered:
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
we get correct stdout
but metric labels are unreadble
what's wrong?
fluent-plugin-prometheus 1.7.3
fluentd 1.10.3
ruby 2.7.1p83
The text was updated successfully, but these errors were encountered: