Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/issue 273 - Modify the logging of the timeseries Lambda response object to reduce the log statement size #274

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

nikki-t
Copy link
Collaborator

@nikki-t nikki-t commented Dec 11, 2024

Github Issue: #273

Description

The timeseries Lambda function logs need to be modified so that the entire response is not logged as this was causing issues with the log ingest into the Cloud Metrics platform. The logs were modified to retain the response status, time, and hits.

The timeseries Lambda function was also modified to log errors more consistently without modifying the error message sent to the end user. The errors are now logged as JSON data with the HTTP code and error message for each error type.

Overview of work done

  • Modified timeseries.py to remove logging of response results but retain logging of other response data.
  • Modified timeseries.py to consistently log all types of errors with an HTTP code and error message. Existing errors returned to end user were preserved to prevent breaking changes.

Overview of verification done

  • Functionality not changed, existing unit tests pass.

Overview of integration done

  • Tested locally on all response types: geoJSON, CSV, as well as compact responses via accept headers and compact query parameter.
  • Tested locally on all error types: Invalid accept header, missing header, invalid request query parameter, feature not found in table, unsupported media, invalid accept header with query parameter
  • Deployed to SIT environment, ran tests on different response and error types, and checked that new log format could be ingested into the Cloud Metrics platform.

Sample log for response data:

[INFO] 2024-12-11T19:56:04.772Z f962762c-d639-4ed1-b9db-ff9002126d7 response: 
{
    "status": "200 OK",
    "time": 2510.143,
    "hits": 2
}

Sample log for error data:

[ERROR] 2024-12-11T21:39:29.608Z 562537d4-54db-450d-af6d-94eb6f9fc5e8 
{
    "http_code": 400,
    "error_message": "400: Results with the specified Feature ID 72390300017 were not found"
}

PR checklist:

  • Linted
  • Updated unit tests
  • Updated changelog
  • Integration testing

See Pull Request Review Checklist for pointers on reviewing this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant