1. Packages
  2. Chronosphere
  3. API Docs
  4. DerivedMetric
Chronosphere v0.9.8 published on Thursday, Apr 3, 2025 by Chronosphere

chronosphere.DerivedMetric

Explore with Pulumi AI

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 This property is required. string
The unique name of the resource.
args This property is required. DerivedMetricArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. DerivedMetricArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DerivedMetricArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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",
});
Copy
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"),
})
Copy
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());
Copy
derived_metric_resource = chronosphere.DerivedMetric("derivedMetricResource",
    metric_name="string",
    name="string",
    queries=[{
        "query": {
            "expr": "string",
            "variables": [{
                "default_selector": "string",
                "name": "string",
            }],
        },
        "selector": {
            "labels": {
                "string": "string",
            },
        },
    }],
    description="string",
    slug="string")
Copy
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",
});
Copy
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
Copy

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

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

The DerivedMetric resource accepts the following input properties:

MetricName This property is required. string
Name This property is required. string
Queries This property is required. List<Chronosphere.Pulumi.Inputs.DerivedMetricQuery>
Description string
Slug Changes to this property will trigger replacement. string
MetricName This property is required. string
Name This property is required. string
Queries This property is required. []DerivedMetricQueryArgs
Description string
Slug Changes to this property will trigger replacement. string
metricName This property is required. String
name This property is required. String
queries This property is required. List<DerivedMetricQuery>
description String
slug Changes to this property will trigger replacement. String
metricName This property is required. string
name This property is required. string
queries This property is required. DerivedMetricQuery[]
description string
slug Changes to this property will trigger replacement. string
metric_name This property is required. str
name This property is required. str
queries This property is required. Sequence[DerivedMetricQueryArgs]
description str
slug Changes to this property will trigger replacement. str
metricName This property is required. String
name This property is required. String
queries This property is required. List<Property Map>
description String
slug Changes to this property will trigger replacement. String

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)
resources:  _:    type: chronosphere:DerivedMetric    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
MetricName string
Name string
Queries List<Chronosphere.Pulumi.Inputs.DerivedMetricQuery>
Slug Changes to this property will trigger replacement. string
Description string
MetricName string
Name string
Queries []DerivedMetricQueryArgs
Slug Changes to this property will trigger replacement. string
description String
metricName String
name String
queries List<DerivedMetricQuery>
slug Changes to this property will trigger replacement. String
description string
metricName string
name string
queries DerivedMetricQuery[]
slug Changes to this property will trigger replacement. string
description str
metric_name str
name str
queries Sequence[DerivedMetricQueryArgs]
slug Changes to this property will trigger replacement. str
description String
metricName String
name String
queries List<Property Map>
slug Changes to this property will trigger replacement. String

Supporting Types

DerivedMetricQuery
, DerivedMetricQueryArgs

query This property is required. Property Map
selector Property Map

DerivedMetricQueryQuery
, DerivedMetricQueryQueryArgs

Expr This property is required. string
Variables []DerivedMetricQueryQueryVariable
expr This property is required. String
variables List<DerivedMetricQueryQueryVariable>
expr This property is required. string
variables DerivedMetricQueryQueryVariable[]
expr This property is required. String
variables List<Property Map>

DerivedMetricQueryQueryVariable
, DerivedMetricQueryQueryVariableArgs

DefaultSelector This property is required. string
Name This property is required. string
DefaultSelector This property is required. string
Name This property is required. string
defaultSelector This property is required. String
name This property is required. String
defaultSelector This property is required. string
name This property is required. string
default_selector This property is required. str
name This property is required. str
defaultSelector This property is required. String
name This property is required. 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.