Skip to content

Commit

Permalink
move the docs URL (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin authored Sep 19, 2024
1 parent 12a29ac commit 131229f
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 💬 Join Slack
url: 'https://docs.pydantic.dev/logfire/help/#slack'
url: 'https://logfire.pydantic.dev/docs/help/#slack'
about: Join the Logfire Slack to ask questions, get help and chat about Logfire
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

### BREAKING CHANGES

* **System metrics are no longer collected by default** when the correct dependency is installed. Use [`logfire.instrument_system_metrics()`](https://docs.pydantic.dev/logfire/integrations/system_metrics/) to enable system metrics collection. **If you are simply using the old 'Basic System Metrics' dashboard, then no further code changes are required, but that dashboard will no longer work properly and you should create a new dashboard from the template named 'Basic System Metrics (Logfire)'**. If you were using other collected metrics, see the documentation for how to collect those. By @alexmojaki in https://github.com/pydantic/logfire/pull/373
* **System metrics are no longer collected by default** when the correct dependency is installed. Use [`logfire.instrument_system_metrics()`](https://logfire.pydantic.dev/docs/integrations/system_metrics/) to enable system metrics collection. **If you are simply using the old 'Basic System Metrics' dashboard, then no further code changes are required, but that dashboard will no longer work properly and you should create a new dashboard from the template named 'Basic System Metrics (Logfire)'**. If you were using other collected metrics, see the documentation for how to collect those. By @alexmojaki in https://github.com/pydantic/logfire/pull/373
* Stop collecting package versions by @alexmojaki in https://github.com/pydantic/logfire/pull/387
* Don't auto-trace generators by @alexmojaki in https://github.com/pydantic/logfire/pull/386
* Disable ASGI send/receive spans by default by @alexmojaki in https://github.com/pydantic/logfire/pull/371
Expand All @@ -34,7 +34,7 @@

(Previously released as `v0.50.0`, then yanked due to https://github.com/pydantic/logfire/issues/367)

* **BREAKING CHANGES:** Separate sending to Logfire from using standard OTEL environment variables by @alexmojaki in https://github.com/pydantic/logfire/pull/351. See https://docs.pydantic.dev/logfire/guides/advanced/alternative_backends/ for details. Highlights:
* **BREAKING CHANGES:** Separate sending to Logfire from using standard OTEL environment variables by @alexmojaki in https://github.com/pydantic/logfire/pull/351. See https://logfire.pydantic.dev/docs/guides/advanced/alternative_backends/ for details. Highlights:
* `OTEL_EXPORTER_OTLP_ENDPOINT` is no longer just an alternative to `LOGFIRE_BASE_URL`. Setting `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`, and/or `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` will set up appropriate exporters *in addition* to sending to Logfire, which must be turned off separately if desired. These are basic exporters relying on OTEL defaults. In particular they don't use our custom retrying logic.
* `LOGFIRE_BASE_URL` / `logfire.configure(base_url=...)` is now only intended for actual alternative Logfire backends, which are currently only available to Logfire developers, and unlike `OTEL_EXPORTER_OTLP_ENDPOINT` requires authenticating with Logfire.
* Pending spans are only sent to logfire-specific exporters.
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ What sets Logfire apart:
- **OpenTelemetry:** Logfire is an opinionated wrapper around OpenTelemetry, allowing you to leverage existing tooling, infrastructure, and instrumentation for many common Python packages, and enabling support for virtually any language.
- **Pydantic Integration:** Understand the data flowing through your Pydantic models and get built-in analytics on validations.

See the [documentation](https://docs.pydantic.dev/logfire/) for more information.
See the [documentation](https://logfire.pydantic.dev/docs/) for more information.

**Feel free to report issues and ask any questions about Logfire in this repository!**

This repo contains the Python SDK for `logfire` and documentation; the server application for recording and displaying data is closed source.

## Using Logfire

This is a very brief overview of how to use Logfire, the [documentation](https://docs.pydantic.dev/logfire/) has much more detail.
This is a very brief overview of how to use Logfire, the [documentation](https://logfire.pydantic.dev/docs/) has much more detail.

### Install

```bash
pip install logfire
```
[_(learn more)_](https://docs.pydantic.dev/logfire/guides/first_steps/#install)
[_(learn more)_](https://logfire.pydantic.dev/docs/guides/first_steps/#install)

## Authenticate

```bash
logfire auth
```
[_(learn more)_](https://docs.pydantic.dev/logfire/guides/first_steps/#authentication)
[_(learn more)_](https://logfire.pydantic.dev/docs/guides/first_steps/#authentication)

### Manual tracing

Expand All @@ -56,11 +56,11 @@ with logfire.span('Asking the user their {question}', question='age'):
dob = date.fromisoformat(user_input)
logfire.debug('{dob=} {age=!r}', dob=dob, age=date.today() - dob)
```
[_(learn more)_](https://docs.pydantic.dev/logfire/guides/onboarding_checklist/add_manual_tracing/)
[_(learn more)_](https://logfire.pydantic.dev/docs/guides/onboarding_checklist/add_manual_tracing/)

### Integration

Or you can also avoid manual instrumentation and instead integrate with [lots of popular packages](https://docs.pydantic.dev/logfire/integrations/), here's an example of integrating with FastAPI:
Or you can also avoid manual instrumentation and instead integrate with [lots of popular packages](https://logfire.pydantic.dev/docs/integrations/), here's an example of integrating with FastAPI:

```py
import logfire
Expand All @@ -82,11 +82,11 @@ async def add_user(user: User):
# we would store the user here
return {'message': f'{user.name} added'}
```
[_(learn more)_](https://docs.pydantic.dev/logfire/integrations/fastapi/)
[_(learn more)_](https://logfire.pydantic.dev/docs/integrations/fastapi/)

Logfire gives you a view into how your code is running like this:

![Logfire screenshot](https://docs.pydantic.dev/logfire/images/index/logfire-screenshot-fastapi-200.png)
![Logfire screenshot](https://logfire.pydantic.dev/docs/images/index/logfire-screenshot-fastapi-200.png)

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions logfire-api/logfire_api/_internal/config.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def configure(*, send_to_logfire: bool | Literal['if-token-present'] | None = No
fast_shutdown: Whether to shut down exporters and providers quickly, mostly used for tests. Defaults to `False`.
scrubbing: Options for scrubbing sensitive data. Set to `False` to disable.
inspect_arguments: Whether to enable
[f-string magic](https://docs.pydantic.dev/logfire/guides/onboarding_checklist/add_manual_tracing/#f-strings).
[f-string magic](https://logfire.pydantic.dev/docs/guides/onboarding_checklist/add_manual_tracing/#f-strings).
If `None` uses the `LOGFIRE_INSPECT_ARGUMENTS` environment variable.
Defaults to `True` if and only if the Python version is at least 3.11.
sampling: Sampling options. See the [sampling guide](https://docs.pydantic.dev/logfire/guides/advanced/sampling/).
sampling: Sampling options. See the [sampling guide](https://logfire.pydantic.dev/docs/guides/advanced/sampling/).
"""

@dataclasses.dataclass
Expand Down
4 changes: 2 additions & 2 deletions logfire-api/logfire_api/_internal/main.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class Logfire:
!!! note
This function MUST be called before any of the modules to be traced are imported.
Generator functions will not be traced for reasons explained [here](https://docs.pydantic.dev/logfire/guides/advanced/generators/).
Generator functions will not be traced for reasons explained [here](https://logfire.pydantic.dev/docs/guides/advanced/generators/).
This works by inserting a new meta path finder into `sys.meta_path`, so inserting another finder before it
may prevent it from working.
Expand Down Expand Up @@ -652,7 +652,7 @@ class Logfire:
def instrument_system_metrics(self, config: SystemMetricsConfig | None = None, base: SystemMetricsBase = 'basic') -> None:
"""Collect system metrics.
See [the guide](https://docs.pydantic.dev/logfire/integrations/system_metrics/) for more information.
See [the guide](https://logfire.pydantic.dev/docs/integrations/system_metrics/) for more information.
Args:
config: A dictionary where the keys are metric names
Expand Down
2 changes: 1 addition & 1 deletion logfire-api/logfire_api/sampling/_tail_sampling.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class TailSamplingSpanInfo:
class SamplingOptions:
"""Options for [`logfire.configure(sampling=...)`][logfire.configure(sampling)].
See the [sampling guide](https://docs.pydantic.dev/logfire/guides/advanced/sampling/).
See the [sampling guide](https://logfire.pydantic.dev/docs/guides/advanced/sampling/).
"""
head: float | Sampler = ...
tail: Callable[[TailSamplingSpanInfo], float] | None = ...
Expand Down
4 changes: 2 additions & 2 deletions logfire/_internal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from .utils import read_toml_file

BASE_OTEL_INTEGRATION_URL = 'https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/'
BASE_DOCS_URL = 'https://docs.pydantic.dev/logfire'
BASE_DOCS_URL = 'https://logfire.pydantic.dev/docs'
INTEGRATIONS_DOCS_URL = f'{BASE_DOCS_URL}/integrations/'

HOME_LOGFIRE.mkdir(exist_ok=True)
Expand Down Expand Up @@ -413,7 +413,7 @@ def _main(args: list[str] | None = None) -> None:
parser = argparse.ArgumentParser(
prog='logfire',
description='The CLI for Pydantic Logfire.',
epilog='See https://docs.pydantic.dev/logfire/reference/cli/ for more detailed documentation.',
epilog='See https://logfire.pydantic.dev/docs/reference/cli/ for more detailed documentation.',
)

parser.add_argument('--version', action='store_true', help='show the version and exit')
Expand Down
6 changes: 3 additions & 3 deletions logfire/_internal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ def configure( # noqa: D417
fast_shutdown: Whether to shut down exporters and providers quickly, mostly used for tests. Defaults to `False`.
scrubbing: Options for scrubbing sensitive data. Set to `False` to disable.
inspect_arguments: Whether to enable
[f-string magic](https://docs.pydantic.dev/logfire/guides/onboarding_checklist/add_manual_tracing/#f-strings).
[f-string magic](https://logfire.pydantic.dev/docs/guides/onboarding_checklist/add_manual_tracing/#f-strings).
If `None` uses the `LOGFIRE_INSPECT_ARGUMENTS` environment variable.
Defaults to `True` if and only if the Python version is at least 3.11.
sampling: Sampling options. See the [sampling guide](https://docs.pydantic.dev/logfire/guides/advanced/sampling/).
sampling: Sampling options. See the [sampling guide](https://logfire.pydantic.dev/docs/guides/advanced/sampling/).
"""
processors = deprecated_kwargs.pop('processors', None) # type: ignore
if processors is not None: # pragma: no cover
Expand Down Expand Up @@ -984,7 +984,7 @@ def _get_user_token(cls, logfire_api_url: str) -> str:
"""You are not authenticated. Please run `logfire auth` to authenticate.
If you are running in production, you can set the `LOGFIRE_TOKEN` environment variable.
To create a write token, refer to https://docs.pydantic.dev/logfire/guides/advanced/creating_write_tokens/
To create a write token, refer to https://logfire.pydantic.dev/docs/guides/advanced/creating_write_tokens/
"""
)

Expand Down
2 changes: 1 addition & 1 deletion logfire/_internal/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def warn_formatting(msg: str):
f' Ensure you are either:\n'
' (1) passing an f-string directly, with inspect_arguments enabled and working, or\n'
' (2) passing a literal `str.format`-style template, not a preformatted string.\n'
' See https://docs.pydantic.dev/logfire/guides/onboarding_checklist/add_manual_tracing/#messages-and-span-names.\n'
' See https://logfire.pydantic.dev/docs/guides/onboarding_checklist/add_manual_tracing/#messages-and-span-names.\n'
f' The problem was: {msg}',
category=FormattingFailedWarning,
)
4 changes: 2 additions & 2 deletions logfire/_internal/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ def install_auto_tracing(
!!! note
This function MUST be called before any of the modules to be traced are imported.
Generator functions will not be traced for reasons explained [here](https://docs.pydantic.dev/logfire/guides/advanced/generators/).
Generator functions will not be traced for reasons explained [here](https://logfire.pydantic.dev/docs/guides/advanced/generators/).
This works by inserting a new meta path finder into `sys.meta_path`, so inserting another finder before it
may prevent it from working.
Expand Down Expand Up @@ -1269,7 +1269,7 @@ def instrument_system_metrics(
) -> None:
"""Collect system metrics.
See [the guide](https://docs.pydantic.dev/logfire/integrations/system_metrics/) for more information.
See [the guide](https://logfire.pydantic.dev/docs/integrations/system_metrics/) for more information.
Args:
config: A dictionary where the keys are metric names
Expand Down
2 changes: 1 addition & 1 deletion logfire/_internal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def __str__(self) -> str:
f'{request.method} {request.url} —> {self.response.status_code}\n'
f'body: {truncate_string(body, max_length=120)}\n'
'If the error persists, please contact us. '
'(See https://docs.pydantic.dev/logfire/help/ for contact information.)'
'(See https://logfire.pydantic.dev/docs/help/ for contact information.)'
)

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion logfire/sampling/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Types for configuring sampling. See the [sampling guide](https://docs.pydantic.dev/logfire/guides/advanced/sampling/)."""
"""Types for configuring sampling. See the [sampling guide](https://logfire.pydantic.dev/docs/guides/advanced/sampling/)."""

from ._tail_sampling import SamplingOptions, SpanLevel, TailSamplingSpanInfo

Expand Down
2 changes: 1 addition & 1 deletion logfire/sampling/_tail_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def duration(self) -> float:
class SamplingOptions:
"""Options for [`logfire.configure(sampling=...)`][logfire.configure(sampling)].
See the [sampling guide](https://docs.pydantic.dev/logfire/guides/advanced/sampling/).
See the [sampling guide](https://logfire.pydantic.dev/docs/guides/advanced/sampling/).
"""

head: float | Sampler = 1.0
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
site_name: Pydantic Logfire Documentation
site_description: Pydantic Logfire Documentation
strict: true
site_url: https://docs.pydantic.dev/logfire
site_url: https://logfire.pydantic.dev/docs

repo_name: pydantic/logfire
repo_url: https://github.com/pydantic/logfire
Expand Down
2 changes: 1 addition & 1 deletion tests/test_logfire.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_log_methods_without_kwargs(method: str):
Ensure you are either:
(1) passing an f-string directly, with inspect_arguments enabled and working, or
(2) passing a literal `str.format`-style template, not a preformatted string.
See https://docs.pydantic.dev/logfire/guides/onboarding_checklist/add_manual_tracing/#messages-and-span-names.
See https://logfire.pydantic.dev/docs/guides/onboarding_checklist/add_manual_tracing/#messages-and-span-names.
The problem was: The field {foo} is not defined.\
""")

Expand Down

0 comments on commit 131229f

Please sign in to comment.