1. Packages
  2. Chronosphere
  3. API Docs
  4. DerivedMetric
Chronosphere v0.9.2 published on Monday, Sep 9, 2024 by Chronosphere

chronosphere.DerivedMetric

Explore with Pulumi AI

chronosphere logo
Chronosphere v0.9.2 published on Monday, Sep 9, 2024 by Chronosphere

    Create DerivedMetric Resource

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

    Constructor syntax

    new DerivedMetric(name: string, args: DerivedMetricArgs, opts?: CustomResourceOptions);
    @overload
    def DerivedMetric(resource_name: str,
                      args: DerivedMetricArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def DerivedMetric(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      metric_name: Optional[str] = None,
                      name: Optional[str] = None,
                      queries: Optional[Sequence[DerivedMetricQueryArgs]] = None,
                      description: Optional[str] = None,
                      slug: Optional[str] = None)
    func NewDerivedMetric(ctx *Context, name string, args DerivedMetricArgs, opts ...ResourceOption) (*DerivedMetric, error)
    public DerivedMetric(string name, DerivedMetricArgs args, CustomResourceOptions? opts = null)
    public DerivedMetric(String name, DerivedMetricArgs args)
    public DerivedMetric(String name, DerivedMetricArgs args, CustomResourceOptions options)
    
    type: chronosphere:DerivedMetric
    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 DerivedMetricArgs
    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 DerivedMetricArgs
    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 DerivedMetricArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DerivedMetricArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DerivedMetricArgs
    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 derivedMetricResource = new Pulumi.DerivedMetric("derivedMetricResource", new()
    {
        MetricName = "string",
        Name = "string",
        Queries = new[]
        {
            new Pulumi.Inputs.DerivedMetricQueryArgs
            {
                Query = new Pulumi.Inputs.DerivedMetricQueryQueryArgs
                {
                    Expr = "string",
                    Variables = new[]
                    {
                        new Pulumi.Inputs.DerivedMetricQueryQueryVariableArgs
                        {
                            DefaultSelector = "string",
                            Name = "string",
                        },
                    },
                },
                Selector = new Pulumi.Inputs.DerivedMetricQuerySelectorArgs
                {
                    Labels = 
                    {
                        { "string", "string" },
                    },
                },
            },
        },
        Description = "string",
        Slug = "string",
    });
    
    example, err := chronosphere.NewDerivedMetric(ctx, "derivedMetricResource", &chronosphere.DerivedMetricArgs{
    	MetricName: pulumi.String("string"),
    	Name:       pulumi.String("string"),
    	Queries: chronosphere.DerivedMetricQueryArray{
    		&chronosphere.DerivedMetricQueryArgs{
    			Query: &chronosphere.DerivedMetricQueryQueryArgs{
    				Expr: pulumi.String("string"),
    				Variables: chronosphere.DerivedMetricQueryQueryVariableArray{
    					&chronosphere.DerivedMetricQueryQueryVariableArgs{
    						DefaultSelector: pulumi.String("string"),
    						Name:            pulumi.String("string"),
    					},
    				},
    			},
    			Selector: &chronosphere.DerivedMetricQuerySelectorArgs{
    				Labels: pulumi.StringMap{
    					"string": pulumi.String("string"),
    				},
    			},
    		},
    	},
    	Description: pulumi.String("string"),
    	Slug:        pulumi.String("string"),
    })
    
    var derivedMetricResource = new DerivedMetric("derivedMetricResource", DerivedMetricArgs.builder()
        .metricName("string")
        .name("string")
        .queries(DerivedMetricQueryArgs.builder()
            .query(DerivedMetricQueryQueryArgs.builder()
                .expr("string")
                .variables(DerivedMetricQueryQueryVariableArgs.builder()
                    .defaultSelector("string")
                    .name("string")
                    .build())
                .build())
            .selector(DerivedMetricQuerySelectorArgs.builder()
                .labels(Map.of("string", "string"))
                .build())
            .build())
        .description("string")
        .slug("string")
        .build());
    
    derived_metric_resource = chronosphere.DerivedMetric("derivedMetricResource",
        metric_name="string",
        name="string",
        queries=[chronosphere.DerivedMetricQueryArgs(
            query=chronosphere.DerivedMetricQueryQueryArgs(
                expr="string",
                variables=[chronosphere.DerivedMetricQueryQueryVariableArgs(
                    default_selector="string",
                    name="string",
                )],
            ),
            selector=chronosphere.DerivedMetricQuerySelectorArgs(
                labels={
                    "string": "string",
                },
            ),
        )],
        description="string",
        slug="string")
    
    const derivedMetricResource = new chronosphere.DerivedMetric("derivedMetricResource", {
        metricName: "string",
        name: "string",
        queries: [{
            query: {
                expr: "string",
                variables: [{
                    defaultSelector: "string",
                    name: "string",
                }],
            },
            selector: {
                labels: {
                    string: "string",
                },
            },
        }],
        description: "string",
        slug: "string",
    });
    
    type: chronosphere:DerivedMetric
    properties:
        description: string
        metricName: string
        name: string
        queries:
            - query:
                expr: string
                variables:
                    - defaultSelector: string
                      name: string
              selector:
                labels:
                    string: string
        slug: string
    

    DerivedMetric Resource Properties

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

    Inputs

    The DerivedMetric resource accepts the following input properties:

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DerivedMetric 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 DerivedMetric Resource

    Get an existing DerivedMetric 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?: DerivedMetricState, opts?: CustomResourceOptions): DerivedMetric
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            metric_name: Optional[str] = None,
            name: Optional[str] = None,
            queries: Optional[Sequence[DerivedMetricQueryArgs]] = None,
            slug: Optional[str] = None) -> DerivedMetric
    func GetDerivedMetric(ctx *Context, name string, id IDInput, state *DerivedMetricState, opts ...ResourceOption) (*DerivedMetric, error)
    public static DerivedMetric Get(string name, Input<string> id, DerivedMetricState? state, CustomResourceOptions? opts = null)
    public static DerivedMetric get(String name, Output<String> id, DerivedMetricState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.

    Supporting Types

    DerivedMetricQuery, DerivedMetricQueryArgs

    DerivedMetricQueryQuery, DerivedMetricQueryQueryArgs

    DerivedMetricQueryQueryVariable, DerivedMetricQueryQueryVariableArgs

    DefaultSelector string
    Name string
    DefaultSelector string
    Name string
    defaultSelector String
    name String
    defaultSelector string
    name string
    defaultSelector String
    name String

    DerivedMetricQuerySelector, DerivedMetricQuerySelectorArgs

    Labels Dictionary<string, string>
    Labels map[string]string
    labels Map<String,String>
    labels {[key: string]: string}
    labels Mapping[str, str]
    labels Map<String>

    Package Details

    Repository
    chronosphere chronosphereio/pulumi-chronosphere
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the chronosphere Terraform Provider.
    chronosphere logo
    Chronosphere v0.9.2 published on Monday, Sep 9, 2024 by Chronosphere