Skip to content

Link to Code Source

We support linking to the source code on GitHub, GitLab, and any other VCS provider that uses the same URL format.

Link to GitHub

Usage

Here's an example:

import logfire

logfire.configure(
    code_source=logfire.CodeSource(
        repository='https://github.com/pydantic/logfire',  
        revision='<hash of commit used on release>',  
        root_path='path/within/repo',  
    )
)

You can learn more in our logfire.CodeSource API reference.

Alternative Configuration

For other OpenTelemetry SDKs, you can configure these settings using resource attributes, e.g. by setting the OTEL_RESOURCE_ATTRIBUTES environment variable:

OTEL_RESOURCE_ATTRIBUTES=vcs.repository.url.full=https://github.com/pydantic/platform
OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},vcs.repository.ref.revision=main
OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},vcs.root.path=path/within/repo