Skip to content

Conversation

cleroymira-unabiz
Copy link

Hi,

This aims at fixing warning we see in logs:

{"time":"2025-06-23","level":"warn","message":"send an error event stream to @ERROR: error_class=NoMethodError error=\"undefined method `split' for nil:NilClass\\n\\n          tags = tag.split('.')\\n                    ^^^^^^\" location=\"/fluentd/vendor/bundle/ruby/3.1.0/gems/fluent-plugin-prometheus-2.1.0/lib/fluent/plugin/prometheus/placeholder_expander.rb:42:in `build_tag'\" tag=nil","worker_id":0

I hope it is not too naive.

Thanks!

Signed-off-by: Colin Leroy-Mira <colin.leroy-mira@unabiz.com>
@Watson1978
Copy link
Contributor

Can you add test cases?

@daipom
Copy link

daipom commented Jun 30, 2025

Thanks!
It appears that it is usually impossible for tag to be nil.
Can you please provide a simple way to reproduce that error?

@cleroymira-unabiz
Copy link
Author

Hi,

Thanks! It appears that it is usually impossible for tag to be nil. Can you please provide a simple way to reproduce that error?

It comes from a misconfiguration: we forgot "key" in a

<filter message>
  @type prometheus
  <metric>
    name message_foo_counter
    type counter
    desc The total number of foo in message.
    #key foo
  </metric>
</filter>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants