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

fix: enable tracing upon import / improve logging setup #7859

Merged
merged 3 commits into from
Jun 18, 2024
Merged

Conversation

wochinge
Copy link
Contributor

Related Issues

  • fixes #issue-number

Proposed Changes:

  • fix: fix auto-tracing (this should work out of the box but so far didn't, see docs)
  • feat: add context var logging to structlog
  • docs: add release notes

How did you test it?

Notes for the reviewer

Checklist

@wochinge wochinge requested review from a team as code owners June 14, 2024 08:10
@wochinge wochinge requested review from dfokina, vblagoje and masci and removed request for a team June 14, 2024 08:10
@github-actions github-actions bot added topic:tests type:documentation Improvements on the docs labels Jun 14, 2024
@@ -330,6 +331,7 @@ def configure_logging(use_json: Optional[bool] = None) -> None:
structlog.stdlib.add_log_level,
# Adds the current timestamp in ISO format to logs
structlog.processors.TimeStamper(fmt="iso"),
structlog.contextvars.merge_contextvars,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

simple additions and improve the usability of the default configuration

@coveralls
Copy link
Collaborator

coveralls commented Jun 14, 2024

Pull Request Test Coverage Report for Build 9512845635

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 89.657%

Files with Coverage Reduction New Missed Lines %
logging.py 2 93.22%
Totals Coverage Status
Change from base Build 9511870582: 0.02%
Covered Lines: 6900
Relevant Lines: 7696

💛 - Coveralls

@@ -13,6 +14,9 @@
# This is a no-op unless `structlog` is installed
haystack.logging.configure_logging()

# Same for tracing (no op if `opentelemetry` or `ddtrace` is not installed)
haystack.tracing.auto_enable_tracing()
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@wochinge
Copy link
Contributor Author

@masci @vblagoje Can I merge this? Marie approved but I don't want to merge without Core team approval

Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

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

LGTM!

@masci masci merged commit 96cda5d into main Jun 18, 2024
23 checks passed
@masci masci deleted the fix/auto-tracing branch June 18, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants