Skip to content

Commit

Permalink
Added tag-parts, suffixes and prefixes
Browse files Browse the repository at this point in the history
Signed-off-by: Jesper Söderlund <[email protected]>
  • Loading branch information
Jesper Söderlund committed Mar 22, 2019
1 parent d344192 commit 24e32a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 2 additions & 4 deletions spec/fluent/plugin/filter_prometheus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
require 'fluent/test/driver/filter'
require 'fluent/plugin/filter_prometheus'
require_relative 'shared'
require 'json'

describe Fluent::Plugin::PrometheusFilter do
let(:tag) { 'prometheus.test' }
let(:tag) { 'prometheus.test.additional.parts' }
let(:driver) { Fluent::Test::Driver::Filter.new(Fluent::Plugin::PrometheusFilter).configure(config) }
let(:registry) { ::Prometheus::Client.registry }

Expand Down Expand Up @@ -32,7 +33,4 @@
expect(es.first).to eq(message)
end
end

it_behaves_like 'instruments record'
end
end
4 changes: 4 additions & 0 deletions spec/fluent/plugin/shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,15 @@
key foo
<labels>
foo ${foo}
the_prefix ${tag_prefix[2]}
another_part ${tag_parts[0]}
</labels>
</metric>
<labels>
tag ${tag}
hostname ${hostname}
single_part ${tag_parts[1]}
the_suffix ${tag_suffix[2]}
</labels>
]

Expand Down

0 comments on commit 24e32a7

Please sign in to comment.