Skip to content

Change application telemetry settings with Fleet | Logfire

Change what a running application records and sends: its sampling rate, minimum log level, redaction and scrubbing, and which signals it exports. You change these from Logfire, with no restart or redeploy.

Fleet needs to be turned on for your account: see Fleet. Each application takes its settings from an SDK policy. A policy sets only the settings you choose; every other setting stays as the application configured it (“Application controlled”). See Change policies.

Before you start

  • Your application already sends data to Logfire, with a write token in its environment. Fleet doesn’t change how it sends data: it changes the SDK’s settings.
  • You can load a small Fleet package into the application, as shown below for each language.

Connect an application

  1. In Fleet management, open SDKs and select Add application.

  2. Enter the application’s name, which becomes its OTEL_SERVICE_NAME, and choose what it uses. Select Get setup instructions.

    The Connect an application dialog with an application name and a choice of setup

  3. Install Fleet support and load it, as Logfire shows for your setup:

Requires Python 3.11+ and Logfire 5.1 or a later 5.x release.

Terminal
pip install 'logfire-fleet-otel[logfire]'

Replace your logfire.configure() call. Keep its other options and your instrumentation calls:

import logfire_fleet_otel

logfire_fleet_otel.configure_logfire(
    service_name='checkout-api',  # the application name you entered in Fleet
    console=False,
)

Console output stays off so the policy controls where your telemetry goes.

  1. Save the Fleet connection key Logfire shows in your secret manager: you can’t view it again after closing setup. Set the variables Logfire shows before you start the application: OTEL_OPAMP_ENDPOINT, OTEL_OPAMP_HEADERS with the connection key, and OTEL_SERVICE_NAME. In a terminal, Logfire’s commands prompt for the key without showing it. In production, set the variables in your deployment instead.
  2. Start the application, and select Check connection.

The connection key only manages settings. Your application keeps sending telemetry with its existing write token. Each language has a full guide in pydantic/opamp-clients, including frameworks and deployment examples.

Check the connection

Within a few seconds of starting, the setup shows the application as connected and its policy as applied:

The setup's last step, showing the application connected and its policy applied on one instance

The SDKs tab then lists the application with its connection, health, policy status and SDK policy. One row covers every running instance of the application.

The SDKs tab listing one connected application with its SDK policy applied

Try a policy change

  1. Open the application’s SDK policy from the SDKs tab or Policies.
  2. Set Minimum log level to Warn.
  3. Select Review policy, then publish it.

Within seconds the application stops sending info logs to the Live view, with no restart or deploy. Set it back to Application controlled to undo.

Troubleshooting

SymptomCheck
The application never connectsCheck that the Fleet package loads before your application starts, and that OTEL_OPAMP_ENDPOINT and OTEL_OPAMP_HEADERS are set in the application’s environment. Its logs name connection and authentication errors.
Connected, but Policy status shows FailedOpen the application in SDKs. It reports which setting it couldn’t apply and why.
A setting shows as unsupportedNot every setup supports every setting. Unsupported clients are left out of a rollout’s preview.
No telemetry arrivesFleet doesn’t send telemetry. Check the application’s write token and region settings.

Next steps

  • Change policies: sampling rules, redaction, scrubbing and exports, and how to roll out a change to a few instances first.
  • Scrubbing: what Logfire redacts by default.