log content type and status code in metrics
This commit is contained in:
@@ -157,6 +157,7 @@ class Scraper::HttpClient
|
||||
method: "GET",
|
||||
host: uri.host,
|
||||
status_code: response_code,
|
||||
content_type: clean_content_type(content_type),
|
||||
performed_by: @http_performer.name,
|
||||
},
|
||||
fields: {
|
||||
@@ -165,6 +166,8 @@ class Scraper::HttpClient
|
||||
content_size: response_blob_entry.size,
|
||||
content_stored: response_blob_entry.bytes_stored,
|
||||
uri: uri.to_s,
|
||||
status_code: response_code,
|
||||
content_type: clean_content_type(content_type),
|
||||
},
|
||||
)
|
||||
|
||||
@@ -197,4 +200,8 @@ class Scraper::HttpClient
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def clean_content_type(ct)
|
||||
ct.split(";").first.strip
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user