Skip to content

Commit

Permalink
underscored properties are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
agardnerIT committed Jul 29, 2024
1 parent df25ec3 commit f6f5204
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions har-to-otel/har-to-otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import argparse
import sys

HAR_TO_OTEL_VERSION="0.10.0"
HAR_TO_OTEL_VERSION="0.11.0"

##### Start input processing

Expand Down Expand Up @@ -199,7 +199,7 @@ def run_tracepusher(args=""):
item_page_ref = loaded_item['pageref']
item_name = loaded_item['request']['url']

ui_time_dev_tools = round(loaded_item['time']) - round(loaded_item['timings']['_blocked_queueing'])
ui_time_dev_tools = round(loaded_item['time']) - round(loaded_item['timings']['blocked'])
span_attributes = ""

if page_ref == item_page_ref and item_name == page_name:
Expand Down Expand Up @@ -235,11 +235,15 @@ def run_tracepusher(args=""):
span_attributes += f"request.cookies.cookie.{cookie_name}.{key}=\"{cookie[key]}\" "

# Add response details
span_attributes += f"response.status={loaded_item['response']['status']} "
span_attributes += f"response.statusText=\"{loaded_item['response']['statusText']}\" "
span_attributes += f"response.httpVersion={loaded_item['response']['httpVersion']} "
span_attributes += f"response.content.size={loaded_item['response']['content']['size']} "
span_attributes += f"response._transferSize={loaded_item['response']['_transferSize']} "
try:
span_attributes += f"response.status={loaded_item['response']['status']} "
span_attributes += f"response.statusText=\"{loaded_item['response']['statusText']}\" "
span_attributes += f"response.httpVersion={loaded_item['response']['httpVersion']} "
span_attributes += f"response.content.size={loaded_item['response']['content']['size']} "
span_attributes += f"response._transferSize={loaded_item['response']['_transferSize']} "
except:
pass

# Add response headers
if ADD_RESPONSE_HEADERS:
if DEBUG_MODE:
Expand Down

0 comments on commit f6f5204

Please sign in to comment.