-
Notifications
You must be signed in to change notification settings - Fork 96
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
Cannot incorporate VCS root_path #813
Comments
The root path is used to extract that prefix from the path, not to add as a prefix. Can you try adding the follow env var: OTEL_RESOURCE_ATTRIBUTES="logfire.code.work_dir=/repository_root_path/code_subdirectory/src" |
Hmmm... Hold on... We actually add the |
Can you try to just add a |
Thanks @Kludex for the response here! I did a fair amount of playing around with different permutations, but I wasn't able to get it to work. After inspecting the Raw Data in the Logfire UI, I noticed that Logfire sets the current working directory (as you noted above) as |
Oh, I see. You don't need to set the root path. The root path removes the prefix from the generated link, it doesn't add. |
Okay that makes sense and I understand that now, thank you for that. But my problem persists because even with the root_path omitted, the GitHub link in the Logfire UI after the REF_REVISION seemingly starts from one directory deeper than the CODE_WORK_DIR. So in essence, this test is passing for me and the configuration is working as intended. I can't see how the GitHub link is composed in the frontend though. For me, it's generating Where The valid link is Let me know if that makes sense, I'm not doing a great job explaining... |
I am struggling to get the root_path component of my VCS configuration to work. I've tried configuring via
logfire.CodeSource()
as well as setting theOTEL_RESOURCE_ATTRIBUTES
environment variable (not at the same time).My current configuration is as follows -
The root directory of my code is in a subdirectory mounted in my Docker container at - /repository_root_path/code_subdirectory
And my actual python code runs out of - /repository_root_path/code_subdirectory/src
I've set the variables as the following -
The resulting links generated in Logfire follow this format - https://github.com/my-org/my-repo/blob/main/src/path/to/code
Whereas the valid link is - https://github.com/my-org/my-repo/blob/main/code_subdirectory/src/path/to/code
Upon further review, it seems like changing the
root_path
doesn't impact the links at all so I'm not sure what to do.The text was updated successfully, but these errors were encountered: