Module: AceMQ::AMQP::Telemetry::Outcome

Defined in:
lib/acemq/amqp/telemetry.rb

Overview

The words the outcome tag is allowed to take.

A closed list, and the same list in all five languages, because an outcome tag is only worth having if a dashboard can enumerate it. The delivery outcomes are the Settlement words letter for letter — the counter that goes up and the messaging.acemq.outcome attribute on the span for the same delivery are read off the one decision and cannot disagree.

Constant Summary collapse

CONFIRMED =

A publish the broker took.

"confirmed"
UNROUTABLE =

A publish the broker accepted and could route nowhere.

"unroutable"
FAILED =

A publish that may have been lost: the broker nacked it, the confirm never came, it could not be written, or the connection failed partway. The message may or may not be on the broker, which is what makes this the outcome worth alerting on.

"failed"
REFUSED =

A publish this library declined before writing anything: a PublishingPausedError, raised while the broker has blocked the connection or while the connection is being recovered. Nothing was sent, so nothing was lost and a retry cannot duplicate it. Kept apart from FAILED so a broker alarm does not read as message loss; the same word in all five libraries.

"refused"
ACKED =

The handler was happy.

"acked"
RETRIED =

Going round again.

"retried"
DEAD_LETTERED =

Out of attempts, or marked as something retrying cannot fix.

"dead_lettered"
REJECTED =

Refused by the handler.

"rejected"
PARKED =

Nothing could read it.

"parked"
IN_PROGRESS =

Put back because another consumer holds a live idempotency claim on it, with the attempt unchanged: not a retry, never a dead letter.

"in_progress"
ANSWERED =

A request that got its answer, and one that ran out of patience.

"answered"
TIMED_OUT =
"timed_out"
PUBLISHED =

An outbox record that made it out.

"published"
COMPLETED =

A pipeline run that reached the end of its route, and one a step stopped before the end.

"completed"
ENDED_EARLY =
"ended_early"
ALL =

Every word above, for a test that wants to check a tag is one of them.

[CONFIRMED, UNROUTABLE, FAILED, REFUSED, ACKED, RETRIED, DEAD_LETTERED,
REJECTED, PARKED, IN_PROGRESS, ANSWERED, TIMED_OUT, PUBLISHED, COMPLETED,
ENDED_EARLY].freeze

Class Method Summary collapse

Class Method Details

.of_publish_failure(failure) ⇒ String

Which word a publish that raised should be counted and traced under.

Here rather than in either caller because both of them ask: the counter in Connection#publish and the span in AceMQ::AMQP::Telemetry::OpenTelemetry#on_error have to reach the same answer about the same failure, and two copies of this line is exactly how they would stop.

Asked with respond_to? so that anything raised on the publish path can go through it, not only a PublishError.

Parameters:

  • failure (Exception)

Returns:

  • (String) —

    refused, unroutable or failed



290
291
292
293
294
# File 'lib/acemq/amqp/telemetry.rb', line 290

def self.of_publish_failure(failure)
  return REFUSED if failure.is_a?(PublishingPausedError)

  failure.respond_to?(:unroutable?) && failure.unroutable? ? UNROUTABLE : FAILED
end