1. Packages
  2. Grafana Cloud
  3. API Docs
  4. assert
  5. Thresholds
Grafana v2.14.1 published on Thursday, Nov 6, 2025 by pulumiverse

grafana.assert.Thresholds

Start a Neo task
Explain and create a grafana.assert.Thresholds resource
grafana logo
Grafana v2.14.1 published on Thursday, Nov 6, 2025 by pulumiverse

    Manages Knowledge Graph Thresholds configuration (request, resource, health) via bulk endpoints.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    
    const basic = new grafana.assert.Thresholds("basic", {
        requestThresholds: [{
            entityName: "payment-service",
            assertionName: "ErrorRatioBreach",
            requestType: "inbound",
            requestContext: "/charge",
            value: 0.01,
        }],
        resourceThresholds: [{
            assertionName: "Saturation",
            resourceType: "container",
            containerName: "worker",
            source: "metrics",
            severity: "warning",
            value: 75,
        }],
        healthThresholds: [{
            assertionName: "ServiceDown",
            expression: "up < 1",
            entityType: "Service",
        }],
    });
    
    import pulumi
    import pulumiverse_grafana as grafana
    
    basic = grafana.assert_.Thresholds("basic",
        request_thresholds=[{
            "entity_name": "payment-service",
            "assertion_name": "ErrorRatioBreach",
            "request_type": "inbound",
            "request_context": "/charge",
            "value": 0.01,
        }],
        resource_thresholds=[{
            "assertion_name": "Saturation",
            "resource_type": "container",
            "container_name": "worker",
            "source": "metrics",
            "severity": "warning",
            "value": 75,
        }],
        health_thresholds=[{
            "assertion_name": "ServiceDown",
            "expression": "up < 1",
            "entity_type": "Service",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-grafana/sdk/v2/go/grafana/assert"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := assert.NewThresholds(ctx, "basic", &assert.ThresholdsArgs{
    			RequestThresholds: assert.ThresholdsRequestThresholdArray{
    				&assert.ThresholdsRequestThresholdArgs{
    					EntityName:     pulumi.String("payment-service"),
    					AssertionName:  pulumi.String("ErrorRatioBreach"),
    					RequestType:    pulumi.String("inbound"),
    					RequestContext: pulumi.String("/charge"),
    					Value:          pulumi.Float64(0.01),
    				},
    			},
    			ResourceThresholds: assert.ThresholdsResourceThresholdArray{
    				&assert.ThresholdsResourceThresholdArgs{
    					AssertionName: pulumi.String("Saturation"),
    					ResourceType:  pulumi.String("container"),
    					ContainerName: pulumi.String("worker"),
    					Source:        pulumi.String("metrics"),
    					Severity:      pulumi.String("warning"),
    					Value:         pulumi.Float64(75),
    				},
    			},
    			HealthThresholds: assert.ThresholdsHealthThresholdArray{
    				&assert.ThresholdsHealthThresholdArgs{
    					AssertionName: pulumi.String("ServiceDown"),
    					Expression:    pulumi.String("up < 1"),
    					EntityType:    pulumi.String("Service"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Grafana = Pulumiverse.Grafana;
    
    return await Deployment.RunAsync(() => 
    {
        var basic = new Grafana.Assert.Thresholds("basic", new()
        {
            RequestThresholds = new[]
            {
                new Grafana.Assert.Inputs.ThresholdsRequestThresholdArgs
                {
                    EntityName = "payment-service",
                    AssertionName = "ErrorRatioBreach",
                    RequestType = "inbound",
                    RequestContext = "/charge",
                    Value = 0.01,
                },
            },
            ResourceThresholds = new[]
            {
                new Grafana.Assert.Inputs.ThresholdsResourceThresholdArgs
                {
                    AssertionName = "Saturation",
                    ResourceType = "container",
                    ContainerName = "worker",
                    Source = "metrics",
                    Severity = "warning",
                    Value = 75,
                },
            },
            HealthThresholds = new[]
            {
                new Grafana.Assert.Inputs.ThresholdsHealthThresholdArgs
                {
                    AssertionName = "ServiceDown",
                    Expression = "up < 1",
                    EntityType = "Service",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.grafana.assert.Thresholds;
    import com.pulumi.grafana.assert.ThresholdsArgs;
    import com.pulumi.grafana.assert.inputs.ThresholdsRequestThresholdArgs;
    import com.pulumi.grafana.assert.inputs.ThresholdsResourceThresholdArgs;
    import com.pulumi.grafana.assert.inputs.ThresholdsHealthThresholdArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var basic = new Thresholds("basic", ThresholdsArgs.builder()
                .requestThresholds(ThresholdsRequestThresholdArgs.builder()
                    .entityName("payment-service")
                    .assertionName("ErrorRatioBreach")
                    .requestType("inbound")
                    .requestContext("/charge")
                    .value(0.01)
                    .build())
                .resourceThresholds(ThresholdsResourceThresholdArgs.builder()
                    .assertionName("Saturation")
                    .resourceType("container")
                    .containerName("worker")
                    .source("metrics")
                    .severity("warning")
                    .value(75.0)
                    .build())
                .healthThresholds(ThresholdsHealthThresholdArgs.builder()
                    .assertionName("ServiceDown")
                    .expression("up < 1")
                    .entityType("Service")
                    .build())
                .build());
    
        }
    }
    
    resources:
      basic:
        type: grafana:assert:Thresholds
        properties:
          requestThresholds:
            - entityName: payment-service
              assertionName: ErrorRatioBreach
              requestType: inbound
              requestContext: /charge
              value: 0.01
          resourceThresholds:
            - assertionName: Saturation
              resourceType: container
              containerName: worker
              source: metrics
              severity: warning
              value: 75
          healthThresholds:
            - assertionName: ServiceDown
              expression: up < 1
              entityType: Service
    

    Create Thresholds Resource

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

    Constructor syntax

    new Thresholds(name: string, args?: ThresholdsArgs, opts?: CustomResourceOptions);
    @overload
    def Thresholds(resource_name: str,
                   args: Optional[ThresholdsArgs] = None,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Thresholds(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   health_thresholds: Optional[Sequence[ThresholdsHealthThresholdArgs]] = None,
                   request_thresholds: Optional[Sequence[ThresholdsRequestThresholdArgs]] = None,
                   resource_thresholds: Optional[Sequence[ThresholdsResourceThresholdArgs]] = None)
    func NewThresholds(ctx *Context, name string, args *ThresholdsArgs, opts ...ResourceOption) (*Thresholds, error)
    public Thresholds(string name, ThresholdsArgs? args = null, CustomResourceOptions? opts = null)
    public Thresholds(String name, ThresholdsArgs args)
    public Thresholds(String name, ThresholdsArgs args, CustomResourceOptions options)
    
    type: grafana:assert:Thresholds
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ThresholdsArgs
    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 ThresholdsArgs
    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 ThresholdsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ThresholdsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ThresholdsArgs
    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 thresholdsResource = new Grafana.Assert.Thresholds("thresholdsResource", new()
    {
        HealthThresholds = new[]
        {
            new Grafana.Assert.Inputs.ThresholdsHealthThresholdArgs
            {
                AssertionName = "string",
                EntityType = "string",
                Expression = "string",
                AlertCategory = "string",
            },
        },
        RequestThresholds = new[]
        {
            new Grafana.Assert.Inputs.ThresholdsRequestThresholdArgs
            {
                AssertionName = "string",
                EntityName = "string",
                RequestContext = "string",
                RequestType = "string",
                Value = 0,
            },
        },
        ResourceThresholds = new[]
        {
            new Grafana.Assert.Inputs.ThresholdsResourceThresholdArgs
            {
                AssertionName = "string",
                ContainerName = "string",
                ResourceType = "string",
                Severity = "string",
                Source = "string",
                Value = 0,
            },
        },
    });
    
    example, err := assert.NewThresholds(ctx, "thresholdsResource", &assert.ThresholdsArgs{
    	HealthThresholds: assert.ThresholdsHealthThresholdArray{
    		&assert.ThresholdsHealthThresholdArgs{
    			AssertionName: pulumi.String("string"),
    			EntityType:    pulumi.String("string"),
    			Expression:    pulumi.String("string"),
    			AlertCategory: pulumi.String("string"),
    		},
    	},
    	RequestThresholds: assert.ThresholdsRequestThresholdArray{
    		&assert.ThresholdsRequestThresholdArgs{
    			AssertionName:  pulumi.String("string"),
    			EntityName:     pulumi.String("string"),
    			RequestContext: pulumi.String("string"),
    			RequestType:    pulumi.String("string"),
    			Value:          pulumi.Float64(0),
    		},
    	},
    	ResourceThresholds: assert.ThresholdsResourceThresholdArray{
    		&assert.ThresholdsResourceThresholdArgs{
    			AssertionName: pulumi.String("string"),
    			ContainerName: pulumi.String("string"),
    			ResourceType:  pulumi.String("string"),
    			Severity:      pulumi.String("string"),
    			Source:        pulumi.String("string"),
    			Value:         pulumi.Float64(0),
    		},
    	},
    })
    
    var thresholdsResource = new Thresholds("thresholdsResource", ThresholdsArgs.builder()
        .healthThresholds(ThresholdsHealthThresholdArgs.builder()
            .assertionName("string")
            .entityType("string")
            .expression("string")
            .alertCategory("string")
            .build())
        .requestThresholds(ThresholdsRequestThresholdArgs.builder()
            .assertionName("string")
            .entityName("string")
            .requestContext("string")
            .requestType("string")
            .value(0.0)
            .build())
        .resourceThresholds(ThresholdsResourceThresholdArgs.builder()
            .assertionName("string")
            .containerName("string")
            .resourceType("string")
            .severity("string")
            .source("string")
            .value(0.0)
            .build())
        .build());
    
    thresholds_resource = grafana.assert_.Thresholds("thresholdsResource",
        health_thresholds=[{
            "assertion_name": "string",
            "entity_type": "string",
            "expression": "string",
            "alert_category": "string",
        }],
        request_thresholds=[{
            "assertion_name": "string",
            "entity_name": "string",
            "request_context": "string",
            "request_type": "string",
            "value": 0,
        }],
        resource_thresholds=[{
            "assertion_name": "string",
            "container_name": "string",
            "resource_type": "string",
            "severity": "string",
            "source": "string",
            "value": 0,
        }])
    
    const thresholdsResource = new grafana.assert.Thresholds("thresholdsResource", {
        healthThresholds: [{
            assertionName: "string",
            entityType: "string",
            expression: "string",
            alertCategory: "string",
        }],
        requestThresholds: [{
            assertionName: "string",
            entityName: "string",
            requestContext: "string",
            requestType: "string",
            value: 0,
        }],
        resourceThresholds: [{
            assertionName: "string",
            containerName: "string",
            resourceType: "string",
            severity: "string",
            source: "string",
            value: 0,
        }],
    });
    
    type: grafana:assert:Thresholds
    properties:
        healthThresholds:
            - alertCategory: string
              assertionName: string
              entityType: string
              expression: string
        requestThresholds:
            - assertionName: string
              entityName: string
              requestContext: string
              requestType: string
              value: 0
        resourceThresholds:
            - assertionName: string
              containerName: string
              resourceType: string
              severity: string
              source: string
              value: 0
    

    Thresholds 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 Thresholds resource accepts the following input properties:

    healthThresholds List<Property Map>
    List of health thresholds.
    requestThresholds List<Property Map>
    List of request thresholds.
    resourceThresholds List<Property Map>
    List of resource thresholds.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Thresholds 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 str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Thresholds Resource

    Get an existing Thresholds 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?: ThresholdsState, opts?: CustomResourceOptions): Thresholds
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            health_thresholds: Optional[Sequence[ThresholdsHealthThresholdArgs]] = None,
            request_thresholds: Optional[Sequence[ThresholdsRequestThresholdArgs]] = None,
            resource_thresholds: Optional[Sequence[ThresholdsResourceThresholdArgs]] = None) -> Thresholds
    func GetThresholds(ctx *Context, name string, id IDInput, state *ThresholdsState, opts ...ResourceOption) (*Thresholds, error)
    public static Thresholds Get(string name, Input<string> id, ThresholdsState? state, CustomResourceOptions? opts = null)
    public static Thresholds get(String name, Output<String> id, ThresholdsState state, CustomResourceOptions options)
    resources:  _:    type: grafana:assert:Thresholds    get:      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:
    healthThresholds List<Property Map>
    List of health thresholds.
    requestThresholds List<Property Map>
    List of request thresholds.
    resourceThresholds List<Property Map>
    List of resource thresholds.

    Supporting Types

    ThresholdsHealthThreshold, ThresholdsHealthThresholdArgs

    AssertionName string
    Assertion name.
    EntityType string
    Entity type for the health threshold (e.g., Service, Pod, Namespace, Volume).
    Expression string
    Prometheus expression.
    AlertCategory string
    Optional alert category label for the health threshold.
    AssertionName string
    Assertion name.
    EntityType string
    Entity type for the health threshold (e.g., Service, Pod, Namespace, Volume).
    Expression string
    Prometheus expression.
    AlertCategory string
    Optional alert category label for the health threshold.
    assertionName String
    Assertion name.
    entityType String
    Entity type for the health threshold (e.g., Service, Pod, Namespace, Volume).
    expression String
    Prometheus expression.
    alertCategory String
    Optional alert category label for the health threshold.
    assertionName string
    Assertion name.
    entityType string
    Entity type for the health threshold (e.g., Service, Pod, Namespace, Volume).
    expression string
    Prometheus expression.
    alertCategory string
    Optional alert category label for the health threshold.
    assertion_name str
    Assertion name.
    entity_type str
    Entity type for the health threshold (e.g., Service, Pod, Namespace, Volume).
    expression str
    Prometheus expression.
    alert_category str
    Optional alert category label for the health threshold.
    assertionName String
    Assertion name.
    entityType String
    Entity type for the health threshold (e.g., Service, Pod, Namespace, Volume).
    expression String
    Prometheus expression.
    alertCategory String
    Optional alert category label for the health threshold.

    ThresholdsRequestThreshold, ThresholdsRequestThresholdArgs

    AssertionName string
    Assertion name (e.g., RequestRateAnomaly, ErrorRatioBreach).
    EntityName string
    Entity name the threshold applies to.
    RequestContext string
    Request context (e.g., path or context identifier).
    RequestType string
    Request type (e.g., inbound/outbound).
    Value double
    Threshold value.
    AssertionName string
    Assertion name (e.g., RequestRateAnomaly, ErrorRatioBreach).
    EntityName string
    Entity name the threshold applies to.
    RequestContext string
    Request context (e.g., path or context identifier).
    RequestType string
    Request type (e.g., inbound/outbound).
    Value float64
    Threshold value.
    assertionName String
    Assertion name (e.g., RequestRateAnomaly, ErrorRatioBreach).
    entityName String
    Entity name the threshold applies to.
    requestContext String
    Request context (e.g., path or context identifier).
    requestType String
    Request type (e.g., inbound/outbound).
    value Double
    Threshold value.
    assertionName string
    Assertion name (e.g., RequestRateAnomaly, ErrorRatioBreach).
    entityName string
    Entity name the threshold applies to.
    requestContext string
    Request context (e.g., path or context identifier).
    requestType string
    Request type (e.g., inbound/outbound).
    value number
    Threshold value.
    assertion_name str
    Assertion name (e.g., RequestRateAnomaly, ErrorRatioBreach).
    entity_name str
    Entity name the threshold applies to.
    request_context str
    Request context (e.g., path or context identifier).
    request_type str
    Request type (e.g., inbound/outbound).
    value float
    Threshold value.
    assertionName String
    Assertion name (e.g., RequestRateAnomaly, ErrorRatioBreach).
    entityName String
    Entity name the threshold applies to.
    requestContext String
    Request context (e.g., path or context identifier).
    requestType String
    Request type (e.g., inbound/outbound).
    value Number
    Threshold value.

    ThresholdsResourceThreshold, ThresholdsResourceThresholdArgs

    AssertionName string
    Assertion name (e.g., Saturation, ResourceRateBreach).
    ContainerName string
    Container name.
    ResourceType string
    Resource type (e.g., container/pod/node).
    Severity string
    Severity (warning or critical).
    Source string
    Data source for the threshold (e.g., metrics/logs).
    Value double
    Threshold value.
    AssertionName string
    Assertion name (e.g., Saturation, ResourceRateBreach).
    ContainerName string
    Container name.
    ResourceType string
    Resource type (e.g., container/pod/node).
    Severity string
    Severity (warning or critical).
    Source string
    Data source for the threshold (e.g., metrics/logs).
    Value float64
    Threshold value.
    assertionName String
    Assertion name (e.g., Saturation, ResourceRateBreach).
    containerName String
    Container name.
    resourceType String
    Resource type (e.g., container/pod/node).
    severity String
    Severity (warning or critical).
    source String
    Data source for the threshold (e.g., metrics/logs).
    value Double
    Threshold value.
    assertionName string
    Assertion name (e.g., Saturation, ResourceRateBreach).
    containerName string
    Container name.
    resourceType string
    Resource type (e.g., container/pod/node).
    severity string
    Severity (warning or critical).
    source string
    Data source for the threshold (e.g., metrics/logs).
    value number
    Threshold value.
    assertion_name str
    Assertion name (e.g., Saturation, ResourceRateBreach).
    container_name str
    Container name.
    resource_type str
    Resource type (e.g., container/pod/node).
    severity str
    Severity (warning or critical).
    source str
    Data source for the threshold (e.g., metrics/logs).
    value float
    Threshold value.
    assertionName String
    Assertion name (e.g., Saturation, ResourceRateBreach).
    containerName String
    Container name.
    resourceType String
    Resource type (e.g., container/pod/node).
    severity String
    Severity (warning or critical).
    source String
    Data source for the threshold (e.g., metrics/logs).
    value Number
    Threshold value.

    Import

    $ pulumi import grafana:assert/thresholds:Thresholds name "{{ id }}"
    

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

    Package Details

    Repository
    grafana pulumiverse/pulumi-grafana
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the grafana Terraform Provider.
    grafana logo
    Grafana v2.14.1 published on Thursday, Nov 6, 2025 by pulumiverse
      Meet Neo: Your AI Platform Teammate