Skip to content

pushing metrics with instance grouping_key would result: instance is reserved  #275

Description

@LeoQuote
def push_metrics(registry)
  hostname = `hostname`.strip
  puts "pusing metrics"
  require 'prometheus/client/push'
  Prometheus::Client::Push.new(
    job: 'check_puppet',
    gateway: 'https://pushgateway.mydomain.com',
    grouping_key: { instance: hostname }
  ).add(registry)
end
/usr/local/lib64/ruby/gems/2.7.0/gems/prometheus-client-4.0.0/lib/prometheus/client/label_set_validator.rb:77:in `validate_reserved_key': instance is reserved (Prometheus::Client::LabelSetValidator::ReservedLabelError)
        from /usr/local/lib64/ruby/gems/2.7.0/gems/prometheus-client-4.0.0/lib/prometheus/client/label_set_validator.rb:32:in `block in validate_symbols!'
        from /usr/local/lib64/ruby/gems/2.7.0/gems/prometheus-client-4.0.0/lib/prometheus/client/label_set_validator.rb:29:in `each'
        from /usr/local/lib64/ruby/gems/2.7.0/gems/prometheus-client-4.0.0/lib/prometheus/client/label_set_validator.rb:29:in `all?'
        from /usr/local/lib64/ruby/gems/2.7.0/gems/prometheus-client-4.0.0/lib/prometheus/client/label_set_validator.rb:29:in `validate_symbols!'
        from /usr/local/lib64/ruby/gems/2.7.0/gems/prometheus-client-4.0.0/lib/prometheus/client/push.rb:35:in `initialize'

instance should be allowed , why this is not allowed even in pushgateway?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions