Skip to content

Commit

Permalink
feat(dswx-s1): logging improvements
Browse files Browse the repository at this point in the history
Refs #787
  • Loading branch information
chrisjrd committed Apr 18, 2024
1 parent 8efe6b2 commit 5532dcd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion commons/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def filter(self, record):
if not record.funcName == "log_request_success":
return True

# 'POST http://<es host>/<index pattern>/_search?... [status:200 request:0.013s]'
# 'POST http://<es host>/<index>/_update/<product ID> [status:200 request:0.018s]'
return "/job_specs/_doc/" not in record.getMessage() \
and "/hysds_ios-grq/_doc/" not in record.getMessage() \
and "/containers/_doc/" not in record.getMessage()
and "/containers/_doc/" not in record.getMessage() \
and "/_search?" not in record.getMessage() \
and "/_update" not in record.getMessage()
6 changes: 3 additions & 3 deletions data_subscriber/cmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ async def async_query_cmr(args, token, cmr, settings, timerange, now: datetime,

product_granules = await _async_request_search_cmr_granules(args, request_url, [params])
search_results_count = len(product_granules)
logger.info(f"Found {search_results_count} granules")
logger.info([(granule["granule_id"], granule["revision_id"]) for granule in product_granules])
logger.info(f"QUERY RESULTS: Found {search_results_count} granules")
logger.info(f'QUERY RESULTS: {[(granule["granule_id"], "revision " + str(granule["revision_id"])) for granule in product_granules]}')

# Filter out granules with revision-id greater than max allowed
least_revised_granules = []
Expand All @@ -186,7 +186,7 @@ async def async_query_cmr(args, token, cmr, settings, timerange, now: datetime,

if len(product_granules) != search_results_count:
logger.info(f"Filtered to {len(product_granules)} total granules after shortname filter check")
logger.info([(granule["granule_id"], granule["revision_id"]) for granule in product_granules])
logger.info([(granule["granule_id"], "revision " + str(granule["revision_id"])) for granule in product_granules])

for granule in product_granules:
granule["filtered_urls"] = _filter_granules(granule, args)
Expand Down

0 comments on commit 5532dcd

Please sign in to comment.