Skip to content

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

Merged
merged 13 commits into from
Oct 30, 2024
Merged

Conversation

Kludex
Copy link
Member

@Kludex Kludex commented Oct 22, 2024

Should I add the "exclude" already here?

Copy link

cloudflare-workers-and-pages bot commented Oct 22, 2024

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

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

View logs

@alexmojaki
Copy link
Contributor

Can we dogfood with the resource attribute first?

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e954e2a) to head (630b057).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Comment on lines 214 to 216
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`.
Copy link
Contributor

Choose a reason for hiding this comment

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

still needs updating

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Copy link
Member Author

Choose a reason for hiding this comment

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

Screenshot 2024-10-29 at 14 57 50

"""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='.')
Copy link
Contributor

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()?

Copy link
Member Author

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...

Copy link
Member Author

Choose a reason for hiding this comment

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

True.

@Kludex Kludex force-pushed the add-logfire-work-dir branch from 349d4b5 to cf67272 Compare October 29, 2024 13:46
@Kludex Kludex changed the title Add CodeSource.work_dir Add logfire.work_dir resource attribute Oct 29, 2024
@Kludex Kludex requested a review from alexmojaki October 29, 2024 13:48
@@ -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,
Copy link
Contributor

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?

@alexmojaki alexmojaki enabled auto-merge (squash) October 30, 2024 13:23
@alexmojaki alexmojaki merged commit 5480347 into main Oct 30, 2024
17 checks passed
@alexmojaki alexmojaki deleted the add-logfire-work-dir branch October 30, 2024 13:26
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