-
Notifications
You must be signed in to change notification settings - Fork 141
Add logfire.work_dir
resource attribute
#532
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
Conversation
Deploying logfire-docs with
|
Latest commit: |
630b057
|
Status: | ✅ Deploy successful! |
Preview URL: | https://dd5f4b9c.logfire-docs.pages.dev |
Branch Preview URL: | https://add-logfire-work-dir.logfire-docs.pages.dev |
Can we dogfood with the resource attribute first? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #532 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 133 133
Lines 10206 10214 +8
Branches 1395 1396 +1
=========================================
+ Hits 10206 10214 +8 ☔ View full report in Codecov by Sentry. |
logfire/_internal/config.py
Outdated
Example: | ||
If the `code.filename` is `/path/to/project/src/logfire/main.py` and the `root_path` is `src/`, the URL | ||
for the source code will be `src/path/to/project/src/logfire/main.py`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still needs updating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logfire/_internal/config.py
Outdated
"""The root path for the source code in the repository. | ||
|
||
Example: | ||
If the `code.filename` is `/path/to/project/src/logfire/main.py` and the `root_path` is `src/`, the URL | ||
for the source code will be `src/path/to/project/src/logfire/main.py`. | ||
""" | ||
|
||
work_dir: str = field(default='.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this setting at all? Isn't it just os.getcwd()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see what you mean...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True.
349d4b5
to
cf67272
Compare
CodeSource.work_dir
logfire.work_dir
resource attribute
Co-authored-by: Alex Hall <[email protected]>
Co-authored-by: Alex Hall <[email protected]>
logfire/_internal/config.py
Outdated
@@ -672,6 +679,7 @@ def _initialize(self) -> None: | |||
if self.code_source: | |||
otel_resource_attributes.update( | |||
{ | |||
RESOURCE_ATTRIBUTES_CODE_WORK_DIR: os.getcwd(), | |||
RESOURCE_ATTRIBUTES_CODE_ROOT_PATH: self.code_source.root_path, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you leave it out here if it's empty?
Should I add the "exclude" already here?