1. Packages
  2. Packages
  3. Logfire
  4. API Docs
  5. Slo
Viewing docs for Logfire v0.1.14
published on Wednesday, Jul 15, 2026 by Pydantic
logfire logo
Viewing docs for Logfire v0.1.14
published on Wednesday, Jul 15, 2026 by Pydantic

    Manages a Logfire SLO (Service Level Objective).

    Experimental: this resource is backed by a Logfire API that is not yet stable. Its schema and behavior may change in backwards-incompatible ways in future releases. SLOs also require a Logfire plan that includes them.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as logfire from "@pydantic/pulumi-logfire";
    
    const exampleProject = new logfire.Project("exampleProject", {});
    const exampleSlo = new logfire.Slo("exampleSlo", {
        projectId: exampleProject.id,
        scopeValue: "payments-api",
        description: "Successful request ratio for the payments API",
        totalQuery: "parent_span_id IS NULL",
        badQuery: "otel_status_code = 'ERROR'",
        targetPercent: "99.9",
        rollingWindow: "30d",
        environments: ["prod"],
    });
    
    import pulumi
    import pulumi_logfire as logfire
    
    example_project = logfire.Project("exampleProject")
    example_slo = logfire.Slo("exampleSlo",
        project_id=example_project.id,
        scope_value="payments-api",
        description="Successful request ratio for the payments API",
        total_query="parent_span_id IS NULL",
        bad_query="otel_status_code = 'ERROR'",
        target_percent="99.9",
        rolling_window="30d",
        environments=["prod"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pydantic/pulumi-logfire/sdk/go/logfire"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleProject, err := logfire.NewProject(ctx, "exampleProject", nil)
    		if err != nil {
    			return err
    		}
    		_, err = logfire.NewSlo(ctx, "exampleSlo", &logfire.SloArgs{
    			ProjectId:     exampleProject.ID(),
    			ScopeValue:    pulumi.String("payments-api"),
    			Description:   pulumi.String("Successful request ratio for the payments API"),
    			TotalQuery:    pulumi.String("parent_span_id IS NULL"),
    			BadQuery:      pulumi.String("otel_status_code = 'ERROR'"),
    			TargetPercent: pulumi.String("99.9"),
    			RollingWindow: pulumi.String("30d"),
    			Environments: pulumi.StringArray{
    				pulumi.String("prod"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Logfire = Pulumi.Logfire;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleProject = new Logfire.Project("exampleProject");
    
        var exampleSlo = new Logfire.Slo("exampleSlo", new()
        {
            ProjectId = exampleProject.Id,
            ScopeValue = "payments-api",
            Description = "Successful request ratio for the payments API",
            TotalQuery = "parent_span_id IS NULL",
            BadQuery = "otel_status_code = 'ERROR'",
            TargetPercent = "99.9",
            RollingWindow = "30d",
            Environments = new[]
            {
                "prod",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.logfire.Project;
    import com.pulumi.logfire.Slo;
    import com.pulumi.logfire.SloArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleProject = new Project("exampleProject");
    
            var exampleSlo = new Slo("exampleSlo", SloArgs.builder()
                .projectId(exampleProject.id())
                .scopeValue("payments-api")
                .description("Successful request ratio for the payments API")
                .totalQuery("parent_span_id IS NULL")
                .badQuery("otel_status_code = 'ERROR'")
                .targetPercent("99.9")
                .rollingWindow("30d")
                .environments("prod")
                .build());
    
        }
    }
    
    resources:
      exampleProject:
        type: logfire:Project
      exampleSlo:
        type: logfire:Slo
        properties:
          projectId: ${exampleProject.id}
          scopeValue: payments-api
          description: Successful request ratio for the payments API
          totalQuery: parent_span_id IS NULL
          badQuery: otel_status_code = 'ERROR'
          targetPercent: '99.9'
          rollingWindow: 30d
          environments:
            - prod
    
    Example coming soon!
    

    Create Slo Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Slo(name: string, args: SloArgs, opts?: CustomResourceOptions);
    @overload
    def Slo(resource_name: str,
            args: SloArgs,
            opts: Optional[ResourceOptions] = None)
    
    @overload
    def Slo(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            bad_query: Optional[str] = None,
            project_id: Optional[str] = None,
            rolling_window: Optional[str] = None,
            scope_value: Optional[str] = None,
            target_percent: Optional[str] = None,
            total_query: Optional[str] = None,
            description: Optional[str] = None,
            environments: Optional[Sequence[str]] = None,
            metric_aggregation: Optional[str] = None,
            name: Optional[str] = None,
            scope_kind: Optional[str] = None,
            source: Optional[str] = None)
    func NewSlo(ctx *Context, name string, args SloArgs, opts ...ResourceOption) (*Slo, error)
    public Slo(string name, SloArgs args, CustomResourceOptions? opts = null)
    public Slo(String name, SloArgs args)
    public Slo(String name, SloArgs args, CustomResourceOptions options)
    
    type: logfire:Slo
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "logfire_slo" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args SloArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SloArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SloArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SloArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SloArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var sloResource = new Logfire.Slo("sloResource", new()
    {
        BadQuery = "string",
        ProjectId = "string",
        RollingWindow = "string",
        ScopeValue = "string",
        TargetPercent = "string",
        TotalQuery = "string",
        Description = "string",
        Environments = new[]
        {
            "string",
        },
        MetricAggregation = "string",
        Name = "string",
        ScopeKind = "string",
        Source = "string",
    });
    
    example, err := logfire.NewSlo(ctx, "sloResource", &logfire.SloArgs{
    	BadQuery:      pulumi.String("string"),
    	ProjectId:     pulumi.String("string"),
    	RollingWindow: pulumi.String("string"),
    	ScopeValue:    pulumi.String("string"),
    	TargetPercent: pulumi.String("string"),
    	TotalQuery:    pulumi.String("string"),
    	Description:   pulumi.String("string"),
    	Environments: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	MetricAggregation: pulumi.String("string"),
    	Name:              pulumi.String("string"),
    	ScopeKind:         pulumi.String("string"),
    	Source:            pulumi.String("string"),
    })
    
    resource "logfire_slo" "sloResource" {
      bad_query          = "string"
      project_id         = "string"
      rolling_window     = "string"
      scope_value        = "string"
      target_percent     = "string"
      total_query        = "string"
      description        = "string"
      environments       = ["string"]
      metric_aggregation = "string"
      name               = "string"
      scope_kind         = "string"
      source             = "string"
    }
    
    var sloResource = new Slo("sloResource", SloArgs.builder()
        .badQuery("string")
        .projectId("string")
        .rollingWindow("string")
        .scopeValue("string")
        .targetPercent("string")
        .totalQuery("string")
        .description("string")
        .environments("string")
        .metricAggregation("string")
        .name("string")
        .scopeKind("string")
        .source("string")
        .build());
    
    slo_resource = logfire.Slo("sloResource",
        bad_query="string",
        project_id="string",
        rolling_window="string",
        scope_value="string",
        target_percent="string",
        total_query="string",
        description="string",
        environments=["string"],
        metric_aggregation="string",
        name="string",
        scope_kind="string",
        source="string")
    
    const sloResource = new logfire.Slo("sloResource", {
        badQuery: "string",
        projectId: "string",
        rollingWindow: "string",
        scopeValue: "string",
        targetPercent: "string",
        totalQuery: "string",
        description: "string",
        environments: ["string"],
        metricAggregation: "string",
        name: "string",
        scopeKind: "string",
        source: "string",
    });
    
    type: logfire:Slo
    properties:
        badQuery: string
        description: string
        environments:
            - string
        metricAggregation: string
        name: string
        projectId: string
        rollingWindow: string
        scopeKind: string
        scopeValue: string
        source: string
        targetPercent: string
        totalQuery: string
    

    Slo Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Slo resource accepts the following input properties:

    BadQuery string
    SQL boolean expression selecting the bad events counted by the SLO.
    ProjectId string
    Project ID (UUID) used for SLO API paths.
    RollingWindow string
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    ScopeValue string
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    TargetPercent string
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    TotalQuery string
    SQL boolean expression selecting all events counted by the SLO.
    Description string
    SLO description.
    Environments List<string>
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    MetricAggregation string
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    Name string
    SLO name (unique per project).
    ScopeKind string
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    Source string
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    BadQuery string
    SQL boolean expression selecting the bad events counted by the SLO.
    ProjectId string
    Project ID (UUID) used for SLO API paths.
    RollingWindow string
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    ScopeValue string
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    TargetPercent string
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    TotalQuery string
    SQL boolean expression selecting all events counted by the SLO.
    Description string
    SLO description.
    Environments []string
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    MetricAggregation string
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    Name string
    SLO name (unique per project).
    ScopeKind string
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    Source string
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    bad_query string
    SQL boolean expression selecting the bad events counted by the SLO.
    project_id string
    Project ID (UUID) used for SLO API paths.
    rolling_window string
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    scope_value string
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    target_percent string
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    total_query string
    SQL boolean expression selecting all events counted by the SLO.
    description string
    SLO description.
    environments list(string)
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    metric_aggregation string
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    name string
    SLO name (unique per project).
    scope_kind string
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    source string
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    badQuery String
    SQL boolean expression selecting the bad events counted by the SLO.
    projectId String
    Project ID (UUID) used for SLO API paths.
    rollingWindow String
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    scopeValue String
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    targetPercent String
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    totalQuery String
    SQL boolean expression selecting all events counted by the SLO.
    description String
    SLO description.
    environments List<String>
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    metricAggregation String
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    name String
    SLO name (unique per project).
    scopeKind String
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    source String
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    badQuery string
    SQL boolean expression selecting the bad events counted by the SLO.
    projectId string
    Project ID (UUID) used for SLO API paths.
    rollingWindow string
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    scopeValue string
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    targetPercent string
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    totalQuery string
    SQL boolean expression selecting all events counted by the SLO.
    description string
    SLO description.
    environments string[]
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    metricAggregation string
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    name string
    SLO name (unique per project).
    scopeKind string
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    source string
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    bad_query str
    SQL boolean expression selecting the bad events counted by the SLO.
    project_id str
    Project ID (UUID) used for SLO API paths.
    rolling_window str
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    scope_value str
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    target_percent str
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    total_query str
    SQL boolean expression selecting all events counted by the SLO.
    description str
    SLO description.
    environments Sequence[str]
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    metric_aggregation str
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    name str
    SLO name (unique per project).
    scope_kind str
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    source str
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    badQuery String
    SQL boolean expression selecting the bad events counted by the SLO.
    projectId String
    Project ID (UUID) used for SLO API paths.
    rollingWindow String
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    scopeValue String
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    targetPercent String
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    totalQuery String
    SQL boolean expression selecting all events counted by the SLO.
    description String
    SLO description.
    environments List<String>
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    metricAggregation String
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    name String
    SLO name (unique per project).
    scopeKind String
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    source String
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Slo resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Slo Resource

    Get an existing Slo resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: SloState, opts?: CustomResourceOptions): Slo
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bad_query: Optional[str] = None,
            description: Optional[str] = None,
            environments: Optional[Sequence[str]] = None,
            metric_aggregation: Optional[str] = None,
            name: Optional[str] = None,
            project_id: Optional[str] = None,
            rolling_window: Optional[str] = None,
            scope_kind: Optional[str] = None,
            scope_value: Optional[str] = None,
            source: Optional[str] = None,
            target_percent: Optional[str] = None,
            total_query: Optional[str] = None) -> Slo
    func GetSlo(ctx *Context, name string, id IDInput, state *SloState, opts ...ResourceOption) (*Slo, error)
    public static Slo Get(string name, Input<string> id, SloState? state, CustomResourceOptions? opts = null)
    public static Slo get(String name, Output<String> id, SloState state, CustomResourceOptions options)
    resources:  _:    type: logfire:Slo    get:      id: ${id}
    import {
      to = logfire_slo.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    BadQuery string
    SQL boolean expression selecting the bad events counted by the SLO.
    Description string
    SLO description.
    Environments List<string>
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    MetricAggregation string
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    Name string
    SLO name (unique per project).
    ProjectId string
    Project ID (UUID) used for SLO API paths.
    RollingWindow string
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    ScopeKind string
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    ScopeValue string
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    Source string
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    TargetPercent string
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    TotalQuery string
    SQL boolean expression selecting all events counted by the SLO.
    BadQuery string
    SQL boolean expression selecting the bad events counted by the SLO.
    Description string
    SLO description.
    Environments []string
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    MetricAggregation string
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    Name string
    SLO name (unique per project).
    ProjectId string
    Project ID (UUID) used for SLO API paths.
    RollingWindow string
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    ScopeKind string
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    ScopeValue string
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    Source string
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    TargetPercent string
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    TotalQuery string
    SQL boolean expression selecting all events counted by the SLO.
    bad_query string
    SQL boolean expression selecting the bad events counted by the SLO.
    description string
    SLO description.
    environments list(string)
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    metric_aggregation string
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    name string
    SLO name (unique per project).
    project_id string
    Project ID (UUID) used for SLO API paths.
    rolling_window string
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    scope_kind string
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    scope_value string
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    source string
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    target_percent string
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    total_query string
    SQL boolean expression selecting all events counted by the SLO.
    badQuery String
    SQL boolean expression selecting the bad events counted by the SLO.
    description String
    SLO description.
    environments List<String>
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    metricAggregation String
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    name String
    SLO name (unique per project).
    projectId String
    Project ID (UUID) used for SLO API paths.
    rollingWindow String
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    scopeKind String
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    scopeValue String
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    source String
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    targetPercent String
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    totalQuery String
    SQL boolean expression selecting all events counted by the SLO.
    badQuery string
    SQL boolean expression selecting the bad events counted by the SLO.
    description string
    SLO description.
    environments string[]
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    metricAggregation string
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    name string
    SLO name (unique per project).
    projectId string
    Project ID (UUID) used for SLO API paths.
    rollingWindow string
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    scopeKind string
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    scopeValue string
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    source string
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    targetPercent string
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    totalQuery string
    SQL boolean expression selecting all events counted by the SLO.
    bad_query str
    SQL boolean expression selecting the bad events counted by the SLO.
    description str
    SLO description.
    environments Sequence[str]
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    metric_aggregation str
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    name str
    SLO name (unique per project).
    project_id str
    Project ID (UUID) used for SLO API paths.
    rolling_window str
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    scope_kind str
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    scope_value str
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    source str
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    target_percent str
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    total_query str
    SQL boolean expression selecting all events counted by the SLO.
    badQuery String
    SQL boolean expression selecting the bad events counted by the SLO.
    description String
    SLO description.
    environments List<String>
    Deployment environments the SLO is scoped to. Omit to cover all environments.
    metricAggregation String
    How a metrics SLO aggregates its SLI: additive (sum of scalar values, for delta-count metrics), gauge_fraction (fraction of samples meeting the condition, for gauges), or counter_rate (sum of per-series increases, for cumulative counters). Ignored when source = "records". Defaults to additive.
    name String
    SLO name (unique per project).
    projectId String
    Project ID (UUID) used for SLO API paths.
    rollingWindow String
    Rolling evaluation window as a duration string (e.g. "24h", "30d"). Must be between 1h and 90d. The API enforces a lower effective cap: the window cannot exceed your subscription plan's maximum SLO window, nor the project's data retention for the SLO source (records or metrics) — a longer window would compute against missing data. Requests over either cap are rejected with a validation error.
    scopeKind String
    What the SLO is anchored to: a service (service) or an LLM provider (provider). Defaults to service. Changing it forces a new SLO.
    scopeValue String
    The service name (scope_kind = "service") or provider slug like openai (scope_kind = "provider"). Changing it forces a new SLO.
    source String
    Whether the SLO ratio is computed over span events (records) or metric values (metrics). Defaults to records.
    targetPercent String
    Target percentage as a decimal string, exclusively between 0 and 100 (e.g. "99.9").
    totalQuery String
    SQL boolean expression selecting all events counted by the SLO.

    Import

    In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

    terraform

    import {

    to = logfire_slo.example

    id = “example-project/payments-availability”

    }

    The pulumi import command can be used, for example:

    Import by project name and SLO name.

    $ pulumi import logfire:index/slo:Slo example "example-project/payments-availability"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    logfire pydantic/pulumi-logfire
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the logfire Terraform Provider.
    logfire logo
    Viewing docs for Logfire v0.1.14
    published on Wednesday, Jul 15, 2026 by Pydantic

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial