UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

260 lines (259 loc) 7.67 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages Knowledge Graph Log Configuration through Grafana API. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const production = new grafana.assert.LogConfig("production", { * name: "production", * priority: 1000, * defaultConfig: false, * dataSourceUid: "grafanacloud-logs", * errorLabel: "error", * matches: [ * { * property: "asserts_entity_type", * op: "=", * values: ["Service"], * }, * { * property: "environment", * op: "=", * values: [ * "production", * "staging", * ], * }, * { * property: "site", * op: "=", * values: [ * "us-east-1", * "us-west-2", * ], * }, * ], * entityPropertyToLogLabelMapping: { * otel_namespace: "service_namespace", * otel_service: "service_name", * environment: "env", * site: "region", * }, * filterBySpanId: true, * filterByTraceId: true, * }); * const development = new grafana.assert.LogConfig("development", { * name: "development", * priority: 2000, * defaultConfig: true, * dataSourceUid: "elasticsearch-dev", * errorLabel: "error", * matches: [ * { * property: "asserts_entity_type", * op: "=", * values: ["Service"], * }, * { * property: "environment", * op: "=", * values: [ * "development", * "testing", * ], * }, * { * property: "site", * op: "=", * values: ["us-east-1"], * }, * { * property: "service", * op: "=", * values: ["api"], * }, * ], * entityPropertyToLogLabelMapping: { * otel_namespace: "service_namespace", * otel_service: "service_name", * environment: "env", * site: "region", * service: "app", * }, * filterBySpanId: true, * filterByTraceId: true, * }); * const minimal = new grafana.assert.LogConfig("minimal", { * name: "minimal", * priority: 3000, * defaultConfig: false, * dataSourceUid: "loki-minimal", * matches: [{ * property: "asserts_entity_type", * op: "IS NOT NULL", * values: [], * }], * }); * ``` * * ## Import * * ```sh * terraform import grafana_asserts_log_config.name "{{ name }}" * ``` */ export declare class LogConfig extends pulumi.CustomResource { /** * Get an existing LogConfig 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?: LogConfigState, opts?: pulumi.CustomResourceOptions): LogConfig; /** * Returns true if the given object is an instance of LogConfig. 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 LogConfig; /** * DataSource to be queried (e.g., a Loki instance). */ readonly dataSourceUid: pulumi.Output<string>; /** * Is it the default config, therefore undeletable? */ readonly defaultConfig: pulumi.Output<boolean>; /** * Mapping of entity properties to log labels. */ readonly entityPropertyToLogLabelMapping: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Error label to filter logs. */ readonly errorLabel: pulumi.Output<string | undefined>; /** * Filter logs by span ID. */ readonly filterBySpanId: pulumi.Output<boolean | undefined>; /** * Filter logs by trace ID. */ readonly filterByTraceId: pulumi.Output<boolean | undefined>; /** * List of match rules for entity properties. */ readonly matches: pulumi.Output<outputs.assert.LogConfigMatch[] | undefined>; /** * The name of the log configuration. */ readonly name: pulumi.Output<string>; /** * Priority of the log configuration. A lower number means a higher priority. */ readonly priority: pulumi.Output<number>; /** * Create a LogConfig 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: LogConfigArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering LogConfig resources. */ export interface LogConfigState { /** * DataSource to be queried (e.g., a Loki instance). */ dataSourceUid?: pulumi.Input<string>; /** * Is it the default config, therefore undeletable? */ defaultConfig?: pulumi.Input<boolean>; /** * Mapping of entity properties to log labels. */ entityPropertyToLogLabelMapping?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Error label to filter logs. */ errorLabel?: pulumi.Input<string>; /** * Filter logs by span ID. */ filterBySpanId?: pulumi.Input<boolean>; /** * Filter logs by trace ID. */ filterByTraceId?: pulumi.Input<boolean>; /** * List of match rules for entity properties. */ matches?: pulumi.Input<pulumi.Input<inputs.assert.LogConfigMatch>[]>; /** * The name of the log configuration. */ name?: pulumi.Input<string>; /** * Priority of the log configuration. A lower number means a higher priority. */ priority?: pulumi.Input<number>; } /** * The set of arguments for constructing a LogConfig resource. */ export interface LogConfigArgs { /** * DataSource to be queried (e.g., a Loki instance). */ dataSourceUid: pulumi.Input<string>; /** * Is it the default config, therefore undeletable? */ defaultConfig: pulumi.Input<boolean>; /** * Mapping of entity properties to log labels. */ entityPropertyToLogLabelMapping?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Error label to filter logs. */ errorLabel?: pulumi.Input<string>; /** * Filter logs by span ID. */ filterBySpanId?: pulumi.Input<boolean>; /** * Filter logs by trace ID. */ filterByTraceId?: pulumi.Input<boolean>; /** * List of match rules for entity properties. */ matches?: pulumi.Input<pulumi.Input<inputs.assert.LogConfigMatch>[]>; /** * The name of the log configuration. */ name?: pulumi.Input<string>; /** * Priority of the log configuration. A lower number means a higher priority. */ priority: pulumi.Input<number>; }