Skip to content

adding metadata to logs#244

Open
shourya116 wants to merge 3 commits intomainfrom
add-metadata-to-log
Open

adding metadata to logs#244
shourya116 wants to merge 3 commits intomainfrom
add-metadata-to-log

Conversation

@shourya116
Copy link
Collaborator

No description provided.

@shourya116 shourya116 requested a review from thinhha June 23, 2023 06:38
clouddq/log.py Outdated
labels={
"name": APP_NAME,
"releaseId": APP_VERSION,
"metadata": str(metadata),
Copy link
Contributor

Choose a reason for hiding this comment

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

Please ensure the metadata is not included as a string but as a nested object in the logs. I think this means instead of str() we need to use json.dumps()

clouddq/main.py Outdated
Comment on lines 285 to 290
dataplex_batch_name = os.environ.get("DATAPLEX_BATCH_NAME")
dataplex_task_name = os.environ.get("DATAPLEX_TASK_NAME")
if dataplex_batch_name:
metadata["dataplex_batch_name"] = dataplex_batch_name
if dataplex_task_name:
metadata["dataplex_task_name"] = dataplex_task_name
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move this out of the ifelse

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we move this out than both the variables will be included into the metadata dictionary. Instead if add_metadata_to_logs is set to false we need to create a new dictionary for both the variables and pass it into the add_cloud_logging_handler().

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can surely move out the part where we are reading the values for the variables.

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.

2 participants