1. Registry
  2. Packages
  3. Logfire
  4. API Docs
  5. Slo
Viewing docs for Logfire v0.2.5
published on Tuesday, Nov 3, 2026 by Pydantic
logfire logo Logfire
Viewing docs for Logfire v0.2.5
published on Tuesday, Nov 3, 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 alerts = new logfire.Channel("alerts", {config: [{
        type: "webhook",
        format: "auto",
        url: "https://hooks.example.com/alerts",
    }]});
    // An SLO has three burn-rate alerts: `fast` and `medium` (severity `page`)
    // and `slow` (severity `ticket`). The provider writes each configured tier's
    // channel assignments to its alert and reads them back, so a change made on
    // the Logfire alerts page shows as drift in the next plan. A tier that is not
    // configured keeps its channels.
    const everyone = [{
        channel_id: alerts.id,
    }];
    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"],
        alerts: {
            fast: {
                channelAssignments: everyone,
            },
            medium: {
                channelAssignments: everyone,
            },
            slow: {
                channelAssignments: everyone,
            },
        },
    });
    const config = new pulumi.Config();
    const pagerdutyRoutingKey = config.require("pagerdutyRoutingKey");
    // 2. Different channels per tier.
    const pagerduty = new logfire.Channel("pagerduty", {config: [{
        type: "pagerduty",
        routingKey: pagerdutyRoutingKey,
    }]});
    const incidents = new logfire.Channel("incidents", {config: [{
        type: "webhook",
        format: "auto",
        url: "https://hooks.example.com/incidents",
    }]});
    const reliability = new logfire.Channel("reliability", {config: [{
        type: "webhook",
        format: "auto",
        url: "https://hooks.example.com/reliability",
    }]});
    const checkoutErrors = new logfire.Slo("checkoutErrors", {
        projectId: exampleProject.id,
        scopeValue: "checkout",
        totalQuery: "parent_span_id IS NULL",
        badQuery: "otel_status_code = 'ERROR'",
        targetPercent: "99.9",
        rollingWindow: "30d",
        alerts: {
            fast: {
                channelAssignments: [
                    {
                        channelId: pagerduty.id,
                    },
                    {
                        channelId: incidents.id,
                    },
                ],
            },
            medium: {
                channelAssignments: [{
                    channelId: incidents.id,
                }],
            },
            slow: {
                channelAssignments: [{
                    channelId: reliability.id,
                }],
            },
        },
    });
    // 3. Delivery schedules, shared with a normal alert. PagerDuty gets every
    // fast and medium burn. The incidents channel gets them only during office
    // hours, and the reliability channel gets slow burns during office hours. A
    // normal alert reuses the same configuration, because both resources use the
    // same assignment type.
    const officeHours = new logfire.Schedule("officeHours", {
        label: "Office hours",
        timezone: "Europe/London",
        windows: [{
            days: [
                1,
                2,
                3,
                4,
                5,
            ],
            start_time: "09:00",
            end_time: "18:00",
        }],
    });
    const oncall = [
        {
            channel_id: pagerduty.id,
        },
        {
            channel_id: incidents.id,
            schedule_id: officeHours.id,
        },
    ];
    const checkout = new logfire.Slo("checkout", {
        projectId: exampleProject.id,
        scopeValue: "checkout",
        totalQuery: "parent_span_id IS NULL",
        badQuery: "otel_status_code = 'ERROR'",
        targetPercent: "99.9",
        rollingWindow: "30d",
        alerts: {
            fast: {
                channelAssignments: oncall,
            },
            medium: {
                channelAssignments: oncall,
            },
            slow: {
                channelAssignments: [{
                    channelId: reliability.id,
                    scheduleId: officeHours.id,
                }],
            },
        },
    });
    const paymentErrors = new logfire.Alert("paymentErrors", {
        projectId: exampleProject.id,
        query: "select trace_id from records where span_name = 'payment failed'",
        timeWindow: "5m",
        frequency: "1m",
        notifyWhen: "has_matches",
        channelAssignments: oncall,
    });
    // A histogram-threshold metric SLI: "95% of queue-latency observations under
    // 60s". Uses `threshold` + `comparison` instead of `bad_query`, and requires
    // `source = "metrics"`. It configures no tier, so the provider leaves the
    // channels of its alerts as they are.
    const queueLatency = new logfire.Slo("queueLatency", {
        projectId: exampleProject.id,
        scopeValue: "ingest",
        source: "metrics",
        metricAggregation: "histogram_threshold",
        totalQuery: "metric_name = 'queue.latency'",
        threshold: "60000",
        comparison: "less_than",
        targetPercent: "95",
        rollingWindow: "30d",
    });
    
    import pulumi
    import pulumi_logfire as logfire
    
    example_project = logfire.Project("exampleProject")
    alerts = logfire.Channel("alerts", config=[{
        "type": "webhook",
        "format": "auto",
        "url": "https://hooks.example.com/alerts",
    }])
    # An SLO has three burn-rate alerts: `fast` and `medium` (severity `page`)
    # and `slow` (severity `ticket`). The provider writes each configured tier's
    # channel assignments to its alert and reads them back, so a change made on
    # the Logfire alerts page shows as drift in the next plan. A tier that is not
    # configured keeps its channels.
    everyone = [{
        "channel_id": alerts.id,
    }]
    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"],
        alerts={
            "fast": {
                "channel_assignments": everyone,
            },
            "medium": {
                "channel_assignments": everyone,
            },
            "slow": {
                "channel_assignments": everyone,
            },
        })
    config = pulumi.Config()
    pagerduty_routing_key = config.require("pagerdutyRoutingKey")
    # 2. Different channels per tier.
    pagerduty = logfire.Channel("pagerduty", config=[{
        "type": "pagerduty",
        "routingKey": pagerduty_routing_key,
    }])
    incidents = logfire.Channel("incidents", config=[{
        "type": "webhook",
        "format": "auto",
        "url": "https://hooks.example.com/incidents",
    }])
    reliability = logfire.Channel("reliability", config=[{
        "type": "webhook",
        "format": "auto",
        "url": "https://hooks.example.com/reliability",
    }])
    checkout_errors = logfire.Slo("checkoutErrors",
        project_id=example_project.id,
        scope_value="checkout",
        total_query="parent_span_id IS NULL",
        bad_query="otel_status_code = 'ERROR'",
        target_percent="99.9",
        rolling_window="30d",
        alerts={
            "fast": {
                "channel_assignments": [
                    {
                        "channel_id": pagerduty.id,
                    },
                    {
                        "channel_id": incidents.id,
                    },
                ],
            },
            "medium": {
                "channel_assignments": [{
                    "channel_id": incidents.id,
                }],
            },
            "slow": {
                "channel_assignments": [{
                    "channel_id": reliability.id,
                }],
            },
        })
    # 3. Delivery schedules, shared with a normal alert. PagerDuty gets every
    # fast and medium burn. The incidents channel gets them only during office
    # hours, and the reliability channel gets slow burns during office hours. A
    # normal alert reuses the same configuration, because both resources use the
    # same assignment type.
    office_hours = logfire.Schedule("officeHours",
        label="Office hours",
        timezone="Europe/London",
        windows=[{
            "days": [
                1,
                2,
                3,
                4,
                5,
            ],
            "start_time": "09:00",
            "end_time": "18:00",
        }])
    oncall = [
        {
            "channel_id": pagerduty.id,
        },
        {
            "channel_id": incidents.id,
            "schedule_id": office_hours.id,
        },
    ]
    checkout = logfire.Slo("checkout",
        project_id=example_project.id,
        scope_value="checkout",
        total_query="parent_span_id IS NULL",
        bad_query="otel_status_code = 'ERROR'",
        target_percent="99.9",
        rolling_window="30d",
        alerts={
            "fast": {
                "channel_assignments": oncall,
            },
            "medium": {
                "channel_assignments": oncall,
            },
            "slow": {
                "channel_assignments": [{
                    "channel_id": reliability.id,
                    "schedule_id": office_hours.id,
                }],
            },
        })
    payment_errors = logfire.Alert("paymentErrors",
        project_id=example_project.id,
        query="select trace_id from records where span_name = 'payment failed'",
        time_window="5m",
        frequency="1m",
        notify_when="has_matches",
        channel_assignments=oncall)
    # A histogram-threshold metric SLI: "95% of queue-latency observations under
    # 60s". Uses `threshold` + `comparison` instead of `bad_query`, and requires
    # `source = "metrics"`. It configures no tier, so the provider leaves the
    # channels of its alerts as they are.
    queue_latency = logfire.Slo("queueLatency",
        project_id=example_project.id,
        scope_value="ingest",
        source="metrics",
        metric_aggregation="histogram_threshold",
        total_query="metric_name = 'queue.latency'",
        threshold="60000",
        comparison="less_than",
        target_percent="95",
        rolling_window="30d")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    	"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
    		}
    		alerts, err := logfire.NewChannel(ctx, "alerts", &logfire.ChannelArgs{
    			Config: logfire.ChannelConfigArgs{
    				map[string]interface{}{
    					"type":   "webhook",
    					"format": "auto",
    					"url":    "https://hooks.example.com/alerts",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		everyone := []map[string]interface{}{
    			map[string]interface{}{
    				"channel_id": alerts.ID(),
    			},
    		}
    		_, 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"),
    			},
    			Alerts: &logfire.SloAlertsArgs{
    				Fast: &logfire.SloAlertsFastArgs{
    					ChannelAssignments: toPulumiStringMapArray(everyone),
    				},
    				Medium: &logfire.SloAlertsMediumArgs{
    					ChannelAssignments: toPulumiStringMapArray(everyone),
    				},
    				Slow: &logfire.SloAlertsSlowArgs{
    					ChannelAssignments: toPulumiStringMapArray(everyone),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		cfg := config.New(ctx, "")
    		pagerdutyRoutingKey := cfg.Require("pagerdutyRoutingKey")
    		// 2. Different channels per tier.
    		pagerduty, err := logfire.NewChannel(ctx, "pagerduty", &logfire.ChannelArgs{
    			Config: logfire.ChannelConfigArgs{
    				map[string]interface{}{
    					"type":       "pagerduty",
    					"routingKey": pagerdutyRoutingKey,
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		incidents, err := logfire.NewChannel(ctx, "incidents", &logfire.ChannelArgs{
    			Config: logfire.ChannelConfigArgs{
    				map[string]interface{}{
    					"type":   "webhook",
    					"format": "auto",
    					"url":    "https://hooks.example.com/incidents",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		reliability, err := logfire.NewChannel(ctx, "reliability", &logfire.ChannelArgs{
    			Config: logfire.ChannelConfigArgs{
    				map[string]interface{}{
    					"type":   "webhook",
    					"format": "auto",
    					"url":    "https://hooks.example.com/reliability",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = logfire.NewSlo(ctx, "checkoutErrors", &logfire.SloArgs{
    			ProjectId:     exampleProject.ID(),
    			ScopeValue:    pulumi.String("checkout"),
    			TotalQuery:    pulumi.String("parent_span_id IS NULL"),
    			BadQuery:      pulumi.String("otel_status_code = 'ERROR'"),
    			TargetPercent: pulumi.String("99.9"),
    			RollingWindow: pulumi.String("30d"),
    			Alerts: &logfire.SloAlertsArgs{
    				Fast: &logfire.SloAlertsFastArgs{
    					ChannelAssignments: logfire.SloAlertsFastChannelAssignmentArray{
    						&logfire.SloAlertsFastChannelAssignmentArgs{
    							ChannelId: pagerduty.ID(),
    						},
    						&logfire.SloAlertsFastChannelAssignmentArgs{
    							ChannelId: incidents.ID(),
    						},
    					},
    				},
    				Medium: &logfire.SloAlertsMediumArgs{
    					ChannelAssignments: logfire.SloAlertsMediumChannelAssignmentArray{
    						&logfire.SloAlertsMediumChannelAssignmentArgs{
    							ChannelId: incidents.ID(),
    						},
    					},
    				},
    				Slow: &logfire.SloAlertsSlowArgs{
    					ChannelAssignments: logfire.SloAlertsSlowChannelAssignmentArray{
    						&logfire.SloAlertsSlowChannelAssignmentArgs{
    							ChannelId: reliability.ID(),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// 3. Delivery schedules, shared with a normal alert. PagerDuty gets every
    		// fast and medium burn. The incidents channel gets them only during office
    		// hours, and the reliability channel gets slow burns during office hours. A
    		// normal alert reuses the same configuration, because both resources use the
    		// same assignment type.
    		officeHours, err := logfire.NewSchedule(ctx, "officeHours", &logfire.ScheduleArgs{
    			Label:    pulumi.String("Office hours"),
    			Timezone: pulumi.String("Europe/London"),
    			Windows: logfire.ScheduleWindowArray{
    				&logfire.ScheduleWindowArgs{
    					Days: pulumi.IntArray{
    						pulumi.Int(1),
    						pulumi.Int(2),
    						pulumi.Int(3),
    						pulumi.Int(4),
    						pulumi.Int(5),
    					},
    					Start_time: "09:00",
    					End_time:   "18:00",
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		oncall := []map[string]interface{}{
    			map[string]interface{}{
    				"channel_id": pagerduty.ID(),
    			},
    			map[string]interface{}{
    				"channel_id":  incidents.ID(),
    				"schedule_id": officeHours.ID(),
    			},
    		}
    		_, err = logfire.NewSlo(ctx, "checkout", &logfire.SloArgs{
    			ProjectId:     exampleProject.ID(),
    			ScopeValue:    pulumi.String("checkout"),
    			TotalQuery:    pulumi.String("parent_span_id IS NULL"),
    			BadQuery:      pulumi.String("otel_status_code = 'ERROR'"),
    			TargetPercent: pulumi.String("99.9"),
    			RollingWindow: pulumi.String("30d"),
    			Alerts: &logfire.SloAlertsArgs{
    				Fast: &logfire.SloAlertsFastArgs{
    					ChannelAssignments: toPulumiStringMapArray(oncall),
    				},
    				Medium: &logfire.SloAlertsMediumArgs{
    					ChannelAssignments: toPulumiStringMapArray(oncall),
    				},
    				Slow: &logfire.SloAlertsSlowArgs{
    					ChannelAssignments: logfire.SloAlertsSlowChannelAssignmentArray{
    						&logfire.SloAlertsSlowChannelAssignmentArgs{
    							ChannelId:  reliability.ID(),
    							ScheduleId: officeHours.ID(),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = logfire.NewAlert(ctx, "paymentErrors", &logfire.AlertArgs{
    			ProjectId:          exampleProject.ID(),
    			Query:              pulumi.String("select trace_id from records where span_name = 'payment failed'"),
    			TimeWindow:         pulumi.String("5m"),
    			Frequency:          pulumi.String("1m"),
    			NotifyWhen:         pulumi.String("has_matches"),
    			ChannelAssignments: toPulumiStringMapArray(oncall),
    		})
    		if err != nil {
    			return err
    		}
    		// A histogram-threshold metric SLI: "95% of queue-latency observations under
    		// 60s". Uses `threshold` + `comparison` instead of `bad_query`, and requires
    		// `source = "metrics"`. It configures no tier, so the provider leaves the
    		// channels of its alerts as they are.
    		_, err = logfire.NewSlo(ctx, "queueLatency", &logfire.SloArgs{
    			ProjectId:         exampleProject.ID(),
    			ScopeValue:        pulumi.String("ingest"),
    			Source:            pulumi.String("metrics"),
    			MetricAggregation: pulumi.String("histogram_threshold"),
    			TotalQuery:        pulumi.String("metric_name = 'queue.latency'"),
    			Threshold:         pulumi.String("60000"),
    			Comparison:        pulumi.String("less_than"),
    			TargetPercent:     pulumi.String("95"),
    			RollingWindow:     pulumi.String("30d"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    func toPulumiStringMapArray(arr []StringMap) pulumi.StringMapArray {
    	var pulumiArr pulumi.StringMapArray
    	for _, v := range arr {
    		pulumiArr = append(pulumiArr, pulumi.StringMap(v))
    	}
    	return pulumiArr
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Logfire = Pulumi.Logfire;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleProject = new Logfire.Project("exampleProject");
    
        var alerts = new Logfire.Channel("alerts", new()
        {
            Config = new[]
            {
                
                {
                    { "type", "webhook" },
                    { "format", "auto" },
                    { "url", "https://hooks.example.com/alerts" },
                },
            },
        });
    
        // An SLO has three burn-rate alerts: `fast` and `medium` (severity `page`)
        // and `slow` (severity `ticket`). The provider writes each configured tier's
        // channel assignments to its alert and reads them back, so a change made on
        // the Logfire alerts page shows as drift in the next plan. A tier that is not
        // configured keeps its channels.
        var everyone = new[]
        {
            
            {
                { "channel_id", alerts.Id },
            },
        };
    
        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",
            },
            Alerts = new Logfire.Inputs.SloAlertsArgs
            {
                Fast = new Logfire.Inputs.SloAlertsFastArgs
                {
                    ChannelAssignments = everyone,
                },
                Medium = new Logfire.Inputs.SloAlertsMediumArgs
                {
                    ChannelAssignments = everyone,
                },
                Slow = new Logfire.Inputs.SloAlertsSlowArgs
                {
                    ChannelAssignments = everyone,
                },
            },
        });
    
        var config = new Config();
        var pagerdutyRoutingKey = config.Require("pagerdutyRoutingKey");
        // 2. Different channels per tier.
        var pagerduty = new Logfire.Channel("pagerduty", new()
        {
            Config = new[]
            {
                
                {
                    { "type", "pagerduty" },
                    { "routingKey", pagerdutyRoutingKey },
                },
            },
        });
    
        var incidents = new Logfire.Channel("incidents", new()
        {
            Config = new[]
            {
                
                {
                    { "type", "webhook" },
                    { "format", "auto" },
                    { "url", "https://hooks.example.com/incidents" },
                },
            },
        });
    
        var reliability = new Logfire.Channel("reliability", new()
        {
            Config = new[]
            {
                
                {
                    { "type", "webhook" },
                    { "format", "auto" },
                    { "url", "https://hooks.example.com/reliability" },
                },
            },
        });
    
        var checkoutErrors = new Logfire.Slo("checkoutErrors", new()
        {
            ProjectId = exampleProject.Id,
            ScopeValue = "checkout",
            TotalQuery = "parent_span_id IS NULL",
            BadQuery = "otel_status_code = 'ERROR'",
            TargetPercent = "99.9",
            RollingWindow = "30d",
            Alerts = new Logfire.Inputs.SloAlertsArgs
            {
                Fast = new Logfire.Inputs.SloAlertsFastArgs
                {
                    ChannelAssignments = new[]
                    {
                        new Logfire.Inputs.SloAlertsFastChannelAssignmentArgs
                        {
                            ChannelId = pagerduty.Id,
                        },
                        new Logfire.Inputs.SloAlertsFastChannelAssignmentArgs
                        {
                            ChannelId = incidents.Id,
                        },
                    },
                },
                Medium = new Logfire.Inputs.SloAlertsMediumArgs
                {
                    ChannelAssignments = new[]
                    {
                        new Logfire.Inputs.SloAlertsMediumChannelAssignmentArgs
                        {
                            ChannelId = incidents.Id,
                        },
                    },
                },
                Slow = new Logfire.Inputs.SloAlertsSlowArgs
                {
                    ChannelAssignments = new[]
                    {
                        new Logfire.Inputs.SloAlertsSlowChannelAssignmentArgs
                        {
                            ChannelId = reliability.Id,
                        },
                    },
                },
            },
        });
    
        // 3. Delivery schedules, shared with a normal alert. PagerDuty gets every
        // fast and medium burn. The incidents channel gets them only during office
        // hours, and the reliability channel gets slow burns during office hours. A
        // normal alert reuses the same configuration, because both resources use the
        // same assignment type.
        var officeHours = new Logfire.Schedule("officeHours", new()
        {
            Label = "Office hours",
            Timezone = "Europe/London",
            Windows = new[]
            {
                new Logfire.Inputs.ScheduleWindowArgs
                {
                    Days = new[]
                    {
                        1,
                        2,
                        3,
                        4,
                        5,
                    },
                    Start_time = "09:00",
                    End_time = "18:00",
                },
            },
        });
    
        var oncall = new[]
        {
            
            {
                { "channel_id", pagerduty.Id },
            },
            
            {
                { "channel_id", incidents.Id },
                { "schedule_id", officeHours.Id },
            },
        };
    
        var checkout = new Logfire.Slo("checkout", new()
        {
            ProjectId = exampleProject.Id,
            ScopeValue = "checkout",
            TotalQuery = "parent_span_id IS NULL",
            BadQuery = "otel_status_code = 'ERROR'",
            TargetPercent = "99.9",
            RollingWindow = "30d",
            Alerts = new Logfire.Inputs.SloAlertsArgs
            {
                Fast = new Logfire.Inputs.SloAlertsFastArgs
                {
                    ChannelAssignments = oncall,
                },
                Medium = new Logfire.Inputs.SloAlertsMediumArgs
                {
                    ChannelAssignments = oncall,
                },
                Slow = new Logfire.Inputs.SloAlertsSlowArgs
                {
                    ChannelAssignments = new[]
                    {
                        new Logfire.Inputs.SloAlertsSlowChannelAssignmentArgs
                        {
                            ChannelId = reliability.Id,
                            ScheduleId = officeHours.Id,
                        },
                    },
                },
            },
        });
    
        var paymentErrors = new Logfire.Alert("paymentErrors", new()
        {
            ProjectId = exampleProject.Id,
            Query = "select trace_id from records where span_name = 'payment failed'",
            TimeWindow = "5m",
            Frequency = "1m",
            NotifyWhen = "has_matches",
            ChannelAssignments = oncall,
        });
    
        // A histogram-threshold metric SLI: "95% of queue-latency observations under
        // 60s". Uses `threshold` + `comparison` instead of `bad_query`, and requires
        // `source = "metrics"`. It configures no tier, so the provider leaves the
        // channels of its alerts as they are.
        var queueLatency = new Logfire.Slo("queueLatency", new()
        {
            ProjectId = exampleProject.Id,
            ScopeValue = "ingest",
            Source = "metrics",
            MetricAggregation = "histogram_threshold",
            TotalQuery = "metric_name = 'queue.latency'",
            Threshold = "60000",
            Comparison = "less_than",
            TargetPercent = "95",
            RollingWindow = "30d",
        });
    
    });
    
    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.Channel;
    import com.pulumi.logfire.ChannelArgs;
    import com.pulumi.logfire.Slo;
    import com.pulumi.logfire.SloArgs;
    import com.pulumi.logfire.inputs.SloAlertsArgs;
    import com.pulumi.logfire.inputs.SloAlertsFastArgs;
    import com.pulumi.logfire.inputs.SloAlertsMediumArgs;
    import com.pulumi.logfire.inputs.SloAlertsSlowArgs;
    import com.pulumi.logfire.Schedule;
    import com.pulumi.logfire.ScheduleArgs;
    import com.pulumi.logfire.inputs.ScheduleWindowArgs;
    import com.pulumi.logfire.Alert;
    import com.pulumi.logfire.AlertArgs;
    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) {
            final var config = ctx.config();
            var exampleProject = new Project("exampleProject");
    
            var alerts = new Channel("alerts", ChannelArgs.builder()
                .config(ChannelConfigArgs.builder()
                    .type("webhook")
                    .format("auto")
                    .url("https://hooks.example.com/alerts")
                    .build())
                .build());
    
            // An SLO has three burn-rate alerts: `fast` and `medium` (severity `page`)
            // and `slow` (severity `ticket`). The provider writes each configured tier's
            // channel assignments to its alert and reads them back, so a change made on
            // the Logfire alerts page shows as drift in the next plan. A tier that is not
            // configured keeps its channels.
            final var everyone = ChannelConfigArgs.builder()
                .channel_id(alerts.id())
                .build();
    
            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")
                .alerts(SloAlertsArgs.builder()
                    .fast(SloAlertsFastArgs.builder()
                        .channelAssignments(everyone)
                        .build())
                    .medium(SloAlertsMediumArgs.builder()
                        .channelAssignments(everyone)
                        .build())
                    .slow(SloAlertsSlowArgs.builder()
                        .channelAssignments(everyone)
                        .build())
                    .build())
                .build());
    
            final var pagerdutyRoutingKey = config.get("pagerdutyRoutingKey");
            // 2. Different channels per tier.
            var pagerduty = new Channel("pagerduty", ChannelArgs.builder()
                .config(ChannelConfigArgs.builder()
                    .type("pagerduty")
                    .routingKey(pagerdutyRoutingKey)
                    .build())
                .build());
    
            var incidents = new Channel("incidents", ChannelArgs.builder()
                .config(ChannelConfigArgs.builder()
                    .type("webhook")
                    .format("auto")
                    .url("https://hooks.example.com/incidents")
                    .build())
                .build());
    
            var reliability = new Channel("reliability", ChannelArgs.builder()
                .config(ChannelConfigArgs.builder()
                    .type("webhook")
                    .format("auto")
                    .url("https://hooks.example.com/reliability")
                    .build())
                .build());
    
            var checkoutErrors = new Slo("checkoutErrors", SloArgs.builder()
                .projectId(exampleProject.id())
                .scopeValue("checkout")
                .totalQuery("parent_span_id IS NULL")
                .badQuery("otel_status_code = 'ERROR'")
                .targetPercent("99.9")
                .rollingWindow("30d")
                .alerts(SloAlertsArgs.builder()
                    .fast(SloAlertsFastArgs.builder()
                        .channelAssignments(                    
                            SloAlertsFastChannelAssignmentArgs.builder()
                                .channelId(pagerduty.id())
                                .build(),
                            SloAlertsFastChannelAssignmentArgs.builder()
                                .channelId(incidents.id())
                                .build())
                        .build())
                    .medium(SloAlertsMediumArgs.builder()
                        .channelAssignments(SloAlertsMediumChannelAssignmentArgs.builder()
                            .channelId(incidents.id())
                            .build())
                        .build())
                    .slow(SloAlertsSlowArgs.builder()
                        .channelAssignments(SloAlertsSlowChannelAssignmentArgs.builder()
                            .channelId(reliability.id())
                            .build())
                        .build())
                    .build())
                .build());
    
            // 3. Delivery schedules, shared with a normal alert. PagerDuty gets every
            // fast and medium burn. The incidents channel gets them only during office
            // hours, and the reliability channel gets slow burns during office hours. A
            // normal alert reuses the same configuration, because both resources use the
            // same assignment type.
            var officeHours = new Schedule("officeHours", ScheduleArgs.builder()
                .label("Office hours")
                .timezone("Europe/London")
                .windows(ScheduleWindowArgs.builder()
                    .days(                
                        1,
                        2,
                        3,
                        4,
                        5)
                    .start_time("09:00")
                    .end_time("18:00")
                    .build())
                .build());
    
            final var oncall =         
                ScheduleWindowArgs.builder()
                    .channel_id(pagerduty.id())
                    .build(),
                ScheduleWindowArgs.builder()
                    .channel_id(incidents.id())
                    .schedule_id(officeHours.id())
                    .build();
    
            var checkout = new Slo("checkout", SloArgs.builder()
                .projectId(exampleProject.id())
                .scopeValue("checkout")
                .totalQuery("parent_span_id IS NULL")
                .badQuery("otel_status_code = 'ERROR'")
                .targetPercent("99.9")
                .rollingWindow("30d")
                .alerts(SloAlertsArgs.builder()
                    .fast(SloAlertsFastArgs.builder()
                        .channelAssignments(oncall)
                        .build())
                    .medium(SloAlertsMediumArgs.builder()
                        .channelAssignments(oncall)
                        .build())
                    .slow(SloAlertsSlowArgs.builder()
                        .channelAssignments(SloAlertsSlowChannelAssignmentArgs.builder()
                            .channelId(reliability.id())
                            .scheduleId(officeHours.id())
                            .build())
                        .build())
                    .build())
                .build());
    
            var paymentErrors = new Alert("paymentErrors", AlertArgs.builder()
                .projectId(exampleProject.id())
                .query("select trace_id from records where span_name = 'payment failed'")
                .timeWindow("5m")
                .frequency("1m")
                .notifyWhen("has_matches")
                .channelAssignments(oncall)
                .build());
    
            // A histogram-threshold metric SLI: "95% of queue-latency observations under
            // 60s". Uses `threshold` + `comparison` instead of `bad_query`, and requires
            // `source = "metrics"`. It configures no tier, so the provider leaves the
            // channels of its alerts as they are.
            var queueLatency = new Slo("queueLatency", SloArgs.builder()
                .projectId(exampleProject.id())
                .scopeValue("ingest")
                .source("metrics")
                .metricAggregation("histogram_threshold")
                .totalQuery("metric_name = 'queue.latency'")
                .threshold("60000")
                .comparison("less_than")
                .targetPercent("95")
                .rollingWindow("30d")
                .build());
    
        }
    }
    
    configuration:
      pagerdutyRoutingKey:
        type: string
    resources:
      exampleProject:
        type: logfire:Project
      alerts: # An SLO has three burn-rate alerts: `fast` and `medium` (severity `page`)
      # and `slow` (severity `ticket`). The provider writes each configured tier's
      # channel assignments to its alert and reads them back, so a change made on
      # the Logfire alerts page shows as drift in the next plan. A tier that is not
      # configured keeps its channels.
        type: logfire:Channel
        properties:
          config:
            - type: webhook
              format: auto
              url: https://hooks.example.com/alerts
      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
          alerts:
            fast:
              channelAssignments: ${everyone}
            medium:
              channelAssignments: ${everyone}
            slow:
              channelAssignments: ${everyone}
      # 2. Different channels per tier.
      pagerduty:
        type: logfire:Channel
        properties:
          config:
            - type: pagerduty
              routingKey: ${pagerdutyRoutingKey}
      incidents:
        type: logfire:Channel
        properties:
          config:
            - type: webhook
              format: auto
              url: https://hooks.example.com/incidents
      reliability:
        type: logfire:Channel
        properties:
          config:
            - type: webhook
              format: auto
              url: https://hooks.example.com/reliability
      checkoutErrors:
        type: logfire:Slo
        properties:
          projectId: ${exampleProject.id}
          scopeValue: checkout
          totalQuery: parent_span_id IS NULL
          badQuery: otel_status_code = 'ERROR'
          targetPercent: '99.9'
          rollingWindow: 30d
          alerts:
            fast:
              channelAssignments:
                - channelId: ${pagerduty.id}
                - channelId: ${incidents.id}
            medium:
              channelAssignments:
                - channelId: ${incidents.id}
            slow:
              channelAssignments:
                - channelId: ${reliability.id}
      # 3. Delivery schedules, shared with a normal alert. PagerDuty gets every
      # fast and medium burn. The incidents channel gets them only during office
      # hours, and the reliability channel gets slow burns during office hours. A
      # normal alert reuses the same configuration, because both resources use the
      # same assignment type.
      officeHours:
        type: logfire:Schedule
        properties:
          label: Office hours
          timezone: Europe/London
          windows:
            - days:
                - 1
                - 2
                - 3
                - 4
                - 5
              start_time: 09:00
              end_time: 18:00
      checkout:
        type: logfire:Slo
        properties:
          projectId: ${exampleProject.id}
          scopeValue: checkout
          totalQuery: parent_span_id IS NULL
          badQuery: otel_status_code = 'ERROR'
          targetPercent: '99.9'
          rollingWindow: 30d
          alerts:
            fast:
              channelAssignments: ${oncall}
            medium:
              channelAssignments: ${oncall}
            slow:
              channelAssignments:
                - channelId: ${reliability.id}
                  scheduleId: ${officeHours.id}
      paymentErrors:
        type: logfire:Alert
        properties:
          projectId: ${exampleProject.id}
          query: select trace_id from records where span_name = 'payment failed'
          timeWindow: 5m
          frequency: 1m
          notifyWhen: has_matches
          channelAssignments: ${oncall}
      # A histogram-threshold metric SLI: "95% of queue-latency observations under
      # 60s". Uses `threshold` + `comparison` instead of `bad_query`, and requires
      # `source = "metrics"`. It configures no tier, so the provider leaves the
      # channels of its alerts as they are.
      queueLatency:
        type: logfire:Slo
        properties:
          projectId: ${exampleProject.id}
          scopeValue: ingest
          source: metrics
          metricAggregation: histogram_threshold
          totalQuery: metric_name = 'queue.latency'
          threshold: '60000'
          comparison: less_than
          targetPercent: '95'
          rollingWindow: 30d
    variables:
      everyone:
        - channel_id: ${alerts.id}
      oncall:
        - channel_id: ${pagerduty.id}
        - channel_id: ${incidents.id}
          schedule_id: ${officeHours.id}
    
    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,
            project_id: Optional[str] = None,
            total_query: Optional[str] = None,
            target_percent: Optional[str] = None,
            scope_value: Optional[str] = None,
            rolling_window: Optional[str] = None,
            name: Optional[str] = None,
            alerts: Optional[SloAlertsArgs] = None,
            metric_aggregation: Optional[str] = None,
            environments: Optional[Sequence[str]] = None,
            scope_kind: Optional[str] = None,
            description: Optional[str] = None,
            source: Optional[str] = None,
            comparison: Optional[str] = None,
            threshold: Optional[str] = None,
            bad_query: 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()
    {
        ProjectId = "string",
        TotalQuery = "string",
        TargetPercent = "string",
        ScopeValue = "string",
        RollingWindow = "string",
        Name = "string",
        Alerts = new Logfire.Inputs.SloAlertsArgs
        {
            Fast = new Logfire.Inputs.SloAlertsFastArgs
            {
                AlertId = "string",
                ChannelAssignments = new[]
                {
                    new Logfire.Inputs.SloAlertsFastChannelAssignmentArgs
                    {
                        ChannelId = "string",
                        ScheduleId = "string",
                    },
                },
                Severity = "string",
                Viable = false,
            },
            Medium = new Logfire.Inputs.SloAlertsMediumArgs
            {
                AlertId = "string",
                ChannelAssignments = new[]
                {
                    new Logfire.Inputs.SloAlertsMediumChannelAssignmentArgs
                    {
                        ChannelId = "string",
                        ScheduleId = "string",
                    },
                },
                Severity = "string",
                Viable = false,
            },
            Slow = new Logfire.Inputs.SloAlertsSlowArgs
            {
                AlertId = "string",
                ChannelAssignments = new[]
                {
                    new Logfire.Inputs.SloAlertsSlowChannelAssignmentArgs
                    {
                        ChannelId = "string",
                        ScheduleId = "string",
                    },
                },
                Severity = "string",
                Viable = false,
            },
        },
        MetricAggregation = "string",
        Environments = new[]
        {
            "string",
        },
        ScopeKind = "string",
        Description = "string",
        Source = "string",
        Comparison = "string",
        Threshold = "string",
        BadQuery = "string",
    });
    
    example, err := logfire.NewSlo(ctx, "sloResource", &logfire.SloArgs{
    	ProjectId:     pulumi.String("string"),
    	TotalQuery:    pulumi.String("string"),
    	TargetPercent: pulumi.String("string"),
    	ScopeValue:    pulumi.String("string"),
    	RollingWindow: pulumi.String("string"),
    	Name:          pulumi.String("string"),
    	Alerts: &logfire.SloAlertsArgs{
    		Fast: &logfire.SloAlertsFastArgs{
    			AlertId: pulumi.String("string"),
    			ChannelAssignments: logfire.SloAlertsFastChannelAssignmentArray{
    				&logfire.SloAlertsFastChannelAssignmentArgs{
    					ChannelId:  pulumi.String("string"),
    					ScheduleId: pulumi.String("string"),
    				},
    			},
    			Severity: pulumi.String("string"),
    			Viable:   pulumi.Bool(false),
    		},
    		Medium: &logfire.SloAlertsMediumArgs{
    			AlertId: pulumi.String("string"),
    			ChannelAssignments: logfire.SloAlertsMediumChannelAssignmentArray{
    				&logfire.SloAlertsMediumChannelAssignmentArgs{
    					ChannelId:  pulumi.String("string"),
    					ScheduleId: pulumi.String("string"),
    				},
    			},
    			Severity: pulumi.String("string"),
    			Viable:   pulumi.Bool(false),
    		},
    		Slow: &logfire.SloAlertsSlowArgs{
    			AlertId: pulumi.String("string"),
    			ChannelAssignments: logfire.SloAlertsSlowChannelAssignmentArray{
    				&logfire.SloAlertsSlowChannelAssignmentArgs{
    					ChannelId:  pulumi.String("string"),
    					ScheduleId: pulumi.String("string"),
    				},
    			},
    			Severity: pulumi.String("string"),
    			Viable:   pulumi.Bool(false),
    		},
    	},
    	MetricAggregation: pulumi.String("string"),
    	Environments: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ScopeKind:   pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Source:      pulumi.String("string"),
    	Comparison:  pulumi.String("string"),
    	Threshold:   pulumi.String("string"),
    	BadQuery:    pulumi.String("string"),
    })
    
    resource "logfire_slo" "sloResource" {
      lifecycle {
        create_before_destroy = true
      }
      project_id     = "string"
      total_query    = "string"
      target_percent = "string"
      scope_value    = "string"
      rolling_window = "string"
      name           = "string"
      alerts = {
        fast = {
          alert_id = "string"
          channel_assignments = [{
            channel_id  = "string"
            schedule_id = "string"
          }]
          severity = "string"
          viable   = false
        }
        medium = {
          alert_id = "string"
          channel_assignments = [{
            channel_id  = "string"
            schedule_id = "string"
          }]
          severity = "string"
          viable   = false
        }
        slow = {
          alert_id = "string"
          channel_assignments = [{
            channel_id  = "string"
            schedule_id = "string"
          }]
          severity = "string"
          viable   = false
        }
      }
      metric_aggregation = "string"
      environments       = ["string"]
      scope_kind         = "string"
      description        = "string"
      source             = "string"
      comparison         = "string"
      threshold          = "string"
      bad_query          = "string"
    }
    
    var sloResource = new Slo("sloResource", SloArgs.builder()
        .projectId("string")
        .totalQuery("string")
        .targetPercent("string")
        .scopeValue("string")
        .rollingWindow("string")
        .name("string")
        .alerts(SloAlertsArgs.builder()
            .fast(SloAlertsFastArgs.builder()
                .alertId("string")
                .channelAssignments(SloAlertsFastChannelAssignmentArgs.builder()
                    .channelId("string")
                    .scheduleId("string")
                    .build())
                .severity("string")
                .viable(false)
                .build())
            .medium(SloAlertsMediumArgs.builder()
                .alertId("string")
                .channelAssignments(SloAlertsMediumChannelAssignmentArgs.builder()
                    .channelId("string")
                    .scheduleId("string")
                    .build())
                .severity("string")
                .viable(false)
                .build())
            .slow(SloAlertsSlowArgs.builder()
                .alertId("string")
                .channelAssignments(SloAlertsSlowChannelAssignmentArgs.builder()
                    .channelId("string")
                    .scheduleId("string")
                    .build())
                .severity("string")
                .viable(false)
                .build())
            .build())
        .metricAggregation("string")
        .environments("string")
        .scopeKind("string")
        .description("string")
        .source("string")
        .comparison("string")
        .threshold("string")
        .badQuery("string")
        .build());
    
    slo_resource = logfire.Slo("sloResource",
        project_id="string",
        total_query="string",
        target_percent="string",
        scope_value="string",
        rolling_window="string",
        name="string",
        alerts={
            "fast": {
                "alert_id": "string",
                "channel_assignments": [{
                    "channel_id": "string",
                    "schedule_id": "string",
                }],
                "severity": "string",
                "viable": False,
            },
            "medium": {
                "alert_id": "string",
                "channel_assignments": [{
                    "channel_id": "string",
                    "schedule_id": "string",
                }],
                "severity": "string",
                "viable": False,
            },
            "slow": {
                "alert_id": "string",
                "channel_assignments": [{
                    "channel_id": "string",
                    "schedule_id": "string",
                }],
                "severity": "string",
                "viable": False,
            },
        },
        metric_aggregation="string",
        environments=["string"],
        scope_kind="string",
        description="string",
        source="string",
        comparison="string",
        threshold="string",
        bad_query="string")
    
    const sloResource = new logfire.Slo("sloResource", {
        projectId: "string",
        totalQuery: "string",
        targetPercent: "string",
        scopeValue: "string",
        rollingWindow: "string",
        name: "string",
        alerts: {
            fast: {
                alertId: "string",
                channelAssignments: [{
                    channelId: "string",
                    scheduleId: "string",
                }],
                severity: "string",
                viable: false,
            },
            medium: {
                alertId: "string",
                channelAssignments: [{
                    channelId: "string",
                    scheduleId: "string",
                }],
                severity: "string",
                viable: false,
            },
            slow: {
                alertId: "string",
                channelAssignments: [{
                    channelId: "string",
                    scheduleId: "string",
                }],
                severity: "string",
                viable: false,
            },
        },
        metricAggregation: "string",
        environments: ["string"],
        scopeKind: "string",
        description: "string",
        source: "string",
        comparison: "string",
        threshold: "string",
        badQuery: "string",
    });
    
    type: logfire:Slo
    properties:
        alerts:
            fast:
                alertId: string
                channelAssignments:
                    - channelId: string
                      scheduleId: string
                severity: string
                viable: false
            medium:
                alertId: string
                channelAssignments:
                    - channelId: string
                      scheduleId: string
                severity: string
                viable: false
            slow:
                alertId: string
                channelAssignments:
                    - channelId: string
                      scheduleId: string
                severity: string
                viable: false
        badQuery: string
        comparison: string
        description: string
        environments:
            - string
        metricAggregation: string
        name: string
        projectId: string
        rollingWindow: string
        scopeKind: string
        scopeValue: string
        source: string
        targetPercent: string
        threshold: 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:

    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.
    Alerts SloAlerts
    BadQuery string
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    Comparison string
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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.
    Threshold string
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    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.
    Alerts SloAlertsArgs
    BadQuery string
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    Comparison string
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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.
    Threshold string
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    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.
    alerts object
    bad_query string
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    comparison string
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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.
    threshold string
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    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.
    alerts SloAlerts
    badQuery String
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    comparison String
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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.
    threshold String
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    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.
    alerts SloAlerts
    badQuery string
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    comparison string
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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.
    threshold string
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    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.
    alerts SloAlertsArgs
    bad_query str
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    comparison str
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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.
    threshold str
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    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.
    alerts Property Map
    badQuery String
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    comparison String
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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.
    threshold String
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.

    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,
            alerts: Optional[SloAlertsArgs] = None,
            bad_query: Optional[str] = None,
            comparison: 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,
            threshold: 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:
    Alerts SloAlerts
    BadQuery string
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    Comparison string
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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").
    Threshold string
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    TotalQuery string
    SQL boolean expression selecting all events counted by the SLO.
    Alerts SloAlertsArgs
    BadQuery string
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    Comparison string
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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").
    Threshold string
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    TotalQuery string
    SQL boolean expression selecting all events counted by the SLO.
    alerts object
    bad_query string
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    comparison string
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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").
    threshold string
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    total_query string
    SQL boolean expression selecting all events counted by the SLO.
    alerts SloAlerts
    badQuery String
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    comparison String
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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").
    threshold String
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    totalQuery String
    SQL boolean expression selecting all events counted by the SLO.
    alerts SloAlerts
    badQuery string
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    comparison string
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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").
    threshold string
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    totalQuery string
    SQL boolean expression selecting all events counted by the SLO.
    alerts SloAlertsArgs
    bad_query str
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    comparison str
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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").
    threshold str
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    total_query str
    SQL boolean expression selecting all events counted by the SLO.
    alerts Property Map
    badQuery String
    SQL boolean expression selecting the bad events counted by the SLO. Required for every mode except metric_aggregation = "histogram_threshold", which uses threshold and comparison instead.
    comparison String
    For metric_aggregation = "histogram_threshold": the good side of the threshold. less_than (good is below the threshold, the latency case) or greater_than. Required for that mode, and must be omitted otherwise.
    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), counter_rate (sum of per-series increases, for cumulative counters), or histogram_threshold (fraction of histogram observations past a threshold; uses threshold and comparison instead of bad_query, and requires source = "metrics"). 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").
    threshold String
    For metric_aggregation = "histogram_threshold": the cutoff in the metric's native unit, as a decimal string (e.g. "60000" on a _ms latency metric). Required for that mode, and must be omitted otherwise.
    totalQuery String
    SQL boolean expression selecting all events counted by the SLO.

    Supporting Types

    SloAlerts, SloAlertsArgs

    Fast SloAlertsFast
    The fast burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    Medium SloAlertsMedium
    The medium burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    Slow SloAlertsSlow
    The slow burn-rate tier's alert (severity ticket). Omit it to leave that alert's channels as they are.
    Fast SloAlertsFast
    The fast burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    Medium SloAlertsMedium
    The medium burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    Slow SloAlertsSlow
    The slow burn-rate tier's alert (severity ticket). Omit it to leave that alert's channels as they are.
    fast object
    The fast burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    medium object
    The medium burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    slow object
    The slow burn-rate tier's alert (severity ticket). Omit it to leave that alert's channels as they are.
    fast SloAlertsFast
    The fast burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    medium SloAlertsMedium
    The medium burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    slow SloAlertsSlow
    The slow burn-rate tier's alert (severity ticket). Omit it to leave that alert's channels as they are.
    fast SloAlertsFast
    The fast burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    medium SloAlertsMedium
    The medium burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    slow SloAlertsSlow
    The slow burn-rate tier's alert (severity ticket). Omit it to leave that alert's channels as they are.
    fast SloAlertsFast
    The fast burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    medium SloAlertsMedium
    The medium burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    slow SloAlertsSlow
    The slow burn-rate tier's alert (severity ticket). Omit it to leave that alert's channels as they are.
    fast Property Map
    The fast burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    medium Property Map
    The medium burn-rate tier's alert (severity page). Omit it to leave that alert's channels as they are.
    slow Property Map
    The slow burn-rate tier's alert (severity ticket). Omit it to leave that alert's channels as they are.

    SloAlertsFast, SloAlertsFastArgs

    AlertId string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    ChannelAssignments List<SloAlertsFastChannelAssignment>
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    Severity string
    page for the fast and medium tiers, ticket for the slow tier.
    Viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    AlertId string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    ChannelAssignments []SloAlertsFastChannelAssignment
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    Severity string
    page for the fast and medium tiers, ticket for the slow tier.
    Viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alert_id string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channel_assignments list(object)
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity string
    page for the fast and medium tiers, ticket for the slow tier.
    viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alertId String
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channelAssignments List<SloAlertsFastChannelAssignment>
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity String
    page for the fast and medium tiers, ticket for the slow tier.
    viable Boolean
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alertId string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channelAssignments SloAlertsFastChannelAssignment[]
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity string
    page for the fast and medium tiers, ticket for the slow tier.
    viable boolean
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alert_id str
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channel_assignments Sequence[SloAlertsFastChannelAssignment]
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity str
    page for the fast and medium tiers, ticket for the slow tier.
    viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alertId String
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channelAssignments List<Property Map>
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity String
    page for the fast and medium tiers, ticket for the slow tier.
    viable Boolean
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.

    SloAlertsFastChannelAssignment, SloAlertsFastChannelAssignmentArgs

    ChannelId string
    ID of the logfire.Channel to notify.
    ScheduleId string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    ChannelId string
    ID of the logfire.Channel to notify.
    ScheduleId string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channel_id string
    ID of the logfire.Channel to notify.
    schedule_id string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channelId String
    ID of the logfire.Channel to notify.
    scheduleId String
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channelId string
    ID of the logfire.Channel to notify.
    scheduleId string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channel_id str
    ID of the logfire.Channel to notify.
    schedule_id str
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channelId String
    ID of the logfire.Channel to notify.
    scheduleId String
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.

    SloAlertsMedium, SloAlertsMediumArgs

    AlertId string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    ChannelAssignments List<SloAlertsMediumChannelAssignment>
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    Severity string
    page for the fast and medium tiers, ticket for the slow tier.
    Viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    AlertId string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    ChannelAssignments []SloAlertsMediumChannelAssignment
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    Severity string
    page for the fast and medium tiers, ticket for the slow tier.
    Viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alert_id string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channel_assignments list(object)
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity string
    page for the fast and medium tiers, ticket for the slow tier.
    viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alertId String
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channelAssignments List<SloAlertsMediumChannelAssignment>
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity String
    page for the fast and medium tiers, ticket for the slow tier.
    viable Boolean
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alertId string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channelAssignments SloAlertsMediumChannelAssignment[]
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity string
    page for the fast and medium tiers, ticket for the slow tier.
    viable boolean
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alert_id str
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channel_assignments Sequence[SloAlertsMediumChannelAssignment]
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity str
    page for the fast and medium tiers, ticket for the slow tier.
    viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alertId String
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channelAssignments List<Property Map>
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity String
    page for the fast and medium tiers, ticket for the slow tier.
    viable Boolean
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.

    SloAlertsMediumChannelAssignment, SloAlertsMediumChannelAssignmentArgs

    ChannelId string
    ID of the logfire.Channel to notify.
    ScheduleId string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    ChannelId string
    ID of the logfire.Channel to notify.
    ScheduleId string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channel_id string
    ID of the logfire.Channel to notify.
    schedule_id string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channelId String
    ID of the logfire.Channel to notify.
    scheduleId String
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channelId string
    ID of the logfire.Channel to notify.
    scheduleId string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channel_id str
    ID of the logfire.Channel to notify.
    schedule_id str
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channelId String
    ID of the logfire.Channel to notify.
    scheduleId String
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.

    SloAlertsSlow, SloAlertsSlowArgs

    AlertId string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    ChannelAssignments List<SloAlertsSlowChannelAssignment>
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    Severity string
    page for the fast and medium tiers, ticket for the slow tier.
    Viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    AlertId string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    ChannelAssignments []SloAlertsSlowChannelAssignment
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    Severity string
    page for the fast and medium tiers, ticket for the slow tier.
    Viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alert_id string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channel_assignments list(object)
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity string
    page for the fast and medium tiers, ticket for the slow tier.
    viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alertId String
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channelAssignments List<SloAlertsSlowChannelAssignment>
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity String
    page for the fast and medium tiers, ticket for the slow tier.
    viable Boolean
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alertId string
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channelAssignments SloAlertsSlowChannelAssignment[]
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity string
    page for the fast and medium tiers, ticket for the slow tier.
    viable boolean
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alert_id str
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channel_assignments Sequence[SloAlertsSlowChannelAssignment]
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity str
    page for the fast and medium tiers, ticket for the slow tier.
    viable bool
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.
    alertId String
    ID of the tier's alert. Null only for an SLO created before Logfire kept all three tier alerts, when the tier could not fire at the SLO's target. The provider then plans an update of the SLO, even when no attribute changed, and that update creates the missing alert.
    channelAssignments List<Property Map>
    Channels of this tier's alert, each with an optional delivery schedule. The provider writes the value to the alert on create, and on update when it differs from what the alert has. It is read back from the alert, so a change made on the Logfire alerts page shows as drift. Set it to [] to remove every channel. It is the same type as logfire_alert.channel_assignments.
    severity String
    page for the fast and medium tiers, ticket for the slow tier.
    viable Boolean
    False when the tier cannot fire at the SLO's target_percent. The alert keeps its channels but is not evaluated until a target change makes the tier viable.

    SloAlertsSlowChannelAssignment, SloAlertsSlowChannelAssignmentArgs

    ChannelId string
    ID of the logfire.Channel to notify.
    ScheduleId string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    ChannelId string
    ID of the logfire.Channel to notify.
    ScheduleId string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channel_id string
    ID of the logfire.Channel to notify.
    schedule_id string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channelId String
    ID of the logfire.Channel to notify.
    scheduleId String
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channelId string
    ID of the logfire.Channel to notify.
    scheduleId string
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channel_id str
    ID of the logfire.Channel to notify.
    schedule_id str
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.
    channelId String
    ID of the logfire.Channel to notify.
    scheduleId String
    ID of a logfire.Schedule. The channel is notified only inside the schedule's windows. Omit it to notify the channel at all times.

    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 Logfire
    Viewing docs for Logfire v0.2.5
    published on Tuesday, Nov 3, 2026 by Pydantic

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial