Skip to content

Commit 5289cfc

Browse files
authored
Fix docs about CodeSource.root_path (#1051)
1 parent d73fbd3 commit 5289cfc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

docs/how-to-guides/link-to-code-source.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ logfire.configure(
1313
code_source=logfire.CodeSource(
1414
repository='https://github.com/pydantic/logfire', #(1)!
1515
revision='<hash of commit used on release>', #(2)!
16-
root_path='/root/path', #(3)!
16+
root_path='path/within/repo', #(3)!
1717
)
1818
)
1919
```
2020

2121
1. The URL of the repository e.g. `https://github.com/pydantic/logfire`.
2222
2. The specific branch, tag, or commit hash to link to e.g. `main`.
23-
3. The path to the root of the repository. If your code is in a subdirectory, you can specify it here.
23+
3. The path from the root of the repository to the current working directory of the process. If your code is in a
24+
subdirectory of your repo, you can specify it here. Otherwise you can probably omit this.
2425

2526
You can learn more in our [`logfire.CodeSource`][logfire.CodeSource] API reference.
2627

@@ -32,7 +33,7 @@ For other OpenTelemetry SDKs, you can configure these settings using resource at
3233
```
3334
OTEL_RESOURCE_ATTRIBUTES=vcs.repository.url.full=https://github.com/pydantic/platform
3435
OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},vcs.repository.ref.revision=main
35-
OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},vcs.root.path=.
36+
OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},vcs.root.path=path/within/repo
3637
```
3738

3839
[otel-resource-attributes]: https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#general-sdk-configuration

logfire/_internal/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class CodeSource:
254254
"""The git revision of the code e.g. branch name, commit hash, tag name etc."""
255255

256256
root_path: str = ''
257-
"""The root path for the source code in the repository.
257+
"""The path from the root of the repository to the current working directory of the process.
258258
259259
If you run the code from the directory corresponding to the root of the repository, you can leave this blank.
260260

0 commit comments

Comments
 (0)