Skip to content

Commit

Permalink
Make 'pid' a reserved label
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Sinjakli committed Jun 12, 2019
1 parent 22e6965 commit 922a96c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/prometheus/client/label_set_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Client
# Prometheus specification.
class LabelSetValidator
# TODO: we might allow setting :instance in the future
BASE_RESERVED_LABELS = [:job, :instance].freeze
BASE_RESERVED_LABELS = [:job, :instance, :pid].freeze

class LabelSetError < StandardError; end
class InvalidLabelSetError < LabelSetError; end
Expand Down
2 changes: 1 addition & 1 deletion spec/prometheus/client/label_set_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
end

it 'raises ReservedLabelError if a label key is reserved' do
[:job, :instance].each do |label|
[:job, :instance, :pid].each do |label|
expect do
validator.validate_symbols!(label => 'value')
end.to raise_exception(described_class::ReservedLabelError)
Expand Down

0 comments on commit 922a96c

Please sign in to comment.