1. Packages
  2. Launch Darkly
  3. API Docs
  4. getMetric
Launch Darkly v0.0.6 published on Sunday, Feb 19, 2023 by lbrlabs

launchdarkly.getMetric

Explore with Pulumi AI

Launch Darkly v0.0.6 published on Sunday, Feb 19, 2023 by lbrlabs

Provides a LaunchDarkly metric data source.

This data source allows you to retrieve metric information from your LaunchDarkly organization.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Launchdarkly = Pulumi.Launchdarkly;

return await Deployment.RunAsync(() => 
{
    var example = Launchdarkly.GetMetric.Invoke(new()
    {
        Key = "example-metric",
        ProjectKey = "example-project",
    });

});
Copy
package main

import (
	"github.com/lbrlabs/pulumi-launchdarkly/sdk/go/launchdarkly"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err = launchdarkly.LookupMetric(ctx, &launchdarkly.LookupMetricArgs{
			Key:        "example-metric",
			ProjectKey: "example-project",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.launchdarkly.LaunchdarklyFunctions;
import com.pulumi.launchdarkly.inputs.GetMetricArgs;
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 example = LaunchdarklyFunctions.getMetric(GetMetricArgs.builder()
            .key("example-metric")
            .projectKey("example-project")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as launchdarkly from "@pulumi/launchdarkly";

const example = launchdarkly.getMetric({
    key: "example-metric",
    projectKey: "example-project",
});
Copy
import pulumi
import pulumi_launchdarkly as launchdarkly

example = launchdarkly.get_metric(key="example-metric",
    project_key="example-project")
Copy
variables:
  example:
    fn::invoke:
      Function: launchdarkly:getMetric
      Arguments:
        key: example-metric
        projectKey: example-project
Copy

Using getMetric

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getMetric(args: GetMetricArgs, opts?: InvokeOptions): Promise<GetMetricResult>
function getMetricOutput(args: GetMetricOutputArgs, opts?: InvokeOptions): Output<GetMetricResult>
Copy
def get_metric(description: Optional[str] = None,
               event_key: Optional[str] = None,
               is_active: Optional[bool] = None,
               is_numeric: Optional[bool] = None,
               key: Optional[str] = None,
               kind: Optional[str] = None,
               maintainer_id: Optional[str] = None,
               name: Optional[str] = None,
               project_key: Optional[str] = None,
               selector: Optional[str] = None,
               success_criteria: Optional[str] = None,
               tags: Optional[Sequence[str]] = None,
               unit: Optional[str] = None,
               urls: Optional[Sequence[GetMetricUrl]] = None,
               opts: Optional[InvokeOptions] = None) -> GetMetricResult
def get_metric_output(description: Optional[pulumi.Input[str]] = None,
               event_key: Optional[pulumi.Input[str]] = None,
               is_active: Optional[pulumi.Input[bool]] = None,
               is_numeric: Optional[pulumi.Input[bool]] = None,
               key: Optional[pulumi.Input[str]] = None,
               kind: Optional[pulumi.Input[str]] = None,
               maintainer_id: Optional[pulumi.Input[str]] = None,
               name: Optional[pulumi.Input[str]] = None,
               project_key: Optional[pulumi.Input[str]] = None,
               selector: Optional[pulumi.Input[str]] = None,
               success_criteria: Optional[pulumi.Input[str]] = None,
               tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
               unit: Optional[pulumi.Input[str]] = None,
               urls: Optional[pulumi.Input[Sequence[pulumi.Input[GetMetricUrlArgs]]]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetMetricResult]
Copy
func LookupMetric(ctx *Context, args *LookupMetricArgs, opts ...InvokeOption) (*LookupMetricResult, error)
func LookupMetricOutput(ctx *Context, args *LookupMetricOutputArgs, opts ...InvokeOption) LookupMetricResultOutput
Copy

> Note: This function is named LookupMetric in the Go SDK.

public static class GetMetric 
{
    public static Task<GetMetricResult> InvokeAsync(GetMetricArgs args, InvokeOptions? opts = null)
    public static Output<GetMetricResult> Invoke(GetMetricInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetMetricResult> getMetric(GetMetricArgs args, InvokeOptions options)
public static Output<GetMetricResult> getMetric(GetMetricArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: launchdarkly:index/getMetric:getMetric
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Key
This property is required.
Changes to this property will trigger replacement.
string
The metric's unique key.
ProjectKey
This property is required.
Changes to this property will trigger replacement.
string
The metric's project key.
Description string
The description of the metric's purpose.
EventKey string
The event key to watch for custom metrics.
IsActive bool
IsNumeric bool
Kind Changes to this property will trigger replacement. string
The metric type. Available choices are click, custom, and pageview.
MaintainerId string
Name string
The name of the metric.
Selector string
The CSS selector for click metrics.
SuccessCriteria string
The success criteria for numeric custom metrics.
Tags List<string>
Set of tags associated with the metric.
Unit string
The unit for numeric custom metrics.
Urls List<Lbrlabs.PulumiPackage.Launchdarkly.Inputs.GetMetricUrl>
Which URLs the metric watches.
Key
This property is required.
Changes to this property will trigger replacement.
string
The metric's unique key.
ProjectKey
This property is required.
Changes to this property will trigger replacement.
string
The metric's project key.
Description string
The description of the metric's purpose.
EventKey string
The event key to watch for custom metrics.
IsActive bool
IsNumeric bool
Kind Changes to this property will trigger replacement. string
The metric type. Available choices are click, custom, and pageview.
MaintainerId string
Name string
The name of the metric.
Selector string
The CSS selector for click metrics.
SuccessCriteria string
The success criteria for numeric custom metrics.
Tags []string
Set of tags associated with the metric.
Unit string
The unit for numeric custom metrics.
Urls []GetMetricUrl
Which URLs the metric watches.
key
This property is required.
Changes to this property will trigger replacement.
String
The metric's unique key.
projectKey
This property is required.
Changes to this property will trigger replacement.
String
The metric's project key.
description String
The description of the metric's purpose.
eventKey String
The event key to watch for custom metrics.
isActive Boolean
isNumeric Boolean
kind Changes to this property will trigger replacement. String
The metric type. Available choices are click, custom, and pageview.
maintainerId String
name String
The name of the metric.
selector String
The CSS selector for click metrics.
successCriteria String
The success criteria for numeric custom metrics.
tags List<String>
Set of tags associated with the metric.
unit String
The unit for numeric custom metrics.
urls List<GetMetricUrl>
Which URLs the metric watches.
key
This property is required.
Changes to this property will trigger replacement.
string
The metric's unique key.
projectKey
This property is required.
Changes to this property will trigger replacement.
string
The metric's project key.
description string
The description of the metric's purpose.
eventKey string
The event key to watch for custom metrics.
isActive boolean
isNumeric boolean
kind Changes to this property will trigger replacement. string
The metric type. Available choices are click, custom, and pageview.
maintainerId string
name string
The name of the metric.
selector string
The CSS selector for click metrics.
successCriteria string
The success criteria for numeric custom metrics.
tags string[]
Set of tags associated with the metric.
unit string
The unit for numeric custom metrics.
urls GetMetricUrl[]
Which URLs the metric watches.
key
This property is required.
Changes to this property will trigger replacement.
str
The metric's unique key.
project_key
This property is required.
Changes to this property will trigger replacement.
str
The metric's project key.
description str
The description of the metric's purpose.
event_key str
The event key to watch for custom metrics.
is_active bool
is_numeric bool
kind Changes to this property will trigger replacement. str
The metric type. Available choices are click, custom, and pageview.
maintainer_id str
name str
The name of the metric.
selector str
The CSS selector for click metrics.
success_criteria str
The success criteria for numeric custom metrics.
tags Sequence[str]
Set of tags associated with the metric.
unit str
The unit for numeric custom metrics.
urls Sequence[GetMetricUrl]
Which URLs the metric watches.
key
This property is required.
Changes to this property will trigger replacement.
String
The metric's unique key.
projectKey
This property is required.
Changes to this property will trigger replacement.
String
The metric's project key.
description String
The description of the metric's purpose.
eventKey String
The event key to watch for custom metrics.
isActive Boolean
isNumeric Boolean
kind Changes to this property will trigger replacement. String
The metric type. Available choices are click, custom, and pageview.
maintainerId String
name String
The name of the metric.
selector String
The CSS selector for click metrics.
successCriteria String
The success criteria for numeric custom metrics.
tags List<String>
Set of tags associated with the metric.
unit String
The unit for numeric custom metrics.
urls List<Property Map>
Which URLs the metric watches.

getMetric Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Key string
MaintainerId string
ProjectKey string
The metrics's project key.
Description string
The description of the metric's purpose.
EventKey string
The event key to watch for custom metrics.
IsActive bool
IsNumeric bool
Kind string
The metric type. Available choices are click, custom, and pageview.
Name string
The name of the metric.
Selector string
The CSS selector for click metrics.
SuccessCriteria string
The success criteria for numeric custom metrics.
Tags List<string>
Set of tags associated with the metric.
Unit string
The unit for numeric custom metrics.
Urls List<Lbrlabs.PulumiPackage.Launchdarkly.Outputs.GetMetricUrl>
Which URLs the metric watches.
Id string
The provider-assigned unique ID for this managed resource.
Key string
MaintainerId string
ProjectKey string
The metrics's project key.
Description string
The description of the metric's purpose.
EventKey string
The event key to watch for custom metrics.
IsActive bool
IsNumeric bool
Kind string
The metric type. Available choices are click, custom, and pageview.
Name string
The name of the metric.
Selector string
The CSS selector for click metrics.
SuccessCriteria string
The success criteria for numeric custom metrics.
Tags []string
Set of tags associated with the metric.
Unit string
The unit for numeric custom metrics.
Urls []GetMetricUrl
Which URLs the metric watches.
id String
The provider-assigned unique ID for this managed resource.
key String
maintainerId String
projectKey String
The metrics's project key.
description String
The description of the metric's purpose.
eventKey String
The event key to watch for custom metrics.
isActive Boolean
isNumeric Boolean
kind String
The metric type. Available choices are click, custom, and pageview.
name String
The name of the metric.
selector String
The CSS selector for click metrics.
successCriteria String
The success criteria for numeric custom metrics.
tags List<String>
Set of tags associated with the metric.
unit String
The unit for numeric custom metrics.
urls List<GetMetricUrl>
Which URLs the metric watches.
id string
The provider-assigned unique ID for this managed resource.
key string
maintainerId string
projectKey string
The metrics's project key.
description string
The description of the metric's purpose.
eventKey string
The event key to watch for custom metrics.
isActive boolean
isNumeric boolean
kind string
The metric type. Available choices are click, custom, and pageview.
name string
The name of the metric.
selector string
The CSS selector for click metrics.
successCriteria string
The success criteria for numeric custom metrics.
tags string[]
Set of tags associated with the metric.
unit string
The unit for numeric custom metrics.
urls GetMetricUrl[]
Which URLs the metric watches.
id str
The provider-assigned unique ID for this managed resource.
key str
maintainer_id str
project_key str
The metrics's project key.
description str
The description of the metric's purpose.
event_key str
The event key to watch for custom metrics.
is_active bool
is_numeric bool
kind str
The metric type. Available choices are click, custom, and pageview.
name str
The name of the metric.
selector str
The CSS selector for click metrics.
success_criteria str
The success criteria for numeric custom metrics.
tags Sequence[str]
Set of tags associated with the metric.
unit str
The unit for numeric custom metrics.
urls Sequence[GetMetricUrl]
Which URLs the metric watches.
id String
The provider-assigned unique ID for this managed resource.
key String
maintainerId String
projectKey String
The metrics's project key.
description String
The description of the metric's purpose.
eventKey String
The event key to watch for custom metrics.
isActive Boolean
isNumeric Boolean
kind String
The metric type. Available choices are click, custom, and pageview.
name String
The name of the metric.
selector String
The CSS selector for click metrics.
successCriteria String
The success criteria for numeric custom metrics.
tags List<String>
Set of tags associated with the metric.
unit String
The unit for numeric custom metrics.
urls List<Property Map>
Which URLs the metric watches.

Supporting Types

GetMetricUrl

Kind This property is required. string
The metric type. Available choices are click, custom, and pageview.
Pattern string
Substring string
Url string
Kind This property is required. string
The metric type. Available choices are click, custom, and pageview.
Pattern string
Substring string
Url string
kind This property is required. String
The metric type. Available choices are click, custom, and pageview.
pattern String
substring String
url String
kind This property is required. string
The metric type. Available choices are click, custom, and pageview.
pattern string
substring string
url string
kind This property is required. str
The metric type. Available choices are click, custom, and pageview.
pattern str
substring str
url str
kind This property is required. String
The metric type. Available choices are click, custom, and pageview.
pattern String
substring String
url String

Package Details

Repository
launchdarkly lbrlabs/pulumi-launchdarkly
License
Notes
This Pulumi package is based on the launchdarkly Terraform Provider.
Launch Darkly v0.0.6 published on Sunday, Feb 19, 2023 by lbrlabs