Sha256: 5653ddd03a9d300f43234c8a66b66c80fa3a99855407f605f3409e336f699d30
Contents?: true
Size: 799 Bytes
Versions: 12
Compression:
Stored size: 799 Bytes
Contents
# frozen_string_literal: true module Sbmt module KafkaConsumer module Probes module Probe HEADERS = {"Content-Type" => "application/json"}.freeze def call(env) with_error_handler { probe(env) } end def meta {} end def probe_ok(extra_meta = {}) [200, HEADERS, [meta.merge(extra_meta).to_json]] end def probe_error(extra_meta = {}) KafkaConsumer.logger.error("probe error meta: #{meta.merge(extra_meta).inspect}") [500, HEADERS, [meta.merge(extra_meta).to_json]] end def with_error_handler yield rescue => error probe_error(error_class: error.class.name, error_message: error.message) end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems