I'm using the ruby-style syntax to define fluentd configuration. I have a config block that looks like:
match('output.**') do
type :copy
store {
type :prometheus
metric {
name :fluentd_output_status_num_records_total
type :counter
desc 'The total number of outgoing records'
labels {
tag '${tag}'
}
}
}
end
But when I try running the code, I get the error:
config error file=\"config/fluent.conf.rb\" error_class=Fluent::ConfigError error=\"type option must be 'counter', 'gauge', 'summary' or 'histogram'\"
I hunted down the line of code that was generating that error:
|
raise ConfigError, "type option must be 'counter', 'gauge', 'summary' or 'histogram'" |
I tweaked the error message that it output to write the keys of the element hash. I got:
type option must be 'counter', 'gauge', 'summary' or 'histogram', element keys: name,@type,desc
As far as I can tell, the Fluent::Config::Element class has some magic in it that turns type into @type as a hash key.
I'm using the ruby-style syntax to define fluentd configuration. I have a config block that looks like:
But when I try running the code, I get the error:
config error file=\"config/fluent.conf.rb\" error_class=Fluent::ConfigError error=\"type option must be 'counter', 'gauge', 'summary' or 'histogram'\"I hunted down the line of code that was generating that error:
fluent-plugin-prometheus/lib/fluent/plugin/prometheus.rb
Line 78 in b1421b5
I tweaked the error message that it output to write the keys of the
elementhash. I got:As far as I can tell, the
Fluent::Config::Elementclass has some magic in it that turnstypeinto@typeas a hash key.