Skip to content

Commit

Permalink
chore(CE): Add create log message to HTTP model (#686) (#521)
Browse files Browse the repository at this point in the history
Co-authored-by: TivonB-AI2 <[email protected]>
  • Loading branch information
github-actions[bot] and TivonB-AI2 authored Dec 10, 2024
1 parent 3449fe7 commit dc58bf7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion integrations/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GIT
PATH
remote: .
specs:
multiwoven-integrations (0.15.8)
multiwoven-integrations (0.15.9)
MailchimpMarketing
activesupport
async-websocket
Expand Down
6 changes: 3 additions & 3 deletions integrations/lib/multiwoven/integrations/core/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def log_request_response(level, request, response)
)
end

def create_log_message(context, type, exception)
def create_log_message(context, type, message)
Integrations::Protocol::LogMessage.new(
name: context,
level: type,
message: exception.message
message: message
).to_multiwoven_message
end

Expand All @@ -74,7 +74,7 @@ def handle_exception(exception, meta = {})
"#{hash_to_string(meta)}: #{exception.message}"
)
report_exception(exception, meta)
create_log_message(meta[:context], meta[:type], exception)
create_log_message(meta[:context], meta[:type], exception.message)
end

def hash_to_string(hash)
Expand Down
2 changes: 1 addition & 1 deletion integrations/lib/multiwoven/integrations/rollout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Multiwoven
module Integrations
VERSION = "0.15.8"
VERSION = "0.15.9"

ENABLED_SOURCES = %w[
Snowflake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def process_response(response)
data = JSON.parse(response.body)
[RecordMessage.new(data: data, emitted_at: Time.now.to_i).to_multiwoven_message]
else
create_log_message("DATABRICKS MODEL:RUN_MODEL", "error", "request failed")
create_log_message("DATABRICKS MODEL:RUN_MODEL", "error", "request failed: #{response.body}")
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def process_response(response)
data = JSON.parse(response.body)
[RecordMessage.new(data: data, emitted_at: Time.now.to_i).to_multiwoven_message]
else
create_log_message("HTTP MODEL:RUN_MODEL", "error", "request failed")
create_log_message("HTTP MODEL:RUN_MODEL", "error", "request failed: #{response.body}")
end
end

Expand Down

0 comments on commit dc58bf7

Please sign in to comment.