Skip to content

Commit

Permalink
Add Metrics for dead letter queue
Browse files Browse the repository at this point in the history
Add an initial set of metrics for the dead letter queue.

Metrics are supplied under the pipeline in the following format:

"dead_letter_queue": {
        "queue_size_in_bytes": ...,
      }

Metrics are populated via a PeriodicPoller

Also fixed up calculation of currentQueueSize to take account
of version headers, which was previously being skipped.

Additionally, whether the dlq is enabled, and if so, the path
of the dlq is supplied under the pipelines API endpoint

Resolves elastic#7287
  • Loading branch information
robbavey committed Jun 15, 2017
1 parent e939c6a commit f3f3ab9
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions qa/integration/specs/monitoring_api_spec.rb
Expand Up @@ -48,25 +48,6 @@
end
end

it 'can retrieve dlq stats' do
logstash_service = @fixture.get_service("logstash")
logstash_service.start_with_stdin
logstash_service.wait_for_logstash
Stud.try(max_retry.times, [StandardError, RSpec::Expectations::ExpectationNotMetError]) do
# node_stats can fail if the stats subsystem isn't ready
result = logstash_service.monitoring_api.node_stats rescue nil
expect(result).not_to be_nil
# we use fetch here since we want failed fetches to raise an exception
# and trigger the retry block
queue_stats = result.fetch('pipelines').fetch('main')['dead_letter_queue']
if logstash_service.settings.get("dead_letter_queue.enable")
expect(queue_stats['queue_size_in_bytes']).not_to be_nil
else
expect(queue_stats).to be nil
end
end
end

it "can retrieve queue stats" do
logstash_service = @fixture.get_service("logstash")
logstash_service.start_with_stdin
Expand Down Expand Up @@ -116,7 +97,7 @@
logging_put_assert logstash_service.monitoring_api.logging_put({"logger." => "INFO"})
logging_get_assert logstash_service, "INFO", "TRACE"

#package logger
#package logger
logging_put_assert logstash_service.monitoring_api.logging_put({"logger.logstash.agent" => "DEBUG"})
expect(logstash_service.monitoring_api.logging_get["loggers"]["logstash.agent"]).to eq ("DEBUG")
logging_put_assert logstash_service.monitoring_api.logging_put({"logger.logstash.agent" => "INFO"})
Expand Down

0 comments on commit f3f3ab9

Please sign in to comment.