UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

223 lines (222 loc) 7.12 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages Knowledge Graph Trace Configuration through Grafana API. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const production = new grafana.assert.TraceConfig("production", { * name: "production", * priority: 1000, * defaultConfig: false, * dataSourceUid: "grafanacloud-traces", * matches: [ * { * property: "asserts_entity_type", * op: "=", * values: ["Service"], * }, * { * property: "deployment_environment", * op: "=", * values: [ * "production", * "staging", * ], * }, * { * property: "asserts_site", * op: "=", * values: [ * "us-east-1", * "us-west-2", * ], * }, * ], * entityPropertyToTraceLabelMapping: { * cluster: "resource.k8s.cluster.name", * namespace: "resource.k8s.namespace", * container: "resource.container.name", * otel_service: "resource.service.name", * otel_namespace: "resource.service.namespace", * }, * }); * const development = new grafana.assert.TraceConfig("development", { * name: "development", * priority: 2000, * defaultConfig: false, * dataSourceUid: "grafanacloud-traces", * matches: [ * { * property: "asserts_entity_type", * op: "=", * values: ["Service"], * }, * { * property: "deployment_environment", * op: "=", * values: [ * "development", * "testing", * ], * }, * { * property: "asserts_site", * op: "=", * values: ["us-east-1"], * }, * { * property: "service", * op: "=", * values: ["my sample api"], * }, * ], * entityPropertyToTraceLabelMapping: { * cluster: "resource.k8s.cluster.name", * namespace: "resource.k8s.namespace", * container: "resource.container.name", * otel_service: "resource.service.name", * otel_namespace: "resource.service.namespace", * pod: "span.k8s.pod.name", * }, * }); * const minimal = new grafana.assert.TraceConfig("minimal", { * name: "minimal", * priority: 3000, * dataSourceUid: "tempo-minimal", * matches: [{ * property: "asserts_entity_type", * op: "IS NOT NULL", * }], * entityPropertyToTraceLabelMapping: { * cluster: "resource.k8s.cluster.name", * otel_service: "resource.service.name", * otel_namespace: "resource.service.namespace", * }, * }); * ``` * * ## Import * * ```sh * terraform import grafana_asserts_trace_config.name "{{ name }}" * ``` */ export declare class TraceConfig extends pulumi.CustomResource { /** * Get an existing TraceConfig resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TraceConfigState, opts?: pulumi.CustomResourceOptions): TraceConfig; /** * Returns true if the given object is an instance of TraceConfig. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is TraceConfig; /** * DataSource to be queried (e.g., a Tempo instance). */ readonly dataSourceUid: pulumi.Output<string>; /** * Is it the default config, therefore undeletable? */ readonly defaultConfig: pulumi.Output<boolean>; /** * Mapping of entity properties to trace labels. */ readonly entityPropertyToTraceLabelMapping: pulumi.Output<{ [key: string]: string; } | undefined>; /** * List of match rules for entity properties. */ readonly matches: pulumi.Output<outputs.assert.TraceConfigMatch[] | undefined>; /** * The name of the trace configuration. */ readonly name: pulumi.Output<string>; /** * Priority of the trace configuration. A lower number means a higher priority. */ readonly priority: pulumi.Output<number>; /** * Create a TraceConfig resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: TraceConfigArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering TraceConfig resources. */ export interface TraceConfigState { /** * DataSource to be queried (e.g., a Tempo instance). */ dataSourceUid?: pulumi.Input<string>; /** * Is it the default config, therefore undeletable? */ defaultConfig?: pulumi.Input<boolean>; /** * Mapping of entity properties to trace labels. */ entityPropertyToTraceLabelMapping?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * List of match rules for entity properties. */ matches?: pulumi.Input<pulumi.Input<inputs.assert.TraceConfigMatch>[]>; /** * The name of the trace configuration. */ name?: pulumi.Input<string>; /** * Priority of the trace configuration. A lower number means a higher priority. */ priority?: pulumi.Input<number>; } /** * The set of arguments for constructing a TraceConfig resource. */ export interface TraceConfigArgs { /** * DataSource to be queried (e.g., a Tempo instance). */ dataSourceUid: pulumi.Input<string>; /** * Is it the default config, therefore undeletable? */ defaultConfig: pulumi.Input<boolean>; /** * Mapping of entity properties to trace labels. */ entityPropertyToTraceLabelMapping?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * List of match rules for entity properties. */ matches?: pulumi.Input<pulumi.Input<inputs.assert.TraceConfigMatch>[]>; /** * The name of the trace configuration. */ name?: pulumi.Input<string>; /** * Priority of the trace configuration. A lower number means a higher priority. */ priority: pulumi.Input<number>; }