var $schema = "../schema.json";
var schemaVersion = "v1";
var pluginType = "prometheus";
var pluginName = "Prometheus";
var docURL = "https://grafana.com/docs/grafana/latest/datasources/prometheus/configure/";
var fields = [
	{
		id: "root.url",
		key: "url",
		label: "Prometheus server URL",
		description: "URL of your Prometheus server. If Prometheus is running locally, use http://localhost:9090.",
		valueType: "string",
		semanticType: "url",
		target: "root",
		required: true,
		ui: {
			component: "input",
			placeholder: "http://localhost:9090"
		},
		validations: [
			{
				type: "pattern",
				pattern: "^https?://",
				message: "Must be a valid HTTP or HTTPS URL"
			}
		]
	},
	{
		id: "root.basicAuth",
		key: "basicAuth",
		label: "Basic Auth",
		description: "Enable basic authentication.",
		valueType: "boolean",
		target: "root",
		defaultValue: false,
		tags: [
			"managed-by:auth.method"
		]
	},
	{
		id: "auth.method",
		key: "authMethod",
		label: "Authentication method",
		description: "Choose an authentication method to access the data source.",
		valueType: "string",
		kind: "virtual",
		defaultValue: "no-auth",
		validations: [
			{
				type: "allowedValues",
				values: [
					"no-auth",
					"basic-auth",
					"forward-oauth"
				]
			}
		],
		ui: {
			component: "select",
			options: [
				{
					label: "No Authentication",
					value: "no-auth",
					description: "Data source is available without authentication"
				},
				{
					label: "Basic authentication",
					value: "basic-auth",
					description: "Authenticate with your data source username and password"
				},
				{
					label: "Forward OAuth Identity",
					value: "forward-oauth",
					description: "Forward the OAuth access token (and if available: the OIDC ID token) of the user querying the data source"
				}
			]
		},
		storage: {
			type: "computed",
			read: "root.basicAuth == true ? 'basic-auth' : (jsonData.oauthPassThru == true ? 'forward-oauth' : 'no-auth')"
		},
		effects: [
			{
				when: "value == 'no-auth'",
				set: {
					"root.basicAuth": false,
					"jsonData.oauthPassThru": false
				}
			},
			{
				when: "value == 'basic-auth'",
				set: {
					"root.basicAuth": true,
					"jsonData.oauthPassThru": false
				}
			},
			{
				when: "value == 'forward-oauth'",
				set: {
					"root.basicAuth": false,
					"jsonData.oauthPassThru": true
				}
			}
		]
	},
	{
		id: "root.basicAuthUser",
		key: "basicAuthUser",
		label: "User",
		description: "Username for basic authentication.",
		valueType: "string",
		target: "root",
		dependsOn: "auth.method == 'basic-auth'",
		requiredWhen: "auth.method == 'basic-auth'"
	},
	{
		id: "jsonData.timeInterval",
		key: "timeInterval",
		label: "Scrape interval",
		description: "Sets the standard scrape and evaluation interval. Set it to match the typical scrape interval in your Prometheus configuration. Default is 15s.",
		valueType: "string",
		semanticType: "duration",
		target: "jsonData",
		defaultValue: "15s",
		ui: {
			component: "input",
			placeholder: "15s"
		}
	},
	{
		id: "jsonData.queryTimeout",
		key: "queryTimeout",
		label: "Query timeout",
		description: "Sets the Prometheus query timeout. Default is 60s. Without a timeout, complex queries can run indefinitely.",
		valueType: "string",
		semanticType: "duration",
		target: "jsonData",
		defaultValue: "60s",
		ui: {
			component: "input",
			placeholder: "60s"
		}
	},
	{
		id: "jsonData.httpMethod",
		key: "httpMethod",
		label: "HTTP method",
		description: "HTTP method used for querying Prometheus. POST is recommended for complex queries.",
		valueType: "string",
		target: "jsonData",
		defaultValue: "POST",
		validations: [
			{
				type: "allowedValues",
				values: [
					"GET",
					"POST"
				]
			}
		],
		ui: {
			component: "select",
			options: [
				{
					label: "GET",
					value: "GET"
				},
				{
					label: "POST",
					value: "POST"
				}
			]
		}
	},
	{
		id: "jsonData.customQueryParameters",
		key: "customQueryParameters",
		label: "Custom query parameters",
		description: "Add custom parameters to the Prometheus query URL. Examples: timeout, partial_response, dedup, max_source_resolution. Multiple parameters should be joined using &.",
		valueType: "string",
		target: "jsonData",
		ui: {
			component: "input",
			placeholder: "Example: max_source_resolution=5m&timeout=30"
		}
	},
	{
		id: "jsonData.disableMetricsLookup",
		key: "disableMetricsLookup",
		label: "Disable metrics lookup",
		description: "When enabled, the metrics chooser in the query editor is not populated. Useful for Prometheus instances with a large number of metrics.",
		valueType: "boolean",
		target: "jsonData",
		defaultValue: false,
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.exemplarTraceIdDestinations",
		key: "exemplarTraceIdDestinations",
		label: "Exemplars",
		description: "Configure exemplar trace ID destinations. Links traces from Prometheus exemplars to a tracing backend.",
		valueType: "array",
		target: "jsonData",
		item: {
			valueType: "object",
			fields: [
				{
					id: "exemplarTraceIdDestinations.item.name",
					key: "name",
					label: "Label name",
					description: "The name of the field in the labels object used to obtain the traceID.",
					valueType: "string",
					isItemField: true,
					required: true
				},
				{
					id: "exemplarTraceIdDestinations.item.url",
					key: "url",
					label: "URL",
					description: "External link URL. Interpolate the value using ${__value.raw}.",
					valueType: "string",
					semanticType: "url",
					isItemField: true
				},
				{
					id: "exemplarTraceIdDestinations.item.urlDisplayLabel",
					key: "urlDisplayLabel",
					label: "URL label",
					description: "Custom display label to override the value of the Label name field.",
					valueType: "string",
					isItemField: true
				},
				{
					id: "exemplarTraceIdDestinations.item.datasourceUid",
					key: "datasourceUid",
					label: "Internal link",
					description: "Data source UID for internal link to a tracing backend.",
					valueType: "string",
					semanticType: "datasourceUid",
					isItemField: true
				}
			]
		}
	},
	{
		id: "jsonData.prometheusType",
		key: "prometheusType",
		label: "Prometheus type",
		description: "Select the type of your Prometheus-compatible database. Different types support different APIs. Setting this incorrectly may cause unexpected behavior.",
		valueType: "string",
		target: "jsonData",
		validations: [
			{
				type: "allowedValues",
				values: [
					"Cortex",
					"Mimir",
					"Prometheus",
					"Thanos"
				]
			}
		],
		ui: {
			component: "select",
			options: [
				{
					label: "Prometheus",
					value: "Prometheus"
				},
				{
					label: "Cortex",
					value: "Cortex"
				},
				{
					label: "Mimir",
					value: "Mimir"
				},
				{
					label: "Thanos",
					value: "Thanos"
				}
			]
		}
	},
	{
		id: "jsonData.prometheusVersion",
		key: "prometheusVersion",
		label: "Prometheus version",
		description: "The version of your Prometheus instance (e.g. 2.37.0, 3.3.0).",
		valueType: "string",
		target: "jsonData",
		ui: {
			component: "input",
			placeholder: "e.g. 2.37.0"
		}
	},
	{
		id: "jsonData.cacheLevel",
		key: "cacheLevel",
		label: "Cache level",
		description: "Sets the browser caching level for editor queries. Higher cache settings are recommended for high cardinality data sources.",
		valueType: "string",
		target: "jsonData",
		defaultValue: "Low",
		validations: [
			{
				type: "allowedValues",
				values: [
					"Low",
					"Medium",
					"High",
					"None"
				]
			}
		],
		ui: {
			component: "select",
			options: [
				{
					label: "Low",
					value: "Low"
				},
				{
					label: "Medium",
					value: "Medium"
				},
				{
					label: "High",
					value: "High"
				},
				{
					label: "None",
					value: "None"
				}
			]
		}
	},
	{
		id: "jsonData.defaultEditor",
		key: "defaultEditor",
		label: "Default editor",
		description: "Sets the default editor mode for new queries in the query editor.",
		valueType: "string",
		target: "jsonData",
		defaultValue: "builder",
		validations: [
			{
				type: "allowedValues",
				values: [
					"code",
					"builder"
				]
			}
		],
		ui: {
			component: "select",
			options: [
				{
					label: "Builder",
					value: "builder"
				},
				{
					label: "Code",
					value: "code"
				}
			]
		}
	},
	{
		id: "jsonData.incrementalQuerying",
		key: "incrementalQuerying",
		label: "Incremental querying (beta)",
		description: "Enable incremental querying to cache results and only fetch new data since the last query. Reduces database and network load.",
		valueType: "boolean",
		target: "jsonData",
		defaultValue: false,
		lifecycle: "experimental",
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.incrementalQueryOverlapWindow",
		key: "incrementalQueryOverlapWindow",
		label: "Query overlap window",
		description: "Buffer of time added to incremental queries. Default is 10m.",
		valueType: "string",
		semanticType: "duration",
		target: "jsonData",
		defaultValue: "10m",
		dependsOn: "jsonData.incrementalQuerying == true",
		lifecycle: "experimental",
		ui: {
			component: "input",
			placeholder: "10m"
		}
	},
	{
		id: "jsonData.disableRecordingRules",
		key: "disableRecordingRules",
		label: "Disable recording rules (beta)",
		description: "When enabled, Grafana won't fetch and parse recording rules from Prometheus, improving dashboard performance.",
		valueType: "boolean",
		target: "jsonData",
		defaultValue: false,
		lifecycle: "experimental",
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.manageAlerts",
		key: "manageAlerts",
		label: "Manage alert rules in Alerting UI",
		description: "Manage alert rules for this data source. To manage other alerting resources, add an Alertmanager data source.",
		valueType: "boolean",
		target: "jsonData",
		defaultValue: true,
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.allowAsRecordingRulesTarget",
		key: "allowAsRecordingRulesTarget",
		label: "Use as recording rules target",
		description: "Allow this data source to be used as the target for Grafana-managed recording rules.",
		valueType: "boolean",
		target: "jsonData",
		defaultValue: true,
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.oauthPassThru",
		key: "oauthPassThru",
		label: "Forward OAuth Identity",
		description: "Forward the OAuth access token (and if available: the OIDC ID token) of the user querying the data source.",
		valueType: "boolean",
		target: "jsonData",
		defaultValue: false,
		tags: [
			"managed-by:auth.method"
		]
	},
	{
		id: "jsonData.seriesEndpoint",
		key: "seriesEndpoint",
		label: "Use series endpoint",
		description: "Use the /api/v1/series endpoint with match[] parameter instead of the label values endpoint. The series endpoint supports POST method.",
		valueType: "boolean",
		target: "jsonData",
		defaultValue: false,
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.seriesLimit",
		key: "seriesLimit",
		label: "Series limit",
		description: "Maximum number of series returned. Applies to all resources (metrics, labels, values) for both series and labels endpoints. Set to 0 to disable the limit. Default is 40000.",
		valueType: "number",
		target: "jsonData",
		defaultValue: 40000,
		ui: {
			component: "input",
			placeholder: "40000"
		}
	},
	{
		id: "jsonData.timeout",
		key: "timeout",
		label: "HTTP request timeout",
		description: "HTTP request timeout in seconds. Overrides the global dataproxy.timeout setting.",
		valueType: "number",
		target: "jsonData",
		ui: {
			component: "input",
			placeholder: "Timeout in seconds"
		},
		validations: [
			{
				type: "range",
				min: 0
			}
		]
	},
	{
		id: "jsonData.serverName",
		key: "serverName",
		label: "TLS server name",
		description: "Controls the server name used for certificate common name/subject alternative name verification. Defaults to using the data source URL.",
		valueType: "string",
		semanticType: "hostname",
		target: "jsonData",
		dependsOn: "jsonData.tlsAuth == true"
	},
	{
		id: "jsonData.tlsAuth",
		key: "tlsAuth",
		label: "TLS Client Auth",
		description: "Enable TLS client certificate authentication.",
		valueType: "boolean",
		target: "jsonData",
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.tlsAuthWithCACert",
		key: "tlsAuthWithCACert",
		label: "With CA Cert",
		description: "Verify self-signed TLS certificates using a CA certificate.",
		valueType: "boolean",
		target: "jsonData",
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.tlsSkipVerify",
		key: "tlsSkipVerify",
		label: "Skip TLS Verify",
		description: "Skip TLS certificate verification. Use only for testing.",
		valueType: "boolean",
		target: "jsonData",
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.keepCookies",
		key: "keepCookies",
		label: "Allowed cookies",
		description: "Grafana proxy deletes forwarded cookies by default. Specify cookies by name that should be forwarded to the data source.",
		valueType: "array",
		target: "jsonData",
		item: {
			valueType: "string"
		},
		ui: {
			component: "list",
			placeholder: "New cookie (hit enter to add)"
		}
	},
	{
		id: "jsonData.pdcInjected",
		key: "pdcInjected",
		label: "Private data source connect",
		description: "When enabled, connection is made via Grafana's Private Data Source Connect (PDC).",
		valueType: "boolean",
		target: "jsonData"
	},
	{
		id: "httpHeaders",
		key: "httpHeaders",
		label: "Custom HTTP Headers",
		description: "Additional headers sent with every request to the data source.",
		valueType: "array",
		target: "jsonData",
		item: {
			valueType: "object",
			fields: [
				{
					id: "httpHeaders.item.name",
					key: "name",
					label: "Header Name",
					valueType: "string",
					isItemField: true,
					validations: [
						{
							type: "pattern",
							pattern: "^[A-Za-z][A-Za-z0-9-]*$",
							message: "Must be a valid HTTP header name"
						}
					]
				},
				{
					id: "httpHeaders.item.value",
					key: "value",
					label: "Header Value",
					valueType: "string",
					isItemField: true
				}
			]
		},
		storage: {
			type: "indexedPair",
			key: {
				target: "jsonData",
				pattern: "httpHeaderName{index}"
			},
			value: {
				target: "secureJsonData",
				pattern: "httpHeaderValue{index}"
			},
			startIndex: 1
		},
		validations: [
			{
				type: "itemCount",
				max: 10,
				message: "Maximum 10 custom headers"
			}
		]
	},
	{
		id: "secureJsonData.basicAuthPassword",
		key: "basicAuthPassword",
		label: "Password",
		description: "Password for basic authentication.",
		valueType: "string",
		semanticType: "password",
		target: "secureJsonData",
		dependsOn: "auth.method == 'basic-auth'"
	},
	{
		id: "secureJsonData.tlsCACert",
		key: "tlsCACert",
		label: "CA Cert",
		description: "PEM-encoded CA certificate to verify the Prometheus server's TLS certificate.",
		valueType: "string",
		target: "secureJsonData",
		dependsOn: "jsonData.tlsAuthWithCACert == true",
		ui: {
			component: "textarea",
			rows: 7,
			placeholder: "Begins with -----BEGIN CERTIFICATE-----"
		}
	},
	{
		id: "secureJsonData.tlsClientCert",
		key: "tlsClientCert",
		label: "Client Cert",
		description: "PEM-encoded client certificate for TLS client authentication.",
		valueType: "string",
		target: "secureJsonData",
		dependsOn: "jsonData.tlsAuth == true",
		ui: {
			component: "textarea",
			rows: 7,
			placeholder: "Begins with -----BEGIN CERTIFICATE-----"
		}
	},
	{
		id: "secureJsonData.tlsClientKey",
		key: "tlsClientKey",
		label: "Client Key",
		description: "PEM-encoded client private key for TLS client authentication.",
		valueType: "string",
		semanticType: "token",
		target: "secureJsonData",
		dependsOn: "jsonData.tlsAuth == true",
		ui: {
			component: "textarea",
			rows: 7,
			placeholder: "Begins with -----BEGIN RSA PRIVATE KEY-----"
		}
	}
];
var groups = [
	{
		id: "connection",
		title: "Connection",
		fieldRefs: [
			"root.url"
		]
	},
	{
		id: "auth",
		title: "Authentication",
		fieldRefs: [
			"auth.method",
			"root.basicAuthUser",
			"secureJsonData.basicAuthPassword"
		]
	},
	{
		id: "http-network",
		title: "HTTP / Network Settings",
		fieldRefs: [
			"jsonData.tlsAuthWithCACert",
			"secureJsonData.tlsCACert",
			"jsonData.tlsAuth",
			"jsonData.serverName",
			"secureJsonData.tlsClientCert",
			"secureJsonData.tlsClientKey",
			"jsonData.tlsSkipVerify",
			"httpHeaders",
			"jsonData.keepCookies",
			"jsonData.timeout",
			"jsonData.customQueryParameters",
			"jsonData.httpMethod",
			"jsonData.pdcInjected"
		]
	},
	{
		id: "alerting",
		title: "Alerting",
		fieldRefs: [
			"jsonData.manageAlerts",
			"jsonData.allowAsRecordingRulesTarget"
		]
	},
	{
		id: "interval-behaviour",
		title: "Interval behaviour",
		fieldRefs: [
			"jsonData.timeInterval",
			"jsonData.queryTimeout"
		]
	},
	{
		id: "query-editor",
		title: "Query editor",
		fieldRefs: [
			"jsonData.defaultEditor",
			"jsonData.disableMetricsLookup"
		]
	},
	{
		id: "performance",
		title: "Performance",
		fieldRefs: [
			"jsonData.prometheusType",
			"jsonData.prometheusVersion",
			"jsonData.cacheLevel",
			"jsonData.incrementalQuerying",
			"jsonData.incrementalQueryOverlapWindow",
			"jsonData.disableRecordingRules"
		]
	},
	{
		id: "other",
		title: "Other settings",
		fieldRefs: [
			"jsonData.seriesEndpoint",
			"jsonData.seriesLimit"
		]
	},
	{
		id: "exemplars",
		title: "Exemplars",
		fieldRefs: [
			"jsonData.exemplarTraceIdDestinations"
		]
	}
];
var relationships = [
	{
		type: "pair",
		fields: [
			"root.basicAuthUser",
			"secureJsonData.basicAuthPassword"
		],
		description: "Basic auth credentials"
	},
	{
		type: "pair",
		fields: [
			"secureJsonData.tlsClientCert",
			"secureJsonData.tlsClientKey"
		],
		description: "TLS client certificate and key"
	}
];
var prometheusSchema = {
	$schema: $schema,
	schemaVersion: schemaVersion,
	pluginType: pluginType,
	pluginName: pluginName,
	docURL: docURL,
	fields: fields,
	groups: groups,
	relationships: relationships
};

export { $schema, prometheusSchema as default, docURL, fields, groups, pluginName, pluginType, relationships, schemaVersion };
//# sourceMappingURL=prometheus.schema.json.js.map
