Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Fix localhost setting for non-endpoint analytics calls [#1029] #1130

Merged
merged 2 commits into from
Aug 23, 2022

Conversation

pattisdr
Copy link
Contributor

@pattisdr pattisdr commented Aug 22, 2022

Purpose

Follow-up to #993

When we added analytics for failed request execution or retrying a request, we couldn't set localhost to the proper value because fideslog didn't allow it to be set to None.

Changes

  • Because these analytics events are not coming from API endpoints, but rather celery tasks, set localhost to None instead of a default False.

Checklist

  • Update CHANGELOG.md file
    • Merge in main so the most recent CHANGELOG.md file is being appended to
    • Add description within the Unreleased section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.
    • Add a link to this PR at the end of the description with the PR number as the text. example: #1
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #1029

@@ -98,7 +98,7 @@ def failed_graph_analytics_event(
docker=in_docker_container(),
event="privacy_request_execution_failure",
event_created_at=datetime.now(tz=timezone.utc),
local_host=False, # Temporarily defaulting to False, but we are going to change this to None
local_host=None,
endpoint=None,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally that it is now possible to make these calls to fideslog after Phil's work here ethyca/fideslog#79

@pattisdr pattisdr marked this pull request as ready for review August 23, 2022 15:18
@sanders41 sanders41 merged commit 36cc41e into main Aug 23, 2022
@sanders41 sanders41 deleted the 1029_analytics_non_endpoint_tracking branch August 23, 2022 15:39
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
* Set local_host to None for non-endpoint analytics calls.  These are logging various tasks coming out of celery.

* Update Changelog.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update AnalyticsEvent.local_host for non-endpoint events
2 participants