Class: Kamal::Output::OtelLogger
- Inherits:
-
BaseLogger
- Object
- BaseLogger
- Kamal::Output::OtelLogger
- Defined in:
- lib/kamal/output/otel_logger.rb
Constant Summary collapse
- DEPLOY_COMMANDS =
%w[ deploy redeploy rollback setup ].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #<<(message) ⇒ Object
-
#initialize(endpoint:, tags:, service: nil) ⇒ OtelLogger
constructor
A new instance of OtelLogger.
Constructor Details
#initialize(endpoint:, tags:, service: nil) ⇒ OtelLogger
Returns a new instance of OtelLogger.
11 12 13 14 15 16 |
# File 'lib/kamal/output/otel_logger.rb', line 11 def initialize(endpoint:, tags:, service: nil) @endpoint = endpoint @shipper = Kamal::OtelShipper.new(endpoint: endpoint, tags: ) @service = service super() end |
Class Method Details
.build(settings:, config:) ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/kamal/output/otel_logger.rb', line 2 def self.build(settings:, config:) raise ArgumentError, "OTel endpoint is required" unless settings["endpoint"] new( endpoint: settings["endpoint"], tags: Kamal::Tags.from_config(config).except(:service_version, :recorded_at), service: config.service ) end |
Instance Method Details
#<<(message) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/kamal/output/otel_logger.rb', line 18 def <<() host = Thread.current[:kamal_host] iostream = Thread.current[:kamal_iostream] severity = Thread.current[:kamal_severity] @shipper.append(, host: host, iostream: iostream, severity: severity) end |