Skip to content

Commit

Permalink
Add source field to kafka event
Browse files Browse the repository at this point in the history
  • Loading branch information
nudded committed Nov 28, 2024
1 parent a8b68ec commit c9e0c85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/services/events/create_batch_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def produce_kafka_event(event)
code: event.code,
properties: event.properties,
ingested_at: Time.zone.now.iso8601[...-1],
precise_total_amount_cents: event.precise_total_amount_cents.present? ? event.precise_total_amount_cents.to_s : "0.0"
precise_total_amount_cents: event.precise_total_amount_cents.present? ? event.precise_total_amount_cents.to_s : "0.0",
source: 'http_ruby'
}.to_json
)
end
Expand Down
3 changes: 2 additions & 1 deletion app/services/events/create_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def produce_kafka_event(event)
# NOTE: Default value to 0.0 is required for clickhouse parsing
precise_total_amount_cents: event.precise_total_amount_cents.present? ? event.precise_total_amount_cents.to_s : "0.0",
properties: event.properties,
ingested_at: Time.zone.now.iso8601[...-1]
ingested_at: Time.zone.now.iso8601[...-1],
source: 'http_ruby'
}.to_json
)
end
Expand Down

0 comments on commit c9e0c85

Please sign in to comment.