Class: Foam::Otel::Ingest::MetricStampExporter

Inherits:
StampExporter show all
Defined in:
lib/foam/otel/ingest.rb

Instance Method Summary collapse

Methods inherited from StampExporter

#force_flush, #initialize, #reset, #shutdown

Constructor Details

This class inherits a constructor from Foam::Otel::Ingest::StampExporter

Instance Method Details

#export(metrics, timeout: nil) ⇒ Object



592
593
594
595
596
597
598
599
600
# File 'lib/foam/otel/ingest.rb', line 592

def export(metrics, timeout: nil)
  out, dropped = stamp_batch(metrics, "metric")
  Ingest.narrate(@config, "ingest metric tap exporting #{out.length} metric(s)")
  result = out.empty? ? EXPORT_SUCCESS : @inner.export(out, timeout: timeout)
  dropped.positive? ? EXPORT_FAILURE : result
rescue StandardError, SystemStackError
  Diagnostics.warn("ingest metric tap: export raised past its guards — batch dropped (fail-closed, rule 15)")
  EXPORT_FAILURE
end