Skip to content

Instantly share code, notes, and snippets.

@karlrwjohnson
Created June 8, 2024 19:38
Show Gist options
  • Save karlrwjohnson/9d29bf06d7b932fe18d616bbfd1d1f95 to your computer and use it in GitHub Desktop.
Save karlrwjohnson/9d29bf06d7b932fe18d616bbfd1d1f95 to your computer and use it in GitHub Desktop.
Typescript types for Loki configuration file

This script generates a Typescript typedef file for Loki's configuration file.

I've also included the output of the script at time of writing. If major changes are made to Loki, the typedefs will fall out of date.

If you use Typescript to generate the Loki configuration (notably, all JSON is also YAML, so you can JSON.stringify a Typescript object), this file would be useful.

I haven't bothered putting this in a repo because I'd also feel the need to generate a pipeline to regenerate the file to keep it up to date, and re-publish it as an NPM package. I'm not really interested in doing that right now.

I'm putting this out there in case someone else wants to pick up the torch and productionalize it.

Ideally though, I'd like to see Grafana publish a JSON schema for the Loki config file that auto-updates whenever they make changes.

import { writeFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
/**
* Inject aliases for types observed in the Loki config documentation.
* A few of them come from the list of generic types at the type of the page,
* but the rest of them were hand-written until Typescript stopped complaining about undefined types.
*
* This will be appended to the end of the types file.
*/
//language=ts
const TYPE_ALIASES = `// Scalar aliases used by the Loki documentation. This bit is hand-written.
/** Presumably an ISO-8601 timestamp, except that in the one place it's used, it asks for a plain calendar date. Consult the docs. **/
type daytime = string;
/** any integer matching the regular expression [1-9]+[0-9]* **/
type int = number;
type float = number;
/** a duration matching the regular expression /[0-9]+(ns|us|µs|ms|[smh])/ **/
type duration = string;
/** a string matching the regular expression \`[a-zA-Z_][a-zA-Z0-9_]*\` **/
type labelname = string;
/** a string of unicode characters **/
type labelvalue = string;
/** a valid path relative to current working directory or an absolute path. **/
type filename = string;
/** a valid string consisting of a hostname or IP followed by an optional port number **/
type host = string;
/** a string that represents a secret, such as a password **/
type secret = string;
type url = string;
/** Undocumented. I think this is a string, but I'm not sure **/
type Label = string;
/** Undocumented, but this is pretty obvious. Don't try to use a Javascript regex here. It needs to be serialized to YAML. **/
type Regexp = string;
/** Undocumented. **/
type RemoteWriteConfig = unknown;
/** Undocumented. **/
type StreamRetention = unknown;
/** Not documented on page. @see https://grafana.com/docs/loki/latest/operations/blocking-queries/ */
type blocked_query = any;
/** Undocumented - this is a guess. **/
type headers = Record<string, string>;
/** Undocumented **/
type relabel_config = unknown;
`;
/**
* Markdown file describing the configuration file format.
* It contains pseudo-YAML snippets describing the available options.
*
* This file turned out to be a good
*/
const DOCUMENTATION_URL = 'https://raw.githubusercontent.com/grafana/loki/main/docs/sources/shared/configuration.md';
/** Filename to write out the type file to **/
const OUTPUT_PATH = resolve(dirname(fileURLToPath(import.meta.url)), 'loki-config-types.ts');
/** The fake "type" that represents the root of the file. This happens to be the first word of the H3 section header. **/
const ROOT_TYPE_NAME = 'Supported';
async function main() {
console.debug('Fetching documentation from', DOCUMENTATION_URL);
const response = await fetch(DOCUMENTATION_URL);
const configDocumentationFile = await response.text();
// configDocumentationFile is a Markdown document. I'm interested in the YAML blocks contained therein.
// I'm not going to hand-write a parser that's just barely good enough to process this document.
const types = extractYamlBlocks(configDocumentationFile);
// Monkey-patch the way the "root" object gets interpreted
const rootType = types.get(ROOT_TYPE_NAME);
if (!rootType) {
throw new Error(`Unable to find the root type (named ${JSON.stringify(ROOT_TYPE_NAME)}). Please rename the "rootTypeName" variable to one of: ${JSON.stringify(Array.from(types.keys()))}`)
}
types.set('LokiConfig', rootType);
types.delete(ROOT_TYPE_NAME);
const parsed = Array.from(types.entries(), ([typeName, { description, yaml }]) => {
console.log('Found definition for type', typeName)
return { name: typeName, description, properties: parseYamlTypeToType(yaml) };
});
writeFileSync(OUTPUT_PATH, exportTypescript(parsed));
}
///// Support code follows...
/** Wrapper type to throw around an array and an index. Turned out to be useful here. **/
type ArrayIndexPointer<T> = {
array: T[];
index: number;
}
function nextIndex<T>({ array, index: prevIndex }: ArrayIndexPointer<T>): null | ArrayIndexPointer<T> {
const index = prevIndex + 1;
return (index < array.length && index > 0) ? { array, index } : null;
}
type SeekResult = {
at: ArrayIndexPointer<string>;
match: RegExpMatchArray;
}
/**
* Look for a regular expression in a list of strings, returning the first result
* @param pointer
* @param regExp
*/
function seekFirst(
pointer: null | ArrayIndexPointer<string>,
regExp: RegExp,
): null | SeekResult {
if (!pointer) return null;
const { array, index: startOffset } = pointer;
for (
let index = startOffset, len = array.length;
index < len;
++index
) {
const line = array[index];
const match = line.match(regExp);
if (match) {
return {
at: { array: array, index },
match,
}
}
}
return null;
}
const REGEX_SECTION_HEADER = /^###\s+(\w+)/;
const REGEX_YAML_START = /^```yaml\s*$/;
const REGEX_YAML_END = /^```\s*$/;
function extractYamlBlocks(configDocumentationFile: string): Map<string, { description: string[]; yaml: string[] }> {
const typeYamlsByName = new Map<string, { description: string[]; yaml: string[] }>();
const lines = configDocumentationFile.split('\n');
let currentLocation: ArrayIndexPointer<string> | null = { array: lines, index: 0 };
for (;;) {
const sectionHeader = seekFirst(currentLocation, REGEX_SECTION_HEADER);
if (!sectionHeader) break;
const typeName = sectionHeader.match[1] as string;
const afterSectionHeader = nextIndex(sectionHeader.at);
const yamlStart = seekFirst(afterSectionHeader, REGEX_YAML_START);
const nextSectionHeader = seekFirst(afterSectionHeader, REGEX_SECTION_HEADER);
if (!yamlStart || yamlStart.at.index > (nextSectionHeader?.at.index ?? Number.MAX_SAFE_INTEGER)) {
currentLocation = nextSectionHeader?.at ?? null;
} else {
const yamlEnd = seekFirst(nextIndex(yamlStart.at), REGEX_YAML_END);
if (!yamlEnd) {
throw new Error(`Unterminated YAML block starting at line ${yamlStart.at.index}`);
}
typeYamlsByName.set(typeName, {
description: trimBlankLines(lines.slice(sectionHeader.at.index + 1, yamlStart.at.index)),
yaml: lines.slice(yamlStart.at.index + 1, yamlEnd.at.index),
});
currentLocation = nextIndex(yamlEnd.at);
}
}
return typeYamlsByName;
}
/**
* Remove blank lines from the beginning and end of an array
* @param lines
*/
function trimBlankLines(lines: string[]): string[] {
const len = lines.length;
let start: number, endExcl: number;
for (start = 0; start < len && lines[start].match(/^\s*$/); ++start) {/* empty */}
for (endExcl = len; endExcl > start && lines[endExcl - 1].match(/^\s*$/); --endExcl) {/* empty */}
if (start === 0 && endExcl === lines.length - 1) return lines;
return lines.slice(start, endExcl);
}
// Not exactly JSON schema, but could be adapted to it.
type ObjectFieldDefinition = {
type: string;
name: string;
defaultValue?: unknown;
required: boolean;
deprecated?: boolean;
description: string[];
properties?: Record<string, ObjectFieldDefinition>;
}
// Regular expressions for parsing the content of the YAML blocks
// In a general case I'd pull out an actual YAML parser, but this time I only cared about parsing this one file.
const REGEX_BLANK = /^\s*$/;
const REGEX_COMMENT = /^(?<indent>\s*)#+\s+(?<comment>.*?)\s*$/;
const REGEX_OPTIONAL_PROPERTY = /^(?<indent>\s*)\[(?<name>\w+):\s*<(?<typeName>.+)>(?:\s*\|\s*default =\s*(?<defaultValue>.+?))?]\s*$/
const REGEX_REQUIRED_SCALAR_PROPERTY = /^(?<indent>\s*)(?<name>\w+):\s*<(?<typeName>.+)>(?:\s*\|\s*default =\s*(?<defaultValue>.+?))?\s*$/
const REGEX_REQUIRED_OBJECT_PROPERTY = /^(?<indent>\s*)(?<name>\w+):\s*$/
function matchAll<TMatchers extends Record<string, RegExp>>(str: string, matchers: TMatchers): { key: null } | { key: keyof TMatchers, match: RegExpMatchArray } {
for (const [key, regExp] of Object.entries(matchers)) {
const match = str.match(regExp);
if (match) return { key, match };
}
return { key: null };
}
function parseType(rawTypeName: string) {
let type = rawTypeName;
if (type.startsWith('list of ')) {
type = type.slice('list of '.length).replace(/s$/, '') + '[]';
} else if (type.endsWith('...')) {
// I don't really get why Go is encoding arrays as both "list of X" and "X..."
type = type.replace(/\.\.\.$/, '') + '[]';
} else {
const mapOfMatch = type.match(/map of (.+) to (.+)/)
if (mapOfMatch) {
type = `Record<${mapOfMatch[1]}, ${mapOfMatch[2]}>`;
}
}
return type
}
function parseYamlTypeToType(lines: string[]): Record<string, ObjectFieldDefinition> {
const ret: Record<string, ObjectFieldDefinition> = {};
const scopeStack = [{ parentIndentLength: -1, scope: ret }];
function findScopeFromIndent(searchIndent: string) {
while (searchIndent.length <= scopeStack[scopeStack.length - 1]?.parentIndentLength) {
scopeStack.pop();
if (scopeStack.length === 0) throw new Error('Assertion failed: ran out scopes to pop from stack')
}
return scopeStack[scopeStack.length - 1].scope;
}
const description: string[] = [];
for (let i = 0, len = lines.length; i < len; ++i) {
const line = lines[i];
const match = matchAll(line, { REGEX_BLANK, REGEX_COMMENT, REGEX_REQUIRED_OBJECT_PROPERTY, REGEX_OPTIONAL_PROPERTY, REGEX_REQUIRED_SCALAR_PROPERTY });
switch (match.key) {
case 'REGEX_BLANK':
break;
case 'REGEX_COMMENT':
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
description.push(match.match.groups!['comment']);
break;
case 'REGEX_OPTIONAL_PROPERTY': {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const { indent, name, typeName: rawTypeName, defaultValue: rawDefaultValue } = match.match.groups!;
const scope = findScopeFromIndent(indent);
let defaultValue: unknown;
if (rawDefaultValue === undefined) {
defaultValue = undefined;
} else if (rawDefaultValue.startsWith('"') && rawDefaultValue.endsWith('"')) {
defaultValue = JSON.parse(rawDefaultValue);
} else if (rawDefaultValue == 'true') {
defaultValue = true;
} else if (rawDefaultValue == 'false') {
defaultValue = true;
} else {
// attempt to cast to number
const defaultValueNumber = parseFloat(rawDefaultValue);
defaultValue = (isNaN(defaultValueNumber) || defaultValueNumber.toString() !== rawDefaultValue)
? defaultValue = rawDefaultValue
: defaultValue = defaultValueNumber;
}
scope[name] = {
name,
type: parseType(rawTypeName),
defaultValue,
deprecated: description.some(it => it.includes('Deprecated:')),
description: trimBlankLines(description.splice(0)),
required: false,
}
break;
}
case 'REGEX_REQUIRED_OBJECT_PROPERTY': {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const { indent, name } = match.match.groups!;
const scope = findScopeFromIndent(indent);
const newScope = {};
scope[name] = {
name,
type: 'object',
deprecated: description.some(it => it.includes('Deprecated:')),
description: trimBlankLines(description.splice(0)),
// It seems Loki's YAML config docs don't have a way to indicate when an object is required or optional.
// In at least one case, an object is missing in an example file when the docs would indicate it's required.
// So I'm forced to conclude that all objects are optional.
//required: true,
required: false,
properties: newScope,
}
scopeStack.push({ parentIndentLength: indent.length, scope: newScope });
break;
}
case 'REGEX_REQUIRED_SCALAR_PROPERTY': {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const { indent, name, typeName: rawTypeName } = match.match.groups!;
const scope = findScopeFromIndent(indent);
scope[name] = {
name,
type: parseType(rawTypeName),
deprecated: description.some(it => it.includes('Deprecated:')),
description: trimBlankLines(description.splice(0)),
required: true,
}
break;
}
case null:
throw new Error(`Unparseable line at index ${i}: ${JSON.stringify(line)}`)
default: throw new Error(`Unhandled case ${((match satisfies never) as { key: string }).key }`);
}
}
return ret;
}
function exportTypescriptProperties(properties: Record<string, ObjectFieldDefinition>, indent: string) {
let ret = '';
for (const [name, { type, required, description, defaultValue, deprecated, properties: childProperties }] of Object.entries(properties)) {
if (description.length) {
ret += indent;
ret += '/**\n';
for (const line of description) {
ret += indent;
ret += ' * ';
ret += line;
ret += '\n';
}
if (deprecated) {
ret += indent;
ret += ' * @deprecated ';
ret += '\n';
}
if (defaultValue !== undefined) {
ret += indent;
ret += ' * @default ';
ret += JSON.stringify(defaultValue);
ret += '\n';
}
ret += indent;
ret += ' */\n';
} else if (defaultValue !== undefined) {
ret += indent;
ret += '/** @default ';
ret += JSON.stringify(defaultValue);
ret += ' **/\n';
}
ret += indent;
ret += name;
if (!required) {
ret += '?';
}
ret += ': ';
if (type === 'object') {
ret += '{\n';
ret += exportTypescriptProperties(childProperties ?? {}, indent + ' ');
ret += indent;
ret += '}';
} else {
ret += type;
}
ret += ';\n';
}
return ret;
}
function exportTypescript(blocks: { name: string, description: string[], properties: Record<string, ObjectFieldDefinition> }[]): string {
let ret = '/* Typescript typedefs for Loki configuration file generated on '
ret += (new Date()).toISOString()
ret += ' from: ';
ret += DOCUMENTATION_URL;
ret += ' */\n\n';
for (const { name, description, properties } of blocks) {
if (description.length) {
ret += '/**\n';
for (const line of description) {
ret += ' * ';
ret += line;
ret += '\n';
}
ret += ' */\n';
}
ret += 'export type ';
ret += name;
ret += ' = {\n';
ret += exportTypescriptProperties(properties, ' ');
ret += '};\n\n';
}
ret += TYPE_ALIASES;
return ret;
}
main().catch(e => console.error(e));
/* Typescript typedefs for Loki configuration file generated on 2024-06-08T19:34:51.942Z from: https://raw.githubusercontent.com/grafana/loki/main/docs/sources/shared/configuration.md */
/**
* The `alibabacloud_storage_config` block configures the connection to Alibaba Cloud Storage object storage backend. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `common`
* - `ruler`
*
* &nbsp;
*/
export type alibabacloud_storage_config = {
/**
* Name of OSS bucket.
* CLI flag: -<prefix>.storage.oss.bucketname
* @default ""
*/
bucket?: string;
/**
* oss Endpoint to connect to.
* CLI flag: -<prefix>.storage.oss.endpoint
* @default ""
*/
endpoint?: string;
/**
* alibabacloud Access Key ID
* CLI flag: -<prefix>.storage.oss.access-key-id
* @default ""
*/
access_key_id?: string;
/**
* alibabacloud Secret Access Key
* CLI flag: -<prefix>.storage.oss.secret-access-key
* @default ""
*/
secret_access_key?: string;
};
/**
* Configuration for `analytics`.
*/
export type analytics = {
/**
* Enable anonymous usage reporting.
* CLI flag: -reporting.enabled
* @default true
*/
reporting_enabled?: boolean;
/**
* URL to which reports are sent
* CLI flag: -reporting.usage-stats-url
* @default "https://stats.grafana.org/loki-usage-report"
*/
usage_stats_url?: string;
};
/**
* Define actions for matching OpenTelemetry (OTEL) attributes.
*/
export type attributes_config = {
/**
* Configures action to take on matching attributes. It allows one of
* [structured_metadata, drop] for all attribute types. It additionally allows
* index_label action for resource attributes
* @default ""
*/
action?: string;
/**
* List of attributes to configure how to store them or drop them altogether
*/
attributes?: string[];
/**
* Regex to choose attributes to configure how to store them or drop them
* altogether
*/
regex?: Regexp;
};
/**
* The `aws_storage_config` block configures the connection to dynamoDB and S3 object storage. Either one of them or both can be configured.
*/
export type aws_storage_config = {
/**
* Deprecated: Configures storing indexes in DynamoDB.
* @deprecated
*/
dynamodb?: {
/**
* DynamoDB endpoint URL with escaped Key and Secret encoded. If only region is
* specified as a host, proper endpoint will be deduced. Use
* inmemory:///<table-name> to use a mock in-memory implementation.
* CLI flag: -dynamodb.url
*/
dynamodb_url?: url;
/**
* DynamoDB table management requests per second limit.
* CLI flag: -dynamodb.api-limit
* @default 2
*/
api_limit?: float;
/**
* DynamoDB rate cap to back off when throttled.
* CLI flag: -dynamodb.throttle-limit
* @default 10
*/
throttle_limit?: float;
metrics?: {
/**
* Use metrics-based autoscaling, via this query URL
* CLI flag: -metrics.url
* @default ""
*/
url?: string;
/**
* Queue length above which we will scale up capacity
* CLI flag: -metrics.target-queue-length
* @default 100000
*/
target_queue_length?: int;
/**
* Scale up capacity by this multiple
* CLI flag: -metrics.scale-up-factor
* @default 1.3
*/
scale_up_factor?: float;
/**
* Ignore throttling below this level (rate per second)
* CLI flag: -metrics.ignore-throttle-below
* @default 1
*/
ignore_throttle_below?: float;
/**
* query to fetch ingester queue length
* CLI flag: -metrics.queue-length-query
* @default "sum(avg_over_time(loki_ingester_flush_queue_length{job=\"cortex/ingester\"}[2m])) or sum(avg_over_time(cortex_ingester_flush_queue_length{job=\"cortex/ingester\"}[2m]))"
*/
queue_length_query?: string;
/**
* query to fetch throttle rates per table
* CLI flag: -metrics.write-throttle-query
* @default "sum(rate(cortex_dynamo_throttled_total{operation=\"DynamoDB.BatchWriteItem\"}[1m])) by (table) > 0"
*/
write_throttle_query?: string;
/**
* query to fetch write capacity usage per table
* CLI flag: -metrics.usage-query
* @default "sum(rate(cortex_dynamo_consumed_capacity_total{operation=\"DynamoDB.BatchWriteItem\"}[15m])) by (table) > 0"
*/
write_usage_query?: string;
/**
* query to fetch read capacity usage per table
* CLI flag: -metrics.read-usage-query
* @default "sum(rate(cortex_dynamo_consumed_capacity_total{operation=\"DynamoDB.QueryPages\"}[1h])) by (table) > 0"
*/
read_usage_query?: string;
/**
* query to fetch read errors per table
* CLI flag: -metrics.read-error-query
* @default "sum(increase(cortex_dynamo_failures_total{operation=\"DynamoDB.QueryPages\",error=\"ProvisionedThroughputExceededException\"}[1m])) by (table) > 0"
*/
read_error_query?: string;
};
/**
* Number of chunks to group together to parallelise fetches (zero to disable)
* CLI flag: -dynamodb.chunk-gang-size
* @default 10
*/
chunk_gang_size?: int;
/**
* Max number of chunk-get operations to start in parallel
* CLI flag: -dynamodb.chunk.get-max-parallelism
* @default 32
*/
chunk_get_max_parallelism?: int;
backoff_config?: {
/**
* Minimum backoff time
* CLI flag: -dynamodb.min-backoff
* @default "100ms"
*/
min_period?: duration;
/**
* Maximum backoff time
* CLI flag: -dynamodb.max-backoff
* @default "50s"
*/
max_period?: duration;
/**
* Maximum number of times to retry an operation
* CLI flag: -dynamodb.max-retries
* @default 20
*/
max_retries?: int;
};
/**
* KMS key used for encrypting DynamoDB items. DynamoDB will use an Amazon
* owned KMS key if not provided.
* CLI flag: -dynamodb.kms-key-id
* @default ""
*/
kms_key_id?: string;
};
/**
* S3 endpoint URL with escaped Key and Secret encoded. If only region is
* specified as a host, proper endpoint will be deduced. Use
* inmemory:///<bucket-name> to use a mock in-memory implementation.
* CLI flag: -s3.url
*/
s3?: url;
/**
* Set this to `true` to force the request to use path-style addressing.
* CLI flag: -s3.force-path-style
* @default true
*/
s3forcepathstyle?: boolean;
/**
* Comma separated list of bucket names to evenly distribute chunks over.
* Overrides any buckets specified in s3.url flag
* CLI flag: -s3.buckets
* @default ""
*/
bucketnames?: string;
/**
* S3 Endpoint to connect to.
* CLI flag: -s3.endpoint
* @default ""
*/
endpoint?: string;
/**
* AWS region to use.
* CLI flag: -s3.region
* @default ""
*/
region?: string;
/**
* AWS Access Key ID
* CLI flag: -s3.access-key-id
* @default ""
*/
access_key_id?: string;
/**
* AWS Secret Access Key
* CLI flag: -s3.secret-access-key
* @default ""
*/
secret_access_key?: string;
/**
* AWS Session Token
* CLI flag: -s3.session-token
* @default ""
*/
session_token?: string;
/**
* Disable https on s3 connection.
* CLI flag: -s3.insecure
* @default true
*/
insecure?: boolean;
http_config?: {
/**
* Timeout specifies a time limit for requests made by s3 Client.
* CLI flag: -s3.http.timeout
* @default "0s"
*/
timeout?: duration;
/**
* The maximum amount of time an idle connection will be held open.
* CLI flag: -s3.http.idle-conn-timeout
* @default "1m30s"
*/
idle_conn_timeout?: duration;
/**
* If non-zero, specifies the amount of time to wait for a server's response
* headers after fully writing the request.
* CLI flag: -s3.http.response-header-timeout
* @default "0s"
*/
response_header_timeout?: duration;
/**
* Set to true to skip verifying the certificate chain and hostname.
* CLI flag: -s3.http.insecure-skip-verify
* @default true
*/
insecure_skip_verify?: boolean;
/**
* Path to the trusted CA file that signed the SSL certificate of the S3
* endpoint.
* CLI flag: -s3.http.ca-file
* @default ""
*/
ca_file?: string;
};
/**
* The signature version to use for authenticating against S3. Supported values
* are: v4.
* CLI flag: -s3.signature-version
* @default "v4"
*/
signature_version?: string;
/**
* The S3 storage class which objects will use. Supported values are: GLACIER,
* DEEP_ARCHIVE, GLACIER_IR, INTELLIGENT_TIERING, ONEZONE_IA, OUTPOSTS,
* REDUCED_REDUNDANCY, STANDARD, STANDARD_IA.
* CLI flag: -s3.storage-class
* @default "STANDARD"
*/
storage_class?: string;
sse?: {
/**
* Enable AWS Server Side Encryption. Supported values: SSE-KMS, SSE-S3.
* CLI flag: -s3.sse.type
* @default ""
*/
type?: string;
/**
* KMS Key ID used to encrypt objects in S3
* CLI flag: -s3.sse.kms-key-id
* @default ""
*/
kms_key_id?: string;
/**
* KMS Encryption Context used for object encryption. It expects JSON formatted
* string.
* CLI flag: -s3.sse.kms-encryption-context
* @default ""
*/
kms_encryption_context?: string;
};
/**
* Configures back off when S3 get Object.
*/
backoff_config?: {
/**
* Minimum backoff time when s3 get Object
* CLI flag: -s3.min-backoff
* @default "100ms"
*/
min_period?: duration;
/**
* Maximum backoff time when s3 get Object
* CLI flag: -s3.max-backoff
* @default "3s"
*/
max_period?: duration;
/**
* Maximum number of times to retry when s3 get Object
* CLI flag: -s3.max-retries
* @default 5
*/
max_retries?: int;
};
};
/**
* The `azure_storage_config` block configures the connection to Azure object storage backend. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `common.storage`
* - `ruler.storage`
*
* &nbsp;
*/
export type azure_storage_config = {
/**
* Azure Cloud environment. Supported values are: AzureGlobal, AzureChinaCloud,
* AzureGermanCloud, AzureUSGovernment.
* CLI flag: -<prefix>.azure.environment
* @default "AzureGlobal"
*/
environment?: string;
/**
* Azure storage account name.
* CLI flag: -<prefix>.azure.account-name
* @default ""
*/
account_name?: string;
/**
* Azure storage account key.
* CLI flag: -<prefix>.azure.account-key
* @default ""
*/
account_key?: string;
/**
* If `connection-string` is set, the values of `account-name` and
* `endpoint-suffix` values will not be used. Use this method over `account-key`
* if you need to authenticate via a SAS token. Or if you use the Azurite
* emulator.
* CLI flag: -<prefix>.azure.connection-string
* @default ""
*/
connection_string?: string;
/**
* Name of the storage account blob container used to store chunks. This
* container must be created before running cortex.
* CLI flag: -<prefix>.azure.container-name
* @default "loki"
*/
container_name?: string;
/**
* Azure storage endpoint suffix without schema. The storage account name will be
* prefixed to this value to create the FQDN.
* CLI flag: -<prefix>.azure.endpoint-suffix
* @default ""
*/
endpoint_suffix?: string;
/**
* Use Managed Identity to authenticate to the Azure storage account.
* CLI flag: -<prefix>.azure.use-managed-identity
* @default true
*/
use_managed_identity?: boolean;
/**
* Use Federated Token to authenticate to the Azure storage account.
* CLI flag: -<prefix>.azure.use-federated-token
* @default true
*/
use_federated_token?: boolean;
/**
* User assigned identity ID to authenticate to the Azure storage account.
* CLI flag: -<prefix>.azure.user-assigned-id
* @default ""
*/
user_assigned_id?: string;
/**
* Use Service Principal to authenticate through Azure OAuth.
* CLI flag: -<prefix>.azure.use-service-principal
* @default true
*/
use_service_principal?: boolean;
/**
* Azure Service Principal ID(GUID).
* CLI flag: -<prefix>.azure.client-id
* @default ""
*/
client_id?: string;
/**
* Azure Service Principal secret key.
* CLI flag: -<prefix>.azure.client-secret
* @default ""
*/
client_secret?: string;
/**
* Azure Tenant ID is used to authenticate through Azure OAuth.
* CLI flag: -<prefix>.azure.tenant-id
* @default ""
*/
tenant_id?: string;
/**
* Chunk delimiter for blob ID to be used
* CLI flag: -<prefix>.azure.chunk-delimiter
* @default "-"
*/
chunk_delimiter?: string;
/**
* Preallocated buffer size for downloads.
* CLI flag: -<prefix>.azure.download-buffer-size
* @default 512000
*/
download_buffer_size?: int;
/**
* Preallocated buffer size for uploads.
* CLI flag: -<prefix>.azure.upload-buffer-size
* @default 256000
*/
upload_buffer_size?: int;
/**
* Number of buffers used to used to upload a chunk.
* CLI flag: -<prefix>.azure.download-buffer-count
* @default 1
*/
upload_buffer_count?: int;
/**
* Timeout for requests made against azure blob storage.
* CLI flag: -<prefix>.azure.request-timeout
* @default "30s"
*/
request_timeout?: duration;
/**
* Number of retries for a request which times out.
* CLI flag: -<prefix>.azure.max-retries
* @default 5
*/
max_retries?: int;
/**
* Minimum time to wait before retrying a request.
* CLI flag: -<prefix>.azure.min-retry-delay
* @default "10ms"
*/
min_retry_delay?: duration;
/**
* Maximum time to wait before retrying a request.
* CLI flag: -<prefix>.azure.max-retry-delay
* @default "500ms"
*/
max_retry_delay?: duration;
};
/**
* Experimental: The `bloom_compactor` block configures the Loki bloom compactor server, responsible for compacting stream indexes into bloom filters and merging them as bloom blocks.
*/
export type bloom_compactor = {
/**
* Defines the ring to be used by the bloom-compactor servers. In case this isn't
* configured, this block supports inheriting configuration from the common ring
* section.
*/
ring?: {
kvstore?: {
/**
* Backend storage to use for the ring. Supported values are: consul, etcd,
* inmemory, memberlist, multi.
* CLI flag: -bloom-compactor.ring.store
* @default "consul"
*/
store?: string;
/**
* The prefix for the keys in the store. Should end with a /.
* CLI flag: -bloom-compactor.ring.prefix
* @default "collectors/"
*/
prefix?: string;
/**
* Configuration for a Consul client. Only applies if the selected kvstore is
* consul.
* The CLI flags prefix for this block configuration is: bloom-compactor.ring
*/
consul?: consul;
/**
* Configuration for an ETCD v3 client. Only applies if the selected kvstore
* is etcd.
* The CLI flags prefix for this block configuration is: bloom-compactor.ring
*/
etcd?: etcd;
multi?: {
/**
* Primary backend storage used by multi-client.
* CLI flag: -bloom-compactor.ring.multi.primary
* @default ""
*/
primary?: string;
/**
* Secondary backend storage used by multi-client.
* CLI flag: -bloom-compactor.ring.multi.secondary
* @default ""
*/
secondary?: string;
/**
* Mirror writes to secondary store.
* CLI flag: -bloom-compactor.ring.multi.mirror-enabled
* @default true
*/
mirror_enabled?: boolean;
/**
* Timeout for storing value to secondary store.
* CLI flag: -bloom-compactor.ring.multi.mirror-timeout
* @default "2s"
*/
mirror_timeout?: duration;
};
};
/**
* Period at which to heartbeat to the ring. 0 = disabled.
* CLI flag: -bloom-compactor.ring.heartbeat-period
* @default "15s"
*/
heartbeat_period?: duration;
/**
* The heartbeat timeout after which compactors are considered unhealthy within
* the ring. 0 = never (timeout disabled).
* CLI flag: -bloom-compactor.ring.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* File path where tokens are stored. If empty, tokens are not stored at
* shutdown and restored at startup.
* CLI flag: -bloom-compactor.ring.tokens-file-path
* @default ""
*/
tokens_file_path?: string;
/**
* True to enable zone-awareness and replicate blocks across different
* availability zones.
* CLI flag: -bloom-compactor.ring.zone-awareness-enabled
* @default true
*/
zone_awareness_enabled?: boolean;
/**
* Number of tokens to use in the ring per compactor. Higher number of tokens
* will result in more and smaller files (metas and blocks.)
* CLI flag: -bloom-compactor.ring.num-tokens
* @default 10
*/
num_tokens?: int;
/**
* Instance ID to register in the ring.
* CLI flag: -bloom-compactor.ring.instance-id
* @default "<hostname>"
*/
instance_id?: string;
/**
* Name of network interface to read address from.
* CLI flag: -bloom-compactor.ring.instance-interface-names
* @default "[<private network interfaces>]"
*/
instance_interface_names?: string[];
/**
* Port to advertise in the ring (defaults to server.grpc-listen-port).
* CLI flag: -bloom-compactor.ring.instance-port
* @default 0
*/
instance_port?: int;
/**
* IP address to advertise in the ring.
* CLI flag: -bloom-compactor.ring.instance-addr
* @default ""
*/
instance_addr?: string;
/**
* The availability zone where this instance is running. Required if
* zone-awareness is enabled.
* CLI flag: -bloom-compactor.ring.instance-availability-zone
* @default ""
*/
instance_availability_zone?: string;
/**
* Enable using a IPv6 instance address.
* CLI flag: -bloom-compactor.ring.instance-enable-ipv6
* @default true
*/
instance_enable_ipv6?: boolean;
};
/**
* Flag to enable or disable the usage of the bloom-compactor component.
* CLI flag: -bloom-compactor.enabled
* @default true
*/
enabled?: boolean;
/**
* Interval at which to re-run the compaction operation.
* CLI flag: -bloom-compactor.compaction-interval
* @default "10m"
*/
compaction_interval?: duration;
/**
* Newest day-table offset (from today, inclusive) to compact. Increase to lower
* cost by not re-writing data to object storage too frequently since recent data
* changes more often at the cost of not having blooms available as quickly.
* CLI flag: -bloom-compactor.min-table-offset
* @default 1
*/
min_table_offset?: int;
/**
* Oldest day-table offset (from today, inclusive) to compact. This can be used
* to lower cost by not trying to compact older data which doesn't change. This
* can be optimized by aligning it with the maximum `reject_old_samples_max_age`
* setting of any tenant.
* CLI flag: -bloom-compactor.max-table-offset
* @default 2
*/
max_table_offset?: int;
/**
* Number of workers to run in parallel for compaction.
* CLI flag: -bloom-compactor.worker-parallelism
* @default 1
*/
worker_parallelism?: int;
/**
* Minimum backoff time between retries.
* CLI flag: -bloom-compactor.compaction-retries-min-backoff
* @default "10s"
*/
compaction_retries_min_backoff?: duration;
/**
* Maximum backoff time between retries.
* CLI flag: -bloom-compactor.compaction-retries-max-backoff
* @default "1m"
*/
compaction_retries_max_backoff?: duration;
/**
* Number of retries to perform when compaction fails.
* CLI flag: -bloom-compactor.compaction-retries
* @default 3
*/
compaction_retries?: int;
/**
* Maximum number of tables to compact in parallel. While increasing this value,
* please make sure compactor has enough disk space allocated to be able to store
* and compact as many tables.
* CLI flag: -bloom-compactor.max-compaction-parallelism
* @default 1
*/
max_compaction_parallelism?: int;
retention?: {
/**
* Enable bloom retention.
* CLI flag: -bloom-compactor.retention.enabled
* @default true
*/
enabled?: boolean;
/**
* Max lookback days for retention.
* CLI flag: -bloom-compactor.retention.max-lookback-days
* @default 365
*/
max_lookback_days?: int;
};
};
/**
* Experimental: The `bloom_gateway` block configures the Loki bloom gateway server, responsible for serving queries for filtering chunks based on filter expressions.
*/
export type bloom_gateway = {
/**
* Flag to enable or disable the bloom gateway component globally.
* CLI flag: -bloom-gateway.enabled
* @default true
*/
enabled?: boolean;
client?: {
/**
* Configures the behavior of the connection pool.
*/
pool_config?: {
/**
* How frequently to clean up clients for servers that have gone away or are
* unhealthy.
* CLI flag: -bloom-gateway-client.pool.check-interval
* @default "10s"
*/
check_interval?: duration;
/**
* Run a health check on each server during periodic cleanup.
* CLI flag: -bloom-gateway-client.pool.enable-health-check
* @default true
*/
enable_health_check?: boolean;
/**
* Timeout for the health check if health check is enabled.
* CLI flag: -bloom-gateway-client.pool.health-check-timeout
* @default "1s"
*/
health_check_timeout?: duration;
};
/**
* The grpc_client block configures the gRPC client used to communicate between
* a client and server component in Loki.
* The CLI flags prefix for this block configuration is:
* bloom-gateway-client.grpc
*/
grpc_client_config?: grpc_client;
results_cache?: {
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is:
* bloom-gateway-client.cache
*/
cache?: cache_config;
/**
* Use compression in cache. The default is an empty value '', which disables
* compression. Supported values are: 'snappy' and ''.
* CLI flag: -bloom-gateway-client.cache.compression
* @default ""
*/
compression?: string;
};
/**
* Flag to control whether to cache bloom gateway client requests/responses.
* CLI flag: -bloom-gateway-client.cache_results
* @default true
*/
cache_results?: boolean;
/**
* Comma separated addresses list in DNS Service Discovery format:
* https://grafana.com/docs/mimir/latest/configure/about-dns-service-discovery/#supported-discovery-modes
* CLI flag: -bloom-gateway-client.addresses
* @default ""
*/
addresses?: string;
};
/**
* Number of workers to use for filtering chunks concurrently. Usually set to 1x
* number of CPU cores.
* CLI flag: -bloom-gateway.worker-concurrency
* @default 4
*/
worker_concurrency?: int;
/**
* Number of blocks processed concurrently on a single worker. Usually set to 2x
* number of CPU cores.
* CLI flag: -bloom-gateway.block-query-concurrency
* @default 8
*/
block_query_concurrency?: int;
/**
* Maximum number of outstanding tasks per tenant.
* CLI flag: -bloom-gateway.max-outstanding-per-tenant
* @default 1024
*/
max_outstanding_per_tenant?: int;
/**
* How many tasks are multiplexed at once.
* CLI flag: -bloom-gateway.num-multiplex-tasks
* @default 512
*/
num_multiplex_tasks?: int;
};
/**
* The `bos_storage_config` block configures the connection to Baidu Object Storage (BOS) object storage backend. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `common.storage`
* - `ruler.storage`
*
* &nbsp;
*/
export type bos_storage_config = {
/**
* Name of BOS bucket.
* CLI flag: -<prefix>.bos.bucket-name
* @default ""
*/
bucket_name?: string;
/**
* BOS endpoint to connect to.
* CLI flag: -<prefix>.bos.endpoint
* @default "bj.bcebos.com"
*/
endpoint?: string;
/**
* Baidu Cloud Engine (BCE) Access Key ID.
* CLI flag: -<prefix>.bos.access-key-id
* @default ""
*/
access_key_id?: string;
/**
* Baidu Cloud Engine (BCE) Secret Access Key.
* CLI flag: -<prefix>.bos.secret-access-key
* @default ""
*/
secret_access_key?: string;
};
/**
* The `cache_config` block configures the cache backend for a specific Loki component. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `bloom-gateway-client.cache`
* - `bloom.metas-cache`
* - `frontend`
* - `frontend.index-stats-results-cache`
* - `frontend.instant-metric-results-cache`
* - `frontend.label-results-cache`
* - `frontend.series-results-cache`
* - `frontend.volume-results-cache`
* - `store.chunks-cache`
* - `store.chunks-cache-l2`
* - `store.index-cache-read`
* - `store.index-cache-write`
*
* &nbsp;
*/
export type cache_config = {
/**
* The default validity of entries for caches unless overridden.
* CLI flag: -<prefix>.default-validity
* @default "1h"
*/
default_validity?: duration;
background?: {
/**
* At what concurrency to write back to cache.
* CLI flag: -<prefix>.background.write-back-concurrency
* @default 1
*/
writeback_goroutines?: int;
/**
* How many key batches to buffer for background write-back. Default is large
* to prefer size based limiting.
* CLI flag: -<prefix>.background.write-back-buffer
* @default 500000
*/
writeback_buffer?: int;
/**
* Size limit in bytes for background write-back.
* CLI flag: -<prefix>.background.write-back-size-limit
* @default "500MB"
*/
writeback_size_limit?: int;
};
memcached?: {
/**
* How long keys stay in the memcache.
* CLI flag: -<prefix>.memcached.expiration
* @default "0s"
*/
expiration?: duration;
/**
* How many keys to fetch in each batch.
* CLI flag: -<prefix>.memcached.batchsize
* @default 4
*/
batch_size?: int;
/**
* Maximum active requests to memcache.
* CLI flag: -<prefix>.memcached.parallelism
* @default 5
*/
parallelism?: int;
};
memcached_client?: {
/**
* Hostname for memcached service to use. If empty and if addresses is unset,
* no memcached will be used.
* CLI flag: -<prefix>.memcached.hostname
* @default ""
*/
host?: string;
/**
* SRV service used to discover memcache servers.
* CLI flag: -<prefix>.memcached.service
* @default "memcached"
*/
service?: string;
/**
* Comma separated addresses list in DNS Service Discovery format:
* https://grafana.com/docs/mimir/latest/configure/about-dns-service-discovery/#supported-discovery-modes
* CLI flag: -<prefix>.memcached.addresses
* @default ""
*/
addresses?: string;
/**
* Maximum time to wait before giving up on memcached requests.
* CLI flag: -<prefix>.memcached.timeout
* @default "100ms"
*/
timeout?: duration;
/**
* Maximum number of idle connections in pool.
* CLI flag: -<prefix>.memcached.max-idle-conns
* @default 16
*/
max_idle_conns?: int;
/**
* The maximum size of an item stored in memcached. Bigger items are not
* stored. If set to 0, no maximum size is enforced.
* CLI flag: -<prefix>.memcached.max-item-size
* @default 0
*/
max_item_size?: int;
/**
* Period with which to poll DNS for memcache servers.
* CLI flag: -<prefix>.memcached.update-interval
* @default "1m"
*/
update_interval?: duration;
/**
* Use consistent hashing to distribute to memcache servers.
* CLI flag: -<prefix>.memcached.consistent-hash
* @default true
*/
consistent_hash?: boolean;
/**
* Trip circuit-breaker after this number of consecutive dial failures (if zero
* then circuit-breaker is disabled).
* CLI flag: -<prefix>.memcached.circuit-breaker-consecutive-failures
* @default 10
*/
circuit_breaker_consecutive_failures?: int;
/**
* Duration circuit-breaker remains open after tripping (if zero then 60
* seconds is used).
* CLI flag: -<prefix>.memcached.circuit-breaker-timeout
* @default "10s"
*/
circuit_breaker_timeout?: duration;
/**
* Reset circuit-breaker counts after this long (if zero then never reset).
* CLI flag: -<prefix>.memcached.circuit-breaker-interval
* @default "10s"
*/
circuit_breaker_interval?: duration;
/**
* Enable connecting to Memcached with TLS.
* CLI flag: -<prefix>.memcached.tls-enabled
* @default true
*/
tls_enabled?: boolean;
/**
* Path to the client certificate, which will be used for authenticating with
* the server. Also requires the key path to be configured.
* CLI flag: -<prefix>.memcached.tls-cert-path
* @default ""
*/
tls_cert_path?: string;
/**
* Path to the key for the client certificate. Also requires the client
* certificate to be configured.
* CLI flag: -<prefix>.memcached.tls-key-path
* @default ""
*/
tls_key_path?: string;
/**
* Path to the CA certificates to validate server certificate against. If not
* set, the host's root CA certificates are used.
* CLI flag: -<prefix>.memcached.tls-ca-path
* @default ""
*/
tls_ca_path?: string;
/**
* Override the expected name on the server certificate.
* CLI flag: -<prefix>.memcached.tls-server-name
* @default ""
*/
tls_server_name?: string;
/**
* Skip validating server certificate.
* CLI flag: -<prefix>.memcached.tls-insecure-skip-verify
* @default true
*/
tls_insecure_skip_verify?: boolean;
/**
* Override the default cipher suite list (separated by commas). Allowed
* values:
*
* Secure Ciphers:
* - TLS_AES_128_GCM_SHA256
* - TLS_AES_256_GCM_SHA384
* - TLS_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
*
* Insecure Ciphers:
* - TLS_RSA_WITH_RC4_128_SHA
* - TLS_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA
* - TLS_RSA_WITH_AES_256_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA256
* - TLS_RSA_WITH_AES_128_GCM_SHA256
* - TLS_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* CLI flag: -<prefix>.memcached.tls-cipher-suites
* @default ""
*/
tls_cipher_suites?: string;
/**
* Override the default minimum TLS version. Allowed values: VersionTLS10,
* VersionTLS11, VersionTLS12, VersionTLS13
* CLI flag: -<prefix>.memcached.tls-min-version
* @default ""
*/
tls_min_version?: string;
};
redis?: {
/**
* Redis Server or Cluster configuration endpoint to use for caching. A
* comma-separated list of endpoints for Redis Cluster or Redis Sentinel. If
* empty, no redis will be used.
* CLI flag: -<prefix>.redis.endpoint
* @default ""
*/
endpoint?: string;
/**
* Redis Sentinel master name. An empty string for Redis Server or Redis
* Cluster.
* CLI flag: -<prefix>.redis.master-name
* @default ""
*/
master_name?: string;
/**
* Maximum time to wait before giving up on redis requests.
* CLI flag: -<prefix>.redis.timeout
* @default "500ms"
*/
timeout?: duration;
/**
* How long keys stay in the redis.
* CLI flag: -<prefix>.redis.expiration
* @default "0s"
*/
expiration?: duration;
/**
* Database index.
* CLI flag: -<prefix>.redis.db
* @default 0
*/
db?: int;
/**
* Maximum number of connections in the pool.
* CLI flag: -<prefix>.redis.pool-size
* @default 0
*/
pool_size?: int;
/**
* Username to use when connecting to redis.
* CLI flag: -<prefix>.redis.username
* @default ""
*/
username?: string;
/**
* Password to use when connecting to redis.
* CLI flag: -<prefix>.redis.password
* @default ""
*/
password?: string;
/**
* Enable connecting to redis with TLS.
* CLI flag: -<prefix>.redis.tls-enabled
* @default true
*/
tls_enabled?: boolean;
/**
* Skip validating server certificate.
* CLI flag: -<prefix>.redis.tls-insecure-skip-verify
* @default true
*/
tls_insecure_skip_verify?: boolean;
/**
* Close connections after remaining idle for this duration. If the value is
* zero, then idle connections are not closed.
* CLI flag: -<prefix>.redis.idle-timeout
* @default "0s"
*/
idle_timeout?: duration;
/**
* Close connections older than this duration. If the value is zero, then the
* pool does not close connections based on age.
* CLI flag: -<prefix>.redis.max-connection-age
* @default "0s"
*/
max_connection_age?: duration;
/**
* By default, the Redis client only reads from the master node. Enabling this
* option can lower pressure on the master node by randomly routing read-only
* commands to the master and any available replicas.
* CLI flag: -<prefix>.redis.route-randomly
* @default true
*/
route_randomly?: boolean;
};
embedded_cache?: {
/**
* Whether embedded cache is enabled.
* CLI flag: -<prefix>.embedded-cache.enabled
* @default true
*/
enabled?: boolean;
/**
* Maximum memory size of the cache in MB.
* CLI flag: -<prefix>.embedded-cache.max-size-mb
* @default 100
*/
max_size_mb?: int;
/**
* Maximum number of entries in the cache.
* CLI flag: -<prefix>.embedded-cache.max-size-items
* @default 0
*/
max_size_items?: int;
/**
* The time to live for items in the cache before they get purged.
* CLI flag: -<prefix>.embedded-cache.ttl
* @default "1h"
*/
ttl?: duration;
};
};
/**
* The `chunk_store_config` block configures how chunks will be cached and how long to wait before saving them to the backing store.
*/
export type chunk_store_config = {
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is: store.chunks-cache
*/
chunk_cache_config?: cache_config;
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is: store.chunks-cache-l2
*/
chunk_cache_config_l2?: cache_config;
/**
* Write dedupe cache is deprecated along with legacy index types (aws,
* aws-dynamo, bigtable, bigtable-hashed, cassandra, gcp, gcp-columnkey,
* grpc-store).
* Consider using TSDB index which does not require a write dedupe cache.
* The CLI flags prefix for this block configuration is: store.index-cache-write
*/
write_dedupe_cache_config?: cache_config;
/**
* Chunks will be handed off to the L2 cache after this duration. 0 to disable L2
* cache.
* CLI flag: -store.chunks-cache-l2.handoff
* @default "0s"
*/
l2_chunk_cache_handoff?: duration;
/**
* Cache index entries older than this period. 0 to disable.
* CLI flag: -store.cache-lookups-older-than
* @default "0s"
*/
cache_lookups_older_than?: duration;
};
/**
* Common configuration to be shared between multiple modules. If a more specific configuration is given in other sections, the related configuration within this section will be ignored.
*/
export type common = {
/** @default "" **/
path_prefix?: string;
storage?: {
/**
* The s3_storage_config block configures the connection to Amazon S3 object
* storage backend.
* The CLI flags prefix for this block configuration is: common
*/
s3?: s3_storage_config;
/**
* The gcs_storage_config block configures the connection to Google Cloud
* Storage object storage backend.
* The CLI flags prefix for this block configuration is: common.storage
*/
gcs?: gcs_storage_config;
/**
* The azure_storage_config block configures the connection to Azure object
* storage backend.
* The CLI flags prefix for this block configuration is: common.storage
*/
azure?: azure_storage_config;
/**
* The alibabacloud_storage_config block configures the connection to Alibaba
* Cloud Storage object storage backend.
*/
alibabacloud?: alibabacloud_storage_config;
/**
* The bos_storage_config block configures the connection to Baidu Object
* Storage (BOS) object storage backend.
* The CLI flags prefix for this block configuration is: common.storage
*/
bos?: bos_storage_config;
/**
* The swift_storage_config block configures the connection to OpenStack Object
* Storage (Swift) object storage backend.
* The CLI flags prefix for this block configuration is: common.storage
*/
swift?: swift_storage_config;
filesystem?: {
/**
* Directory to store chunks in.
* CLI flag: -common.storage.filesystem.chunk-directory
* @default ""
*/
chunks_directory?: string;
/**
* Directory to store rules in.
* CLI flag: -common.storage.filesystem.rules-directory
* @default ""
*/
rules_directory?: string;
};
hedging?: {
/**
* If set to a non-zero value a second request will be issued at the provided
* duration. Default is 0 (disabled)
* CLI flag: -common.storage.hedge-requests-at
* @default "0s"
*/
at?: duration;
/**
* The maximum of hedge requests allowed.
* CLI flag: -common.storage.hedge-requests-up-to
* @default 2
*/
up_to?: int;
/**
* The maximum of hedge requests allowed per seconds.
* CLI flag: -common.storage.hedge-max-per-second
* @default 5
*/
max_per_second?: int;
};
/**
* The cos_storage_config block configures the connection to IBM Cloud Object
* Storage (COS) backend.
* The CLI flags prefix for this block configuration is: common.storage
*/
cos?: cos_storage_config;
congestion_control?: {
/**
* Use storage congestion control (default: disabled).
* CLI flag: -common.storage.congestion-control.enabled
* @default true
*/
enabled?: boolean;
controller?: {
/**
* Congestion control strategy to use (default: none, options: 'aimd').
* CLI flag: -common.storage.congestion-control.strategy
* @default ""
*/
strategy?: string;
aimd?: {
/**
* AIMD starting throughput window size: how many requests can be sent
* per second (default: 2000).
* CLI flag: -common.storage.congestion-control.strategy.aimd.start
* @default 2000
*/
start?: int;
/**
* AIMD maximum throughput window size: upper limit of requests sent per
* second (default: 10000).
* CLI flag: -common.storage.congestion-control.strategy.aimd.upper-bound
* @default 10000
*/
upper_bound?: int;
/**
* AIMD backoff factor when upstream service is throttled to decrease
* number of requests sent per second (default: 0.5).
* CLI flag: -common.storage.congestion-control.strategy.aimd.backoff-factor
* @default 0.5
*/
backoff_factor?: float;
};
};
retry?: {
/**
* Congestion control retry strategy to use (default: none, options:
* 'limited').
* CLI flag: -common.storage.congestion-control.retry.strategy
* @default ""
*/
strategy?: string;
/**
* Maximum number of retries allowed.
* CLI flag: -common.storage.congestion-control.retry.strategy.limited.limit
* @default 2
*/
limit?: int;
};
hedging?: {
config?: {
at?: duration;
up_to?: int;
max_per_second?: int;
};
/**
* Congestion control hedge strategy to use (default: none, options:
* 'limited').
* CLI flag: -common.storage.congestion-control.hedge.strategy
* @default ""
*/
strategy?: string;
};
};
};
persist_tokens?: boolean;
replication_factor?: int;
ring?: {
kvstore?: {
/**
* Backend storage to use for the ring. Supported values are: consul, etcd,
* inmemory, memberlist, multi.
* CLI flag: -common.storage.ring.store
* @default "consul"
*/
store?: string;
/**
* The prefix for the keys in the store. Should end with a /.
* CLI flag: -common.storage.ring.prefix
* @default "collectors/"
*/
prefix?: string;
/**
* Configuration for a Consul client. Only applies if the selected kvstore is
* consul.
* The CLI flags prefix for this block configuration is: common.storage.ring
*/
consul?: consul;
/**
* Configuration for an ETCD v3 client. Only applies if the selected kvstore
* is etcd.
* The CLI flags prefix for this block configuration is: common.storage.ring
*/
etcd?: etcd;
multi?: {
/**
* Primary backend storage used by multi-client.
* CLI flag: -common.storage.ring.multi.primary
* @default ""
*/
primary?: string;
/**
* Secondary backend storage used by multi-client.
* CLI flag: -common.storage.ring.multi.secondary
* @default ""
*/
secondary?: string;
/**
* Mirror writes to secondary store.
* CLI flag: -common.storage.ring.multi.mirror-enabled
* @default true
*/
mirror_enabled?: boolean;
/**
* Timeout for storing value to secondary store.
* CLI flag: -common.storage.ring.multi.mirror-timeout
* @default "2s"
*/
mirror_timeout?: duration;
};
};
/**
* Period at which to heartbeat to the ring. 0 = disabled.
* CLI flag: -common.storage.ring.heartbeat-period
* @default "15s"
*/
heartbeat_period?: duration;
/**
* The heartbeat timeout after which compactors are considered unhealthy within
* the ring. 0 = never (timeout disabled).
* CLI flag: -common.storage.ring.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* File path where tokens are stored. If empty, tokens are not stored at
* shutdown and restored at startup.
* CLI flag: -common.storage.ring.tokens-file-path
* @default ""
*/
tokens_file_path?: string;
/**
* True to enable zone-awareness and replicate blocks across different
* availability zones.
* CLI flag: -common.storage.ring.zone-awareness-enabled
* @default true
*/
zone_awareness_enabled?: boolean;
/**
* Number of tokens to own in the ring.
* CLI flag: -common.storage.ring.num-tokens
* @default 128
*/
num_tokens?: int;
/**
* Factor for data replication.
* CLI flag: -common.storage.ring.replication-factor
* @default 3
*/
replication_factor?: int;
/**
* Instance ID to register in the ring.
* CLI flag: -common.storage.ring.instance-id
* @default "<hostname>"
*/
instance_id?: string;
/**
* Name of network interface to read address from.
* CLI flag: -common.storage.ring.instance-interface-names
* @default "[<private network interfaces>]"
*/
instance_interface_names?: string[];
/**
* Port to advertise in the ring (defaults to server.grpc-listen-port).
* CLI flag: -common.storage.ring.instance-port
* @default 0
*/
instance_port?: int;
/**
* IP address to advertise in the ring.
* CLI flag: -common.storage.ring.instance-addr
* @default ""
*/
instance_addr?: string;
/**
* The availability zone where this instance is running. Required if
* zone-awareness is enabled.
* CLI flag: -common.storage.ring.instance-availability-zone
* @default ""
*/
instance_availability_zone?: string;
/**
* Enable using a IPv6 instance address.
* CLI flag: -common.storage.ring.instance-enable-ipv6
* @default true
*/
instance_enable_ipv6?: boolean;
};
/** @default "[<private network interfaces>]" **/
instance_interface_names?: string[];
/** @default "" **/
instance_addr?: string;
/**
* the http address of the compactor in the form http://host:port
* CLI flag: -common.compactor-address
* @default ""
*/
compactor_address?: string;
/**
* the grpc address of the compactor in the form host:port
* CLI flag: -common.compactor-grpc-address
* @default ""
*/
compactor_grpc_address?: string;
};
/**
* The `compactor` block configures the compactor component, which compacts index shards for performance.
*/
export type compactor = {
/**
* Directory where files can be downloaded for compaction.
* CLI flag: -compactor.working-directory
* @default ""
*/
working_directory?: string;
/**
* Interval at which to re-run the compaction operation.
* CLI flag: -compactor.compaction-interval
* @default "10m"
*/
compaction_interval?: duration;
/**
* Interval at which to apply/enforce retention. 0 means run at same interval as
* compaction. If non-zero, it should always be a multiple of compaction
* interval.
* CLI flag: -compactor.apply-retention-interval
* @default "0s"
*/
apply_retention_interval?: duration;
/**
* Activate custom (per-stream,per-tenant) retention.
* CLI flag: -compactor.retention-enabled
* @default true
*/
retention_enabled?: boolean;
/**
* Delay after which chunks will be fully deleted during retention.
* CLI flag: -compactor.retention-delete-delay
* @default "2h"
*/
retention_delete_delay?: duration;
/**
* The total amount of worker to use to delete chunks.
* CLI flag: -compactor.retention-delete-worker-count
* @default 150
*/
retention_delete_worker_count?: int;
/**
* The maximum amount of time to spend running retention and deletion on any
* given table in the index.
* CLI flag: -compactor.retention-table-timeout
* @default "0s"
*/
retention_table_timeout?: duration;
/**
* Store used for managing delete requests.
* CLI flag: -compactor.delete-request-store
* @default ""
*/
delete_request_store?: string;
/**
* Path prefix for storing delete requests.
* CLI flag: -compactor.delete-request-store.key-prefix
* @default "index/"
*/
delete_request_store_key_prefix?: string;
/**
* The max number of delete requests to run per compaction cycle.
* CLI flag: -compactor.delete-batch-size
* @default 70
*/
delete_batch_size?: int;
/**
* Allow cancellation of delete request until duration after they are created.
* Data would be deleted only after delete requests have been older than this
* duration. Ideally this should be set to at least 24h.
* CLI flag: -compactor.delete-request-cancel-period
* @default "24h"
*/
delete_request_cancel_period?: duration;
/**
* Constrain the size of any single delete request with line filters. When a
* delete request > delete_max_interval is input, the request is sharded into
* smaller requests of no more than delete_max_interval
* CLI flag: -compactor.delete-max-interval
* @default "24h"
*/
delete_max_interval?: duration;
/**
* Maximum number of tables to compact in parallel. While increasing this value,
* please make sure compactor has enough disk space allocated to be able to store
* and compact as many tables.
* CLI flag: -compactor.max-compaction-parallelism
* @default 1
*/
max_compaction_parallelism?: int;
/**
* Number of upload/remove operations to execute in parallel when finalizing a
* compaction. NOTE: This setting is per compaction operation, which can be
* executed in parallel. The upper bound on the number of concurrent uploads is
* upload_parallelism * max_compaction_parallelism.
* CLI flag: -compactor.upload-parallelism
* @default 10
*/
upload_parallelism?: int;
/**
* The hash ring configuration used by compactors to elect a single instance for
* running compactions. The CLI flags prefix for this block config is:
* compactor.ring
*/
compactor_ring?: {
kvstore?: {
/**
* Backend storage to use for the ring. Supported values are: consul, etcd,
* inmemory, memberlist, multi.
* CLI flag: -compactor.ring.store
* @default "consul"
*/
store?: string;
/**
* The prefix for the keys in the store. Should end with a /.
* CLI flag: -compactor.ring.prefix
* @default "collectors/"
*/
prefix?: string;
/**
* Configuration for a Consul client. Only applies if the selected kvstore is
* consul.
* The CLI flags prefix for this block configuration is: compactor.ring
*/
consul?: consul;
/**
* Configuration for an ETCD v3 client. Only applies if the selected kvstore
* is etcd.
* The CLI flags prefix for this block configuration is: compactor.ring
*/
etcd?: etcd;
multi?: {
/**
* Primary backend storage used by multi-client.
* CLI flag: -compactor.ring.multi.primary
* @default ""
*/
primary?: string;
/**
* Secondary backend storage used by multi-client.
* CLI flag: -compactor.ring.multi.secondary
* @default ""
*/
secondary?: string;
/**
* Mirror writes to secondary store.
* CLI flag: -compactor.ring.multi.mirror-enabled
* @default true
*/
mirror_enabled?: boolean;
/**
* Timeout for storing value to secondary store.
* CLI flag: -compactor.ring.multi.mirror-timeout
* @default "2s"
*/
mirror_timeout?: duration;
};
};
/**
* Period at which to heartbeat to the ring. 0 = disabled.
* CLI flag: -compactor.ring.heartbeat-period
* @default "15s"
*/
heartbeat_period?: duration;
/**
* The heartbeat timeout after which compactors are considered unhealthy within
* the ring. 0 = never (timeout disabled).
* CLI flag: -compactor.ring.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* File path where tokens are stored. If empty, tokens are not stored at
* shutdown and restored at startup.
* CLI flag: -compactor.ring.tokens-file-path
* @default ""
*/
tokens_file_path?: string;
/**
* True to enable zone-awareness and replicate blocks across different
* availability zones.
* CLI flag: -compactor.ring.zone-awareness-enabled
* @default true
*/
zone_awareness_enabled?: boolean;
/**
* Instance ID to register in the ring.
* CLI flag: -compactor.ring.instance-id
* @default "<hostname>"
*/
instance_id?: string;
/**
* Name of network interface to read address from.
* CLI flag: -compactor.ring.instance-interface-names
* @default "[<private network interfaces>]"
*/
instance_interface_names?: string[];
/**
* Port to advertise in the ring (defaults to server.grpc-listen-port).
* CLI flag: -compactor.ring.instance-port
* @default 0
*/
instance_port?: int;
/**
* IP address to advertise in the ring.
* CLI flag: -compactor.ring.instance-addr
* @default ""
*/
instance_addr?: string;
/**
* The availability zone where this instance is running. Required if
* zone-awareness is enabled.
* CLI flag: -compactor.ring.instance-availability-zone
* @default ""
*/
instance_availability_zone?: string;
/**
* Enable using a IPv6 instance address.
* CLI flag: -compactor.ring.instance-enable-ipv6
* @default true
*/
instance_enable_ipv6?: boolean;
};
/**
* Number of tables that compactor will try to compact. Newer tables are chosen
* when this is less than the number of tables available.
* CLI flag: -compactor.tables-to-compact
* @default 0
*/
tables_to_compact?: int;
/**
* Do not compact N latest tables. Together with -compactor.run-once and
* -compactor.tables-to-compact, this is useful when clearing compactor backlogs.
* CLI flag: -compactor.skip-latest-n-tables
* @default 0
*/
skip_latest_n_tables?: int;
};
/**
* Configuration for a Consul client. Only applies if the selected kvstore is `consul`. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `bloom-compactor.ring`
* - `common.storage.ring`
* - `compactor.ring`
* - `distributor.ring`
* - `index-gateway.ring`
* - `pattern-ingester`
* - `query-scheduler.ring`
* - `ruler.ring`
*
* &nbsp;
*/
export type consul = {
/**
* Hostname and port of Consul.
* CLI flag: -<prefix>.consul.hostname
* @default "localhost:8500"
*/
host?: string;
/**
* ACL Token used to interact with Consul.
* CLI flag: -<prefix>.consul.acl-token
* @default ""
*/
acl_token?: string;
/**
* HTTP timeout when talking to Consul
* CLI flag: -<prefix>.consul.client-timeout
* @default "20s"
*/
http_client_timeout?: duration;
/**
* Enable consistent reads to Consul.
* CLI flag: -<prefix>.consul.consistent-reads
* @default true
*/
consistent_reads?: boolean;
/**
* Rate limit when watching key or prefix in Consul, in requests per second. 0
* disables the rate limit.
* CLI flag: -<prefix>.consul.watch-rate-limit
* @default 1
*/
watch_rate_limit?: float;
/**
* Burst size used in rate limit. Values less than 1 are treated as 1.
* CLI flag: -<prefix>.consul.watch-burst-size
* @default 1
*/
watch_burst_size?: int;
/**
* Maximum duration to wait before retrying a Compare And Swap (CAS) operation.
* CLI flag: -<prefix>.consul.cas-retry-delay
* @default "1s"
*/
cas_retry_delay?: duration;
};
/**
* The `cos_storage_config` block configures the connection to IBM Cloud Object Storage (COS) backend. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `common.storage`
* - `ruler.storage`
*
* &nbsp;
*/
export type cos_storage_config = {
/**
* Set this to `true` to force the request to use path-style addressing.
* CLI flag: -<prefix>.cos.force-path-style
* @default true
*/
forcepathstyle?: boolean;
/**
* Comma separated list of bucket names to evenly distribute chunks over.
* CLI flag: -<prefix>.cos.buckets
* @default ""
*/
bucketnames?: string;
/**
* COS Endpoint to connect to.
* CLI flag: -<prefix>.cos.endpoint
* @default ""
*/
endpoint?: string;
/**
* COS region to use.
* CLI flag: -<prefix>.cos.region
* @default ""
*/
region?: string;
/**
* COS HMAC Access Key ID.
* CLI flag: -<prefix>.cos.access-key-id
* @default ""
*/
access_key_id?: string;
/**
* COS HMAC Secret Access Key.
* CLI flag: -<prefix>.cos.secret-access-key
* @default ""
*/
secret_access_key?: string;
http_config?: {
/**
* The maximum amount of time an idle connection will be held open.
* CLI flag: -<prefix>.cos.http.idle-conn-timeout
* @default "1m30s"
*/
idle_conn_timeout?: duration;
/**
* If non-zero, specifies the amount of time to wait for a server's response
* headers after fully writing the request.
* CLI flag: -<prefix>.cos.http.response-header-timeout
* @default "0s"
*/
response_header_timeout?: duration;
};
/**
* Configures back off when cos get Object.
*/
backoff_config?: {
/**
* Minimum backoff time when cos get Object.
* CLI flag: -<prefix>.cos.min-backoff
* @default "100ms"
*/
min_period?: duration;
/**
* Maximum backoff time when cos get Object.
* CLI flag: -<prefix>.cos.max-backoff
* @default "3s"
*/
max_period?: duration;
/**
* Maximum number of times to retry when cos get Object.
* CLI flag: -<prefix>.cos.max-retries
* @default 5
*/
max_retries?: int;
};
/**
* IAM API key to access COS.
* CLI flag: -<prefix>.cos.api-key
* @default ""
*/
api_key?: string;
/**
* COS service instance id to use.
* CLI flag: -<prefix>.cos.service-instance-id
* @default ""
*/
service_instance_id?: string;
/**
* IAM Auth Endpoint for authentication.
* CLI flag: -<prefix>.cos.auth-endpoint
* @default "https://iam.cloud.ibm.com/identity/token"
*/
auth_endpoint?: string;
/**
* Compute resource token file path.
* CLI flag: -<prefix>.cos.cr-token-file-path
* @default ""
*/
cr_token_file_path?: string;
/**
* Name of the trusted profile.
* CLI flag: -<prefix>.cos.trusted-profile-name
* @default ""
*/
trusted_profile_name?: string;
/**
* ID of the trusted profile.
* CLI flag: -<prefix>.cos.trusted-profile-id
* @default ""
*/
trusted_profile_id?: string;
};
/**
* Configures the `distributor`.
*/
export type distributor = {
ring?: {
kvstore?: {
/**
* Backend storage to use for the ring. Supported values are: consul, etcd,
* inmemory, memberlist, multi.
* CLI flag: -distributor.ring.store
* @default "consul"
*/
store?: string;
/**
* The prefix for the keys in the store. Should end with a /.
* CLI flag: -distributor.ring.prefix
* @default "collectors/"
*/
prefix?: string;
/**
* Configuration for a Consul client. Only applies if the selected kvstore is
* consul.
* The CLI flags prefix for this block configuration is: distributor.ring
*/
consul?: consul;
/**
* Configuration for an ETCD v3 client. Only applies if the selected kvstore
* is etcd.
* The CLI flags prefix for this block configuration is: distributor.ring
*/
etcd?: etcd;
multi?: {
/**
* Primary backend storage used by multi-client.
* CLI flag: -distributor.ring.multi.primary
* @default ""
*/
primary?: string;
/**
* Secondary backend storage used by multi-client.
* CLI flag: -distributor.ring.multi.secondary
* @default ""
*/
secondary?: string;
/**
* Mirror writes to secondary store.
* CLI flag: -distributor.ring.multi.mirror-enabled
* @default true
*/
mirror_enabled?: boolean;
/**
* Timeout for storing value to secondary store.
* CLI flag: -distributor.ring.multi.mirror-timeout
* @default "2s"
*/
mirror_timeout?: duration;
};
};
/**
* Period at which to heartbeat to the ring. 0 = disabled.
* CLI flag: -distributor.ring.heartbeat-period
* @default "5s"
*/
heartbeat_period?: duration;
/**
* The heartbeat timeout after which distributors are considered unhealthy
* within the ring. 0 = never (timeout disabled).
* CLI flag: -distributor.ring.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* Name of network interface to read address from.
* CLI flag: -distributor.ring.instance-interface-names
* @default "[<private network interfaces>]"
*/
instance_interface_names?: string[];
};
rate_store?: {
/**
* The max number of concurrent requests to make to ingester stream apis
* CLI flag: -distributor.rate-store.max-request-parallelism
* @default 200
*/
max_request_parallelism?: int;
/**
* The interval on which distributors will update current stream rates from
* ingesters
* CLI flag: -distributor.rate-store.stream-rate-update-interval
* @default "1s"
*/
stream_rate_update_interval?: duration;
/**
* Timeout for communication between distributors and any given ingester when
* updating rates
* CLI flag: -distributor.rate-store.ingester-request-timeout
* @default "500ms"
*/
ingester_request_timeout?: duration;
/**
* If enabled, detailed logs and spans will be emitted.
* CLI flag: -distributor.rate-store.debug
* @default true
*/
debug?: boolean;
};
/**
* Customize the logging of write failures.
*/
write_failures_logging?: {
/**
* Log volume allowed (per second). Default: 1KB.
* CLI flag: -distributor.write-failures-logging.rate
* @default "1KB"
*/
rate?: int;
/**
* Whether a insight=true key should be logged or not. Default: false.
* CLI flag: -distributor.write-failures-logging.add-insights-label
* @default true
*/
add_insights_label?: boolean;
};
otlp_config?: {
/**
* List of default otlp resource attributes to be picked as index labels
* CLI flag: -distributor.otlp.default_resource_attributes_as_index_labels
* @default "[service.name service.namespace service.instance.id deployment.environment cloud.region cloud.availability_zone k8s.cluster.name k8s.namespace.name k8s.pod.name k8s.container.name container.name k8s.replicaset.name k8s.deployment.name k8s.statefulset.name k8s.daemonset.name k8s.cronjob.name k8s.job.name]"
*/
default_resource_attributes_as_index_labels?: string[];
};
};
/**
* Configuration for an ETCD v3 client. Only applies if the selected kvstore is `etcd`. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `bloom-compactor.ring`
* - `common.storage.ring`
* - `compactor.ring`
* - `distributor.ring`
* - `index-gateway.ring`
* - `pattern-ingester`
* - `query-scheduler.ring`
* - `ruler.ring`
*
* &nbsp;
*/
export type etcd = {
/**
* The etcd endpoints to connect to.
* CLI flag: -<prefix>.etcd.endpoints
* @default "[]"
*/
endpoints?: string[];
/**
* The dial timeout for the etcd connection.
* CLI flag: -<prefix>.etcd.dial-timeout
* @default "10s"
*/
dial_timeout?: duration;
/**
* The maximum number of retries to do for failed ops.
* CLI flag: -<prefix>.etcd.max-retries
* @default 10
*/
max_retries?: int;
/**
* Enable TLS.
* CLI flag: -<prefix>.etcd.tls-enabled
* @default true
*/
tls_enabled?: boolean;
/**
* Path to the client certificate, which will be used for authenticating with the
* server. Also requires the key path to be configured.
* CLI flag: -<prefix>.etcd.tls-cert-path
* @default ""
*/
tls_cert_path?: string;
/**
* Path to the key for the client certificate. Also requires the client
* certificate to be configured.
* CLI flag: -<prefix>.etcd.tls-key-path
* @default ""
*/
tls_key_path?: string;
/**
* Path to the CA certificates to validate server certificate against. If not
* set, the host's root CA certificates are used.
* CLI flag: -<prefix>.etcd.tls-ca-path
* @default ""
*/
tls_ca_path?: string;
/**
* Override the expected name on the server certificate.
* CLI flag: -<prefix>.etcd.tls-server-name
* @default ""
*/
tls_server_name?: string;
/**
* Skip validating server certificate.
* CLI flag: -<prefix>.etcd.tls-insecure-skip-verify
* @default true
*/
tls_insecure_skip_verify?: boolean;
/**
* Override the default cipher suite list (separated by commas). Allowed values:
*
* Secure Ciphers:
* - TLS_AES_128_GCM_SHA256
* - TLS_AES_256_GCM_SHA384
* - TLS_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
*
* Insecure Ciphers:
* - TLS_RSA_WITH_RC4_128_SHA
* - TLS_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA
* - TLS_RSA_WITH_AES_256_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA256
* - TLS_RSA_WITH_AES_128_GCM_SHA256
* - TLS_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* CLI flag: -<prefix>.etcd.tls-cipher-suites
* @default ""
*/
tls_cipher_suites?: string;
/**
* Override the default minimum TLS version. Allowed values: VersionTLS10,
* VersionTLS11, VersionTLS12, VersionTLS13
* CLI flag: -<prefix>.etcd.tls-min-version
* @default ""
*/
tls_min_version?: string;
/**
* Etcd username.
* CLI flag: -<prefix>.etcd.username
* @default ""
*/
username?: string;
/**
* Etcd password.
* CLI flag: -<prefix>.etcd.password
* @default ""
*/
password?: string;
};
/**
* The `frontend` block configures the Loki query-frontend.
*/
export type frontend = {
/**
* Log queries that are slower than the specified duration. Set to 0 to disable.
* Set to < 0 to enable on all queries.
* CLI flag: -frontend.log-queries-longer-than
* @default "0s"
*/
log_queries_longer_than?: duration;
/**
* Comma-separated list of request header names to include in query logs. Applies
* to both query stats and slow queries logs.
* CLI flag: -frontend.log-query-request-headers
* @default ""
*/
log_query_request_headers?: string;
/**
* Max body size for downstream prometheus.
* CLI flag: -frontend.max-body-size
* @default 10485760
*/
max_body_size?: int;
/**
* True to enable query statistics tracking. When enabled, a message with some
* statistics is logged for every query.
* CLI flag: -frontend.query-stats-enabled
* @default true
*/
query_stats_enabled?: boolean;
/**
* Maximum number of outstanding requests per tenant per frontend; requests
* beyond this error with HTTP 429.
* CLI flag: -querier.max-outstanding-requests-per-tenant
* @default 2048
*/
max_outstanding_per_tenant?: int;
/**
* In the event a tenant is repeatedly sending queries that lead the querier to
* crash or be killed due to an out-of-memory error, the crashed querier will be
* disconnected from the query frontend and a new querier will be immediately
* assigned to the tenant’s shard. This invalidates the assumption that shuffle
* sharding can be used to reduce the impact on tenants. This option mitigates
* the impact by configuring a delay between when a querier disconnects because
* of a crash and when the crashed querier is actually removed from the tenant's
* shard.
* CLI flag: -query-frontend.querier-forget-delay
* @default "0s"
*/
querier_forget_delay?: duration;
/**
* DNS hostname used for finding query-schedulers.
* CLI flag: -frontend.scheduler-address
* @default ""
*/
scheduler_address?: string;
/**
* How often to resolve the scheduler-address, in order to look for new
* query-scheduler instances. Also used to determine how often to poll the
* scheduler-ring for addresses if the scheduler-ring is configured.
* CLI flag: -frontend.scheduler-dns-lookup-period
* @default "10s"
*/
scheduler_dns_lookup_period?: duration;
/**
* Number of concurrent workers forwarding queries to single query-scheduler.
* CLI flag: -frontend.scheduler-worker-concurrency
* @default 5
*/
scheduler_worker_concurrency?: int;
/**
* The grpc_client block configures the gRPC client used to communicate between a
* client and server component in Loki.
* The CLI flags prefix for this block configuration is:
* frontend.grpc-client-config
*/
grpc_client_config?: grpc_client;
/**
* Time to wait for inflight requests to finish before forcefully shutting down.
* This needs to be aligned with the query timeout and the graceful termination
* period of the process orchestrator.
* CLI flag: -frontend.graceful-shutdown-timeout
* @default "5m"
*/
graceful_shutdown_timeout?: duration;
/**
* Name of network interface to read address from. This address is sent to
* query-scheduler and querier, which uses it to send the query response back to
* query-frontend.
* CLI flag: -frontend.instance-interface-names
* @default "[<private network interfaces>]"
*/
instance_interface_names?: string[];
/**
* Defines the encoding for requests to and responses from the scheduler and
* querier. Can be 'json' or 'protobuf' (defaults to 'json').
* CLI flag: -frontend.encoding
* @default "json"
*/
encoding?: string;
/**
* Compress HTTP responses.
* CLI flag: -querier.compress-http-responses
* @default true
*/
compress_responses?: boolean;
/**
* URL of downstream Loki.
* CLI flag: -frontend.downstream-url
* @default ""
*/
downstream_url?: string;
/**
* URL of querier for tail proxy.
* CLI flag: -frontend.tail-proxy-url
* @default ""
*/
tail_proxy_url?: string;
/**
* The TLS configuration.
*/
tail_tls_config?: tls_config;
};
/**
* The `frontend_worker` configures the worker - running within the Loki querier - picking up and executing queries enqueued by the query-frontend.
*/
export type frontend_worker = {
/**
* Address of query frontend service, in host:port format. If
* -querier.scheduler-address is set as well, querier will use scheduler instead.
* Only one of -querier.frontend-address or -querier.scheduler-address can be
* set. If neither is set, queries are only received via HTTP endpoint.
* CLI flag: -querier.frontend-address
* @default ""
*/
frontend_address?: string;
/**
* Hostname (and port) of scheduler that querier will periodically resolve,
* connect to and receive queries from. Only one of -querier.frontend-address or
* -querier.scheduler-address can be set. If neither is set, queries are only
* received via HTTP endpoint.
* CLI flag: -querier.scheduler-address
* @default ""
*/
scheduler_address?: string;
/**
* How often to query DNS for query-frontend or query-scheduler address. Also
* used to determine how often to poll the scheduler-ring for addresses if the
* scheduler-ring is configured.
* CLI flag: -querier.dns-lookup-period
* @default "3s"
*/
dns_lookup_duration?: duration;
/**
* Querier ID, sent to frontend service to identify requests from the same
* querier. Defaults to hostname.
* CLI flag: -querier.id
* @default ""
*/
id?: string;
/**
* Configures the querier gRPC client used to communicate with the
* query-frontend. This can't be used in conjunction with 'grpc_client_config'.
* The CLI flags prefix for this block configuration is:
* querier.frontend-grpc-client
*/
query_frontend_grpc_client?: grpc_client;
/**
* Configures the querier gRPC client used to communicate with the query-frontend
* and with the query-scheduler. This can't be used in conjunction with
* 'query_frontend_grpc_client' or 'query_scheduler_grpc_client'.
* The CLI flags prefix for this block configuration is: querier.frontend-client
*/
grpc_client_config?: grpc_client;
/**
* Configures the querier gRPC client used to communicate with the
* query-scheduler. This can't be used in conjunction with 'grpc_client_config'.
* The CLI flags prefix for this block configuration is:
* querier.scheduler-grpc-client
*/
query_scheduler_grpc_client?: grpc_client;
};
/**
* The `gcs_storage_config` block configures the connection to Google Cloud Storage object storage backend. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `common.storage`
* - `ruler.storage`
*
* &nbsp;
*/
export type gcs_storage_config = {
/**
* Name of GCS bucket. Please refer to
* https://cloud.google.com/docs/authentication/production for more information
* about how to configure authentication.
* CLI flag: -<prefix>.gcs.bucketname
* @default ""
*/
bucket_name?: string;
/**
* Service account key content in JSON format, refer to
* https://cloud.google.com/iam/docs/creating-managing-service-account-keys for
* creation.
* CLI flag: -<prefix>.gcs.service-account
* @default ""
*/
service_account?: string;
/**
* The size of the buffer that GCS client for each PUT request. 0 to disable
* buffering.
* CLI flag: -<prefix>.gcs.chunk-buffer-size
* @default 0
*/
chunk_buffer_size?: int;
/**
* The duration after which the requests to GCS should be timed out.
* CLI flag: -<prefix>.gcs.request-timeout
* @default "0s"
*/
request_timeout?: duration;
/**
* Enable OpenCensus (OC) instrumentation for all requests.
* CLI flag: -<prefix>.gcs.enable-opencensus
* @default true
*/
enable_opencensus?: boolean;
/**
* Enable HTTP2 connections.
* CLI flag: -<prefix>.gcs.enable-http2
* @default true
*/
enable_http2?: boolean;
/**
* Enable automatic retries of failed idempotent requests.
* CLI flag: -<prefix>.gcs.enable-retries
* @default true
*/
enable_retries?: boolean;
};
/**
* The `grpc_client` block configures the gRPC client used to communicate between a client and server component in Loki. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `bigtable`
* - `bloom-build.builder.grpc`
* - `bloom-gateway-client.grpc`
* - `boltdb.shipper.index-gateway-client.grpc`
* - `frontend.grpc-client-config`
* - `ingester.client`
* - `pattern-ingester.client`
* - `querier.frontend-client`
* - `querier.frontend-grpc-client`
* - `querier.scheduler-grpc-client`
* - `query-scheduler.grpc-client-config`
* - `ruler.client`
* - `tsdb.shipper.index-gateway-client.grpc`
*
* &nbsp;
*/
export type grpc_client = {
/**
* gRPC client max receive message size (bytes).
* CLI flag: -<prefix>.grpc-max-recv-msg-size
* @default 104857600
*/
max_recv_msg_size?: int;
/**
* gRPC client max send message size (bytes).
* CLI flag: -<prefix>.grpc-max-send-msg-size
* @default 104857600
*/
max_send_msg_size?: int;
/**
* Use compression when sending messages. Supported values are: 'gzip', 'snappy'
* and '' (disable compression)
* CLI flag: -<prefix>.grpc-compression
* @default ""
*/
grpc_compression?: string;
/**
* Rate limit for gRPC client; 0 means disabled.
* CLI flag: -<prefix>.grpc-client-rate-limit
* @default 0
*/
rate_limit?: float;
/**
* Rate limit burst for gRPC client.
* CLI flag: -<prefix>.grpc-client-rate-limit-burst
* @default 0
*/
rate_limit_burst?: int;
/**
* Enable backoff and retry when we hit rate limits.
* CLI flag: -<prefix>.backoff-on-ratelimits
* @default true
*/
backoff_on_ratelimits?: boolean;
backoff_config?: {
/**
* Minimum delay when backing off.
* CLI flag: -<prefix>.backoff-min-period
* @default "100ms"
*/
min_period?: duration;
/**
* Maximum delay when backing off.
* CLI flag: -<prefix>.backoff-max-period
* @default "10s"
*/
max_period?: duration;
/**
* Number of times to backoff and retry before failing.
* CLI flag: -<prefix>.backoff-retries
* @default 10
*/
max_retries?: int;
};
/**
* Initial stream window size. Values less than the default are not supported and
* are ignored. Setting this to a value other than the default disables the BDP
* estimator.
* CLI flag: -<prefix>.initial-stream-window-size
* @default "63KiB1023B"
*/
initial_stream_window_size?: int;
/**
* Initial connection window size. Values less than the default are not supported
* and are ignored. Setting this to a value other than the default disables the
* BDP estimator.
* CLI flag: -<prefix>.initial-connection-window-size
* @default "63KiB1023B"
*/
initial_connection_window_size?: int;
/**
* Enable TLS in the gRPC client. This flag needs to be enabled when any other
* TLS flag is set. If set to false, insecure connection to gRPC server will be
* used.
* CLI flag: -<prefix>.tls-enabled
* @default true
*/
tls_enabled?: boolean;
/**
* Path to the client certificate, which will be used for authenticating with the
* server. Also requires the key path to be configured.
* CLI flag: -<prefix>.tls-cert-path
* @default ""
*/
tls_cert_path?: string;
/**
* Path to the key for the client certificate. Also requires the client
* certificate to be configured.
* CLI flag: -<prefix>.tls-key-path
* @default ""
*/
tls_key_path?: string;
/**
* Path to the CA certificates to validate server certificate against. If not
* set, the host's root CA certificates are used.
* CLI flag: -<prefix>.tls-ca-path
* @default ""
*/
tls_ca_path?: string;
/**
* Override the expected name on the server certificate.
* CLI flag: -<prefix>.tls-server-name
* @default ""
*/
tls_server_name?: string;
/**
* Skip validating server certificate.
* CLI flag: -<prefix>.tls-insecure-skip-verify
* @default true
*/
tls_insecure_skip_verify?: boolean;
/**
* Override the default cipher suite list (separated by commas). Allowed values:
*
* Secure Ciphers:
* - TLS_AES_128_GCM_SHA256
* - TLS_AES_256_GCM_SHA384
* - TLS_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
*
* Insecure Ciphers:
* - TLS_RSA_WITH_RC4_128_SHA
* - TLS_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA
* - TLS_RSA_WITH_AES_256_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA256
* - TLS_RSA_WITH_AES_128_GCM_SHA256
* - TLS_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* CLI flag: -<prefix>.tls-cipher-suites
* @default ""
*/
tls_cipher_suites?: string;
/**
* Override the default minimum TLS version. Allowed values: VersionTLS10,
* VersionTLS11, VersionTLS12, VersionTLS13
* CLI flag: -<prefix>.tls-min-version
* @default ""
*/
tls_min_version?: string;
/**
* The maximum amount of time to establish a connection. A value of 0 means
* default gRPC client connect timeout and backoff.
* CLI flag: -<prefix>.connect-timeout
* @default "5s"
*/
connect_timeout?: duration;
/**
* Initial backoff delay after first connection failure. Only relevant if
* ConnectTimeout > 0.
* CLI flag: -<prefix>.connect-backoff-base-delay
* @default "1s"
*/
connect_backoff_base_delay?: duration;
/**
* Maximum backoff delay when establishing a connection. Only relevant if
* ConnectTimeout > 0.
* CLI flag: -<prefix>.connect-backoff-max-delay
* @default "5s"
*/
connect_backoff_max_delay?: duration;
};
/**
* The `index_gateway` block configures the Loki index gateway server, responsible for serving index queries without the need to constantly interact with the object store.
*/
export type index_gateway = {
/**
* Defines in which mode the index gateway server will operate (default to
* 'simple'). It supports two modes:
* - 'simple': an index gateway server instance is responsible for handling,
* storing and returning requests for all indices for all tenants.
* - 'ring': an index gateway server instance is responsible for a subset of
* tenants instead of all tenants.
* CLI flag: -index-gateway.mode
* @default "simple"
*/
mode?: string;
/**
* Defines the ring to be used by the index gateway servers and clients in case
* the servers are configured to run in 'ring' mode. In case this isn't
* configured, this block supports inheriting configuration from the common ring
* section.
*/
ring?: {
kvstore?: {
/**
* Backend storage to use for the ring. Supported values are: consul, etcd,
* inmemory, memberlist, multi.
* CLI flag: -index-gateway.ring.store
* @default "consul"
*/
store?: string;
/**
* The prefix for the keys in the store. Should end with a /.
* CLI flag: -index-gateway.ring.prefix
* @default "collectors/"
*/
prefix?: string;
/**
* Configuration for a Consul client. Only applies if the selected kvstore is
* consul.
* The CLI flags prefix for this block configuration is: index-gateway.ring
*/
consul?: consul;
/**
* Configuration for an ETCD v3 client. Only applies if the selected kvstore
* is etcd.
* The CLI flags prefix for this block configuration is: index-gateway.ring
*/
etcd?: etcd;
multi?: {
/**
* Primary backend storage used by multi-client.
* CLI flag: -index-gateway.ring.multi.primary
* @default ""
*/
primary?: string;
/**
* Secondary backend storage used by multi-client.
* CLI flag: -index-gateway.ring.multi.secondary
* @default ""
*/
secondary?: string;
/**
* Mirror writes to secondary store.
* CLI flag: -index-gateway.ring.multi.mirror-enabled
* @default true
*/
mirror_enabled?: boolean;
/**
* Timeout for storing value to secondary store.
* CLI flag: -index-gateway.ring.multi.mirror-timeout
* @default "2s"
*/
mirror_timeout?: duration;
};
};
/**
* Period at which to heartbeat to the ring. 0 = disabled.
* CLI flag: -index-gateway.ring.heartbeat-period
* @default "15s"
*/
heartbeat_period?: duration;
/**
* The heartbeat timeout after which compactors are considered unhealthy within
* the ring. 0 = never (timeout disabled).
* CLI flag: -index-gateway.ring.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* File path where tokens are stored. If empty, tokens are not stored at
* shutdown and restored at startup.
* CLI flag: -index-gateway.ring.tokens-file-path
* @default ""
*/
tokens_file_path?: string;
/**
* True to enable zone-awareness and replicate blocks across different
* availability zones.
* CLI flag: -index-gateway.ring.zone-awareness-enabled
* @default true
*/
zone_awareness_enabled?: boolean;
/**
* Deprecated: How many index gateway instances are assigned to each tenant.
* Use -index-gateway.shard-size instead. The shard size is also a per-tenant
* setting.
* CLI flag: -replication-factor
* @deprecated
* @default 3
*/
replication_factor?: int;
/**
* Instance ID to register in the ring.
* CLI flag: -index-gateway.ring.instance-id
* @default "<hostname>"
*/
instance_id?: string;
/**
* Name of network interface to read address from.
* CLI flag: -index-gateway.ring.instance-interface-names
* @default "[<private network interfaces>]"
*/
instance_interface_names?: string[];
/**
* Port to advertise in the ring (defaults to server.grpc-listen-port).
* CLI flag: -index-gateway.ring.instance-port
* @default 0
*/
instance_port?: int;
/**
* IP address to advertise in the ring.
* CLI flag: -index-gateway.ring.instance-addr
* @default ""
*/
instance_addr?: string;
/**
* The availability zone where this instance is running. Required if
* zone-awareness is enabled.
* CLI flag: -index-gateway.ring.instance-availability-zone
* @default ""
*/
instance_availability_zone?: string;
/**
* Enable using a IPv6 instance address.
* CLI flag: -index-gateway.ring.instance-enable-ipv6
* @default true
*/
instance_enable_ipv6?: boolean;
};
};
/**
* The `ingester` block configures the ingester and how the ingester will register itself to a key value store.
*/
export type ingester = {
/**
* Configures how the lifecycle of the ingester will operate and where it will
* register for discovery.
*/
lifecycler?: {
ring?: {
kvstore?: {
/**
* Backend storage to use for the ring. Supported values are: consul, etcd,
* inmemory, memberlist, multi.
* CLI flag: -ring.store
* @default "consul"
*/
store?: string;
/**
* The prefix for the keys in the store. Should end with a /.
* CLI flag: -ring.prefix
* @default "collectors/"
*/
prefix?: string;
/**
* Configuration for a Consul client. Only applies if the selected kvstore
* is consul.
*/
consul?: consul;
/**
* Configuration for an ETCD v3 client. Only applies if the selected
* kvstore is etcd.
*/
etcd?: etcd;
multi?: {
/**
* Primary backend storage used by multi-client.
* CLI flag: -multi.primary
* @default ""
*/
primary?: string;
/**
* Secondary backend storage used by multi-client.
* CLI flag: -multi.secondary
* @default ""
*/
secondary?: string;
/**
* Mirror writes to secondary store.
* CLI flag: -multi.mirror-enabled
* @default true
*/
mirror_enabled?: boolean;
/**
* Timeout for storing value to secondary store.
* CLI flag: -multi.mirror-timeout
* @default "2s"
*/
mirror_timeout?: duration;
};
};
/**
* The heartbeat timeout after which ingesters are skipped for reads/writes.
* 0 = never (timeout disabled).
* CLI flag: -ring.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* The number of ingesters to write to and read from.
* CLI flag: -distributor.replication-factor
* @default 3
*/
replication_factor?: int;
/**
* True to enable the zone-awareness and replicate ingested samples across
* different availability zones.
* CLI flag: -distributor.zone-awareness-enabled
* @default true
*/
zone_awareness_enabled?: boolean;
/**
* Comma-separated list of zones to exclude from the ring. Instances in
* excluded zones will be filtered out from the ring.
* CLI flag: -distributor.excluded-zones
* @default ""
*/
excluded_zones?: string;
};
/**
* Number of tokens for each ingester.
* CLI flag: -ingester.num-tokens
* @default 128
*/
num_tokens?: int;
/**
* Period at which to heartbeat to consul. 0 = disabled.
* CLI flag: -ingester.heartbeat-period
* @default "5s"
*/
heartbeat_period?: duration;
/**
* Heartbeat timeout after which instance is assumed to be unhealthy. 0 =
* disabled.
* CLI flag: -ingester.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* Observe tokens after generating to resolve collisions. Useful when using
* gossiping ring.
* CLI flag: -ingester.observe-period
* @default "0s"
*/
observe_period?: duration;
/**
* Period to wait for a claim from another member; will join automatically
* after this.
* CLI flag: -ingester.join-after
* @default "0s"
*/
join_after?: duration;
/**
* Minimum duration to wait after the internal readiness checks have passed but
* before succeeding the readiness endpoint. This is used to slowdown
* deployment controllers (eg. Kubernetes) after an instance is ready and
* before they proceed with a rolling update, to give the rest of the cluster
* instances enough time to receive ring updates.
* CLI flag: -ingester.min-ready-duration
* @default "15s"
*/
min_ready_duration?: duration;
/**
* Name of network interface to read address from.
* CLI flag: -ingester.lifecycler.interface
* @default "[<private network interfaces>]"
*/
interface_names?: string[];
/**
* Enable IPv6 support. Required to make use of IP addresses from IPv6
* interfaces.
* CLI flag: -ingester.enable-inet6
* @default true
*/
enable_inet6?: boolean;
/**
* Duration to sleep for before exiting, to ensure metrics are scraped.
* CLI flag: -ingester.final-sleep
* @default "0s"
*/
final_sleep?: duration;
/**
* File path where tokens are stored. If empty, tokens are not stored at
* shutdown and restored at startup.
* CLI flag: -ingester.tokens-file-path
* @default ""
*/
tokens_file_path?: string;
/**
* The availability zone where this instance is running.
* CLI flag: -ingester.availability-zone
* @default ""
*/
availability_zone?: string;
/**
* Unregister from the ring upon clean shutdown. It can be useful to disable
* for rolling restarts with consistent naming in conjunction with
* -distributor.extend-writes=false.
* CLI flag: -ingester.unregister-on-shutdown
* @default true
*/
unregister_on_shutdown?: boolean;
/**
* When enabled the readiness probe succeeds only after all instances are
* ACTIVE and healthy in the ring, otherwise only the instance itself is
* checked. This option should be disabled if in your cluster multiple
* instances can be rolled out simultaneously, otherwise rolling updates may be
* slowed down.
* CLI flag: -ingester.readiness-check-ring-health
* @default true
*/
readiness_check_ring_health?: boolean;
/**
* IP address to advertise in the ring.
* CLI flag: -ingester.lifecycler.addr
* @default ""
*/
address?: string;
/**
* port to advertise in consul (defaults to server.grpc-listen-port).
* CLI flag: -ingester.lifecycler.port
* @default 0
*/
port?: int;
/**
* ID to register in the ring.
* CLI flag: -ingester.lifecycler.ID
* @default "<hostname>"
*/
id?: string;
};
/**
* How many flushes can happen concurrently from each stream.
* CLI flag: -ingester.concurrent-flushes
* @default 32
*/
concurrent_flushes?: int;
/**
* How often should the ingester see if there are any blocks to flush. The first
* flush check is delayed by a random time up to 0.8x the flush check period.
* Additionally, there is +/- 1% jitter added to the interval.
* CLI flag: -ingester.flush-check-period
* @default "30s"
*/
flush_check_period?: duration;
flush_op_backoff?: {
/**
* Minimum backoff period when a flush fails. Each concurrent flush has its own
* backoff, see `ingester.concurrent-flushes`.
* CLI flag: -ingester.flush-op-backoff-min-period
* @default "10s"
*/
min_period?: duration;
/**
* Maximum backoff period when a flush fails. Each concurrent flush has its own
* backoff, see `ingester.concurrent-flushes`.
* CLI flag: -ingester.flush-op-backoff-max-period
* @default "1m"
*/
max_period?: duration;
/**
* Maximum retries for failed flushes.
* CLI flag: -ingester.flush-op-backoff-retries
* @default 10
*/
max_retries?: int;
};
/**
* The timeout for an individual flush. Will be retried up to
* `flush-op-backoff-retries` times.
* CLI flag: -ingester.flush-op-timeout
* @default "10m"
*/
flush_op_timeout?: duration;
/**
* How long chunks should be retained in-memory after they've been flushed.
* CLI flag: -ingester.chunks-retain-period
* @default "0s"
*/
chunk_retain_period?: duration;
/**
* How long chunks should sit in-memory with no updates before being flushed if
* they don't hit the max block size. This means that half-empty chunks will
* still be flushed after a certain period as long as they receive no further
* activity.
* CLI flag: -ingester.chunks-idle-period
* @default "30m"
*/
chunk_idle_period?: duration;
/**
* The targeted _uncompressed_ size in bytes of a chunk block When this threshold
* is exceeded the head block will be cut and compressed inside the chunk.
* CLI flag: -ingester.chunks-block-size
* @default 262144
*/
chunk_block_size?: int;
/**
* A target _compressed_ size in bytes for chunks. This is a desired size not an
* exact size, chunks may be slightly bigger or significantly smaller if they get
* flushed for other reasons (e.g. chunk_idle_period). A value of 0 creates
* chunks with a fixed 10 blocks, a non zero value will create chunks with a
* variable number of blocks to meet the target size.
* CLI flag: -ingester.chunk-target-size
* @default 1572864
*/
chunk_target_size?: int;
/**
* The algorithm to use for compressing chunk. (none, gzip, lz4-64k, snappy,
* lz4-256k, lz4-1M, lz4, flate, zstd)
* CLI flag: -ingester.chunk-encoding
* @default "gzip"
*/
chunk_encoding?: string;
/**
* The maximum duration of a timeseries chunk in memory. If a timeseries runs for
* longer than this, the current chunk will be flushed to the store and a new
* chunk created.
* CLI flag: -ingester.max-chunk-age
* @default "2h"
*/
max_chunk_age?: duration;
/**
* Forget about ingesters having heartbeat timestamps older than
* `ring.kvstore.heartbeat_timeout`. This is equivalent to clicking on the
* `/ring` `forget` button in the UI: the ingester is removed from the ring. This
* is a useful setting when you are sure that an unhealthy node won't return. An
* example is when not using stateful sets or the equivalent. Use
* `memberlist.rejoin_interval` > 0 to handle network partition cases when using
* a memberlist.
* CLI flag: -ingester.autoforget-unhealthy
* @default true
*/
autoforget_unhealthy?: boolean;
/**
* Parameters used to synchronize ingesters to cut chunks at the same moment.
* Sync period is used to roll over incoming entry to a new chunk. If chunk's
* utilization isn't high enough (eg. less than 50% when sync_min_utilization is
* set to 0.5), then this chunk rollover doesn't happen.
* CLI flag: -ingester.sync-period
* @default "1h"
*/
sync_period?: duration;
/**
* Minimum utilization of chunk when doing synchronization.
* CLI flag: -ingester.sync-min-utilization
* @default 0.1
*/
sync_min_utilization?: float;
/**
* The maximum number of errors a stream will report to the user when a push
* fails. 0 to make unlimited.
* CLI flag: -ingester.max-ignored-stream-errors
* @default 10
*/
max_returned_stream_errors?: int;
/**
* How far back should an ingester be allowed to query the store for data, for
* use only with boltdb-shipper/tsdb index and filesystem object store. -1 for
* infinite.
* CLI flag: -ingester.query-store-max-look-back-period
* @default "0s"
*/
query_store_max_look_back_period?: duration;
/**
* The ingester WAL (Write Ahead Log) records incoming logs and stores them on
* the local file systems in order to guarantee persistence of acknowledged data
* in the event of a process crash.
*/
wal?: {
/**
* Enable writing of ingested data into WAL.
* CLI flag: -ingester.wal-enabled
* @default true
*/
enabled?: boolean;
/**
* Directory where the WAL data is stored and/or recovered from.
* CLI flag: -ingester.wal-dir
* @default "wal"
*/
dir?: string;
/**
* Interval at which checkpoints should be created.
* CLI flag: -ingester.checkpoint-duration
* @default "5m"
*/
checkpoint_duration?: duration;
/**
* When WAL is enabled, should chunks be flushed to long-term storage on
* shutdown.
* CLI flag: -ingester.flush-on-shutdown
* @default true
*/
flush_on_shutdown?: boolean;
/**
* Maximum memory size the WAL may use during replay. After hitting this, it
* will flush data to storage before continuing. A unit suffix (KB, MB, GB) may
* be applied.
* CLI flag: -ingester.wal-replay-memory-ceiling
* @default "4GB"
*/
replay_memory_ceiling?: int;
};
/**
* Shard factor used in the ingesters for the in process reverse index. This MUST
* be evenly divisible by ALL schema shard factors or Loki will not start.
* CLI flag: -ingester.index-shards
* @default 32
*/
index_shards?: int;
/**
* Maximum number of dropped streams to keep in memory during tailing.
* CLI flag: -ingester.tailer.max-dropped-streams
* @default 10
*/
max_dropped_streams?: int;
/**
* Path where the shutdown marker file is stored. If not set and
* common.path_prefix is set then common.path_prefix will be used.
* CLI flag: -ingester.shutdown-marker-path
* @default ""
*/
shutdown_marker_path?: string;
};
/**
* The `ingester_client` block configures how the distributor will connect to ingesters. Only appropriate when running all components, the distributor, or the querier.
*/
export type ingester_client = {
/**
* Configures how connections are pooled.
*/
pool_config?: {
/**
* How frequently to clean up clients for ingesters that have gone away.
* CLI flag: -distributor.client-cleanup-period
* @default "15s"
*/
client_cleanup_period?: duration;
/**
* Run a health check on each ingester client during periodic cleanup.
* CLI flag: -distributor.health-check-ingesters
* @default true
*/
health_check_ingesters?: boolean;
/**
* How quickly a dead client will be removed after it has been detected to
* disappear. Set this to a value to allow time for a secondary health check to
* recover the missing client.
* CLI flag: -ingester.client.healthcheck-timeout
* @default "1s"
*/
remote_timeout?: duration;
};
/**
* The remote request timeout on the client side.
* CLI flag: -ingester.client.timeout
* @default "5s"
*/
remote_timeout?: duration;
/**
* Configures how the gRPC connection to ingesters work as a client.
* The CLI flags prefix for this block configuration is: ingester.client
*/
grpc_client_config?: grpc_client;
};
/**
* The `limits_config` block configures global and per-tenant limits in Loki. The values here can be overridden in the `overrides` section of the runtime_config file
*/
export type limits_config = {
/**
* Whether the ingestion rate limit should be applied individually to each
* distributor instance (local), or evenly shared across the cluster (global).
* The ingestion rate strategy cannot be overridden on a per-tenant basis.
* - local: enforces the limit on a per distributor basis. The actual effective
* rate limit will be N times higher, where N is the number of distributor
* replicas.
* - global: enforces the limit globally, configuring a per-distributor local
* rate limiter as 'ingestion_rate / N', where N is the number of distributor
* replicas (it's automatically adjusted if the number of replicas change). The
* global strategy requires the distributors to form their own ring, which is
* used to keep track of the current number of healthy distributor replicas.
* CLI flag: -distributor.ingestion-rate-limit-strategy
* @default "global"
*/
ingestion_rate_strategy?: string;
/**
* Per-user ingestion rate limit in sample size per second. Units in MB.
* CLI flag: -distributor.ingestion-rate-limit-mb
* @default 4
*/
ingestion_rate_mb?: float;
/**
* Per-user allowed ingestion burst size (in sample size). Units in MB. The burst
* size refers to the per-distributor local rate limiter even in the case of the
* 'global' strategy, and should be set at least to the maximum logs size
* expected in a single push request.
* CLI flag: -distributor.ingestion-burst-size-mb
* @default 6
*/
ingestion_burst_size_mb?: float;
/**
* Maximum length accepted for label names.
* CLI flag: -validation.max-length-label-name
* @default 1024
*/
max_label_name_length?: int;
/**
* Maximum length accepted for label value. This setting also applies to the
* metric name.
* CLI flag: -validation.max-length-label-value
* @default 2048
*/
max_label_value_length?: int;
/**
* Maximum number of label names per series.
* CLI flag: -validation.max-label-names-per-series
* @default 15
*/
max_label_names_per_series?: int;
/**
* Whether or not old samples will be rejected.
* CLI flag: -validation.reject-old-samples
* @default true
*/
reject_old_samples?: boolean;
/**
* Maximum accepted sample age before rejecting.
* CLI flag: -validation.reject-old-samples.max-age
* @default "1w"
*/
reject_old_samples_max_age?: duration;
/**
* Duration which table will be created/deleted before/after it's needed; we
* won't accept sample from before this time.
* CLI flag: -validation.create-grace-period
* @default "10m"
*/
creation_grace_period?: duration;
/**
* Maximum line size on ingestion path. Example: 256kb. Any log line exceeding
* this limit will be discarded unless `distributor.max-line-size-truncate` is
* set which in case it is truncated instead of discarding it completely. There
* is no limit when unset or set to 0.
* CLI flag: -distributor.max-line-size
* @default "256KB"
*/
max_line_size?: int;
/**
* Whether to truncate lines that exceed max_line_size.
* CLI flag: -distributor.max-line-size-truncate
* @default true
*/
max_line_size_truncate?: boolean;
/**
* Alter the log line timestamp during ingestion when the timestamp is the same
* as the previous entry for the same stream. When enabled, if a log line in a
* push request has the same timestamp as the previous line for the same stream,
* one nanosecond is added to the log line. This will preserve the received order
* of log lines with the exact same timestamp when they are queried, by slightly
* altering their stored timestamp. NOTE: This is imperfect, because Loki accepts
* out of order writes, and another push request for the same stream could
* contain duplicate timestamps to existing entries and they will not be
* incremented.
* CLI flag: -validation.increment-duplicate-timestamps
* @default true
*/
increment_duplicate_timestamp?: boolean;
/**
* If no service_name label exists, Loki maps a single label from the configured
* list to service_name. If none of the configured labels exist in the stream,
* label is set to unknown_service. Empty list disables setting the label.
* CLI flag: -validation.discover-service-name
* @default "[service app application name app_kubernetes_io_name container container_name component workload job]"
*/
discover_service_name?: string[];
/**
* Discover and add log levels during ingestion, if not present already. Levels
* would be added to Structured Metadata with name
* level/LEVEL/Level/Severity/severity/SEVERITY/lvl/LVL/Lvl (case-sensitive) and
* one of the values from 'trace', 'debug', 'info', 'warn', 'error', 'critical',
* 'fatal' (case insensitive).
* CLI flag: -validation.discover-log-levels
* @default true
*/
discover_log_levels?: boolean;
/**
* When true an ingester takes into account only the streams that it owns
* according to the ring while applying the stream limit.
* CLI flag: -ingester.use-owned-stream-count
* @default true
*/
use_owned_stream_count?: boolean;
/**
* Maximum number of active streams per user, per ingester. 0 to disable.
* CLI flag: -ingester.max-streams-per-user
* @default 0
*/
max_streams_per_user?: int;
/**
* Maximum number of active streams per user, across the cluster. 0 to disable.
* When the global limit is enabled, each ingester is configured with a dynamic
* local limit based on the replication factor and the current number of healthy
* ingesters, and is kept updated whenever the number of ingesters change.
* CLI flag: -ingester.max-global-streams-per-user
* @default 5000
*/
max_global_streams_per_user?: int;
/**
* Deprecated. When true, out-of-order writes are accepted.
* CLI flag: -ingester.unordered-writes
* @default true
*/
unordered_writes?: boolean;
/**
* Maximum byte rate per second per stream, also expressible in human readable
* forms (1MB, 256KB, etc).
* CLI flag: -ingester.per-stream-rate-limit
* @default "3MB"
*/
per_stream_rate_limit?: int;
/**
* Maximum burst bytes per stream, also expressible in human readable forms (1MB,
* 256KB, etc). This is how far above the rate limit a stream can 'burst' before
* the stream is limited.
* CLI flag: -ingester.per-stream-rate-limit-burst
* @default "15MB"
*/
per_stream_rate_limit_burst?: int;
/**
* Maximum number of chunks that can be fetched in a single query.
* CLI flag: -store.query-chunk-limit
* @default 2000000
*/
max_chunks_per_query?: int;
/**
* Limit the maximum of unique series that is returned by a metric query. When
* the limit is reached an error is returned.
* CLI flag: -querier.max-query-series
* @default 500
*/
max_query_series?: int;
/**
* Limit how far back in time series data and metadata can be queried, up until
* lookback duration ago. This limit is enforced in the query frontend, the
* querier and the ruler. If the requested time range is outside the allowed
* range, the request will not fail, but will be modified to only query data
* within the allowed time range. The default value of 0 does not set a limit.
* CLI flag: -querier.max-query-lookback
* @default "0s"
*/
max_query_lookback?: duration;
/**
* The limit to length of chunk store queries. 0 to disable.
* CLI flag: -store.max-query-length
* @default "30d1h"
*/
max_query_length?: duration;
/**
* Limit the length of the [range] inside a range query. Default is 0 or
* unlimited
* CLI flag: -querier.max-query-range
* @default "0s"
*/
max_query_range?: duration;
/**
* Maximum number of queries that will be scheduled in parallel by the frontend.
* CLI flag: -querier.max-query-parallelism
* @default 32
*/
max_query_parallelism?: int;
/**
* Maximum number of queries will be scheduled in parallel by the frontend for
* TSDB schemas.
* CLI flag: -querier.tsdb-max-query-parallelism
* @default 128
*/
tsdb_max_query_parallelism?: int;
/**
* Target maximum number of bytes assigned to a single sharded query. Also
* expressible in human readable forms (1GB, etc). Note: This is a _target_ and
* not an absolute limit. The actual limit can be higher, but the query planner
* will try to build shards up to this limit.
* CLI flag: -querier.tsdb-max-bytes-per-shard
* @default "600MB"
*/
tsdb_max_bytes_per_shard?: int;
/**
* sharding strategy to use in query planning. Suggested to use bounded once all
* nodes can recognize it.
* CLI flag: -limits.tsdb-sharding-strategy
* @default "power_of_two"
*/
tsdb_sharding_strategy?: string;
/**
* Precompute chunks for TSDB queries. This can improve query performance at the
* cost of increased memory usage by computing chunks once during planning,
* reducing index calls.
* CLI flag: -querier.tsdb-precompute-chunks
* @default true
*/
tsdb_precompute_chunks?: boolean;
/**
* Cardinality limit for index queries.
* CLI flag: -store.cardinality-limit
* @default 100000
*/
cardinality_limit?: int;
/**
* Maximum number of stream matchers per query.
* CLI flag: -querier.max-streams-matcher-per-query
* @default 1000
*/
max_streams_matchers_per_query?: int;
/**
* Maximum number of concurrent tail requests.
* CLI flag: -querier.max-concurrent-tail-requests
* @default 10
*/
max_concurrent_tail_requests?: int;
/**
* Maximum number of log entries that will be returned for a query.
* CLI flag: -validation.max-entries-limit
* @default 5000
*/
max_entries_limit_per_query?: int;
/**
* Most recent allowed cacheable result per-tenant, to prevent caching very
* recent results that might still be in flux.
* CLI flag: -frontend.max-cache-freshness
* @default "10m"
*/
max_cache_freshness_per_query?: duration;
/**
* Do not cache metadata request if the end time is within the
* frontend.max-metadata-cache-freshness window. Set this to 0 to apply no such
* limits. Defaults to 24h.
* CLI flag: -frontend.max-metadata-cache-freshness
* @default "1d"
*/
max_metadata_cache_freshness?: duration;
/**
* Do not cache requests with an end time that falls within Now minus this
* duration. 0 disables this feature (default).
* CLI flag: -frontend.max-stats-cache-freshness
* @default "10m"
*/
max_stats_cache_freshness?: duration;
/**
* Maximum number of queriers that can handle requests for a single tenant. If
* set to 0 or value higher than number of available queriers, *all* queriers
* will handle requests for the tenant. Each frontend (or query-scheduler, if
* used) will select the same set of queriers for the same tenant (given that all
* queriers are connected to all frontends / query-schedulers). This option only
* works with queriers connecting to the query-frontend / query-scheduler, not
* when using downstream URL.
* CLI flag: -frontend.max-queriers-per-tenant
* @default 0
*/
max_queriers_per_tenant?: int;
/**
* How much of the available query capacity ("querier" components in distributed
* mode, "read" components in SSD mode) can be used by a single tenant. Allowed
* values are 0.0 to 1.0. For example, setting this to 0.5 would allow a tenant
* to use half of the available queriers for processing the query workload. If
* set to 0, query capacity is determined by frontend.max-queriers-per-tenant.
* When both frontend.max-queriers-per-tenant and frontend.max-query-capacity are
* configured, smaller value of the resulting querier replica count is
* considered: min(frontend.max-queriers-per-tenant, ceil(querier_replicas *
* frontend.max-query-capacity)). *All* queriers will handle requests for the
* tenant if neither limits are applied. This option only works with queriers
* connecting to the query-frontend / query-scheduler, not when using downstream
* URL. Use this feature in a multi-tenant setup where you need to limit query
* capacity for certain tenants.
* CLI flag: -frontend.max-query-capacity
* @default 0
*/
max_query_capacity?: float;
/**
* Number of days of index to be kept always downloaded for queries. Applies only
* to per user index in boltdb-shipper index store. 0 to disable.
* CLI flag: -store.query-ready-index-num-days
* @default 0
*/
query_ready_index_num_days?: int;
/**
* Timeout when querying backends (ingesters or storage) during the execution of
* a query request. When a specific per-tenant timeout is used, the global
* timeout is ignored.
* CLI flag: -querier.query-timeout
* @default "1m"
*/
query_timeout?: duration;
/**
* Split queries by a time interval and execute in parallel. The value 0 disables
* splitting by time. This also determines how cache keys are chosen when result
* caching is enabled.
* CLI flag: -querier.split-queries-by-interval
* @default "1h"
*/
split_queries_by_interval?: duration;
/**
* Split metadata queries by a time interval and execute in parallel. The value 0
* disables splitting metadata queries by time. This also determines how cache
* keys are chosen when label/series result caching is enabled.
* CLI flag: -querier.split-metadata-queries-by-interval
* @default "1d"
*/
split_metadata_queries_by_interval?: duration;
/**
* Experimental. Split interval to use for the portion of metadata request that
* falls within `recent_metadata_query_window`. Rest of the request which is
* outside the window still uses `split_metadata_queries_by_interval`. If set to
* 0, the entire request defaults to using a split interval of
* `split_metadata_queries_by_interval.`.
* CLI flag: -experimental.querier.split-recent-metadata-queries-by-interval
* @default "1h"
*/
split_recent_metadata_queries_by_interval?: duration;
/**
* Experimental. Metadata query window inside which
* `split_recent_metadata_queries_by_interval` gets applied, portion of the
* metadata request that falls in this window is split using
* `split_recent_metadata_queries_by_interval`. The value 0 disables using a
* different split interval for recent metadata queries.
*
* This is added to improve cacheability of recent metadata queries. Query split
* interval also determines the interval used in cache key. The default split
* interval of 24h is useful for caching long queries, each cache key holding 1
* day's results. But metadata queries are often shorter than 24h, to cache them
* effectively we need a smaller split interval. `recent_metadata_query_window`
* along with `split_recent_metadata_queries_by_interval` help configure a
* shorter split interval for recent metadata queries.
* CLI flag: -experimental.querier.recent-metadata-query-window
* @default "0s"
*/
recent_metadata_query_window?: duration;
/**
* Split instant metric queries by a time interval and execute in parallel. The
* value 0 disables splitting instant metric queries by time. This also
* determines how cache keys are chosen when instant metric query result caching
* is enabled.
* CLI flag: -querier.split-instant-metric-queries-by-interval
* @default "1h"
*/
split_instant_metric_queries_by_interval?: duration;
/**
* Interval to use for time-based splitting when a request is within the
* `query_ingesters_within` window; defaults to `split-queries-by-interval` by
* setting to 0.
* CLI flag: -querier.split-ingester-queries-by-interval
* @default "0s"
*/
split_ingester_queries_by_interval?: duration;
/**
* Limit queries that can be sharded. Queries within the time range of now and
* now minus this sharding lookback are not sharded. The default value of 0s
* disables the lookback, causing sharding of all queries at all times.
* CLI flag: -frontend.min-sharding-lookback
* @default "0s"
*/
min_sharding_lookback?: duration;
/**
* Max number of bytes a query can fetch. Enforced in log and metric queries only
* when TSDB is used. The default value of 0 disables this limit.
* CLI flag: -frontend.max-query-bytes-read
* @default "0B"
*/
max_query_bytes_read?: int;
/**
* Max number of bytes a query can fetch after splitting and sharding. Enforced
* in log and metric queries only when TSDB is used. The default value of 0
* disables this limit.
* CLI flag: -frontend.max-querier-bytes-read
* @default "150GB"
*/
max_querier_bytes_read?: int;
/**
* Enable log-volume endpoints.
* CLI flag: -limits.volume-enabled
* @default true
*/
volume_enabled?: boolean;
/**
* The maximum number of aggregated series in a log-volume response
* CLI flag: -limits.volume-max-series
* @default 1000
*/
volume_max_series?: int;
/**
* Maximum number of rules per rule group per-tenant. 0 to disable.
* CLI flag: -ruler.max-rules-per-rule-group
* @default 0
*/
ruler_max_rules_per_rule_group?: int;
/**
* Maximum number of rule groups per-tenant. 0 to disable.
* CLI flag: -ruler.max-rule-groups-per-tenant
* @default 0
*/
ruler_max_rule_groups_per_tenant?: int;
/**
* The default tenant's shard size when shuffle-sharding is enabled in the ruler.
* When this setting is specified in the per-tenant overrides, a value of 0
* disables shuffle sharding for the tenant.
* CLI flag: -ruler.tenant-shard-size
* @default 0
*/
ruler_tenant_shard_size?: int;
/**
* Disable recording rules remote-write.
*/
ruler_remote_write_disabled?: boolean;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. The URL of the endpoint
* to send samples to.
* @deprecated
* @default ""
*/
ruler_remote_write_url?: string;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Timeout for requests to
* the remote write endpoint.
* @deprecated
*/
ruler_remote_write_timeout?: duration;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Custom HTTP headers to be
* sent along with each remote write request. Be aware that headers that are set
* by Loki itself can't be overwritten.
* @deprecated
*/
ruler_remote_write_headers?: headers;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. List of remote write
* relabel configurations.
* @deprecated
*/
ruler_remote_write_relabel_configs?: relabel_config[];
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Number of samples to
* buffer per shard before we block reading of more samples from the WAL. It is
* recommended to have enough capacity in each shard to buffer several requests
* to keep throughput up while processing occasional slow remote requests.
* @deprecated
*/
ruler_remote_write_queue_capacity?: int;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Minimum number of shards,
* i.e. amount of concurrency.
* @deprecated
*/
ruler_remote_write_queue_min_shards?: int;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Maximum number of shards,
* i.e. amount of concurrency.
* @deprecated
*/
ruler_remote_write_queue_max_shards?: int;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Maximum number of samples
* per send.
* @deprecated
*/
ruler_remote_write_queue_max_samples_per_send?: int;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Maximum time a sample
* will wait in buffer.
* @deprecated
*/
ruler_remote_write_queue_batch_send_deadline?: duration;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Initial retry delay. Gets
* doubled for every retry.
* @deprecated
*/
ruler_remote_write_queue_min_backoff?: duration;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Maximum retry delay.
* @deprecated
*/
ruler_remote_write_queue_max_backoff?: duration;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Retry upon receiving a
* 429 status code from the remote-write storage. This is experimental and might
* change in the future.
* @deprecated
*/
ruler_remote_write_queue_retry_on_ratelimit?: boolean;
/**
* Deprecated: Use 'ruler_remote_write_config' instead. Configures AWS's
* Signature Verification 4 signing process to sign every remote write request.
* @deprecated
*/
ruler_remote_write_sigv4_config?: {
/** @default "" **/
region?: string;
/** @default "" **/
access_key?: string;
/** @default "" **/
secret_key?: string;
/** @default "" **/
profile?: string;
/** @default "" **/
role_arn?: string;
};
/**
* Configures global and per-tenant limits for remote write clients. A map with
* remote client id as key.
*/
ruler_remote_write_config?: Record<string, RemoteWriteConfig>;
/**
* Timeout for a remote rule evaluation. Defaults to the value of
* 'querier.query-timeout'.
*/
ruler_remote_evaluation_timeout?: duration;
/**
* Maximum size (in bytes) of the allowable response size from a remote rule
* evaluation. Set to 0 to allow any response size (default).
*/
ruler_remote_evaluation_max_response_size?: int;
/**
* Deletion mode. Can be one of 'disabled', 'filter-only', or
* 'filter-and-delete'. When set to 'filter-only' or 'filter-and-delete', and if
* retention_enabled is true, then the log entry deletion API endpoints are
* available.
* CLI flag: -compactor.deletion-mode
* @default "filter-and-delete"
*/
deletion_mode?: string;
/**
* Retention period to apply to stored data, only applies if retention_enabled is
* true in the compactor config. As of version 2.8.0, a zero value of 0 or 0s
* disables retention. In previous releases, Loki did not properly honor a zero
* value to disable retention and a really large value should be used instead.
* CLI flag: -store.retention
* @default "0s"
*/
retention_period?: duration;
/**
* Per-stream retention to apply, if the retention is enable on the compactor
* side.
* Example:
* retention_stream:
* - selector: '{namespace="dev"}'
* priority: 1
* period: 24h
* - selector: '{container="nginx"}'
* priority: 1
* period: 744h
* Selector is a Prometheus labels matchers that will apply the 'period'
* retention only if the stream is matching. In case multiple stream are
* matching, the highest priority will be picked. If no rule is matched the
* 'retention_period' is used.
*/
retention_stream?: StreamRetention[];
/**
* Feature renamed to 'runtime configuration', flag deprecated in favor of
* -runtime-config.file (runtime_config.file in YAML).
* CLI flag: -limits.per-user-override-config
* @default ""
*/
per_tenant_override_config?: string;
/**
* Feature renamed to 'runtime configuration'; flag deprecated in favor of
* -runtime-config.reload-period (runtime_config.period in YAML).
* CLI flag: -limits.per-user-override-period
* @default "10s"
*/
per_tenant_override_period?: duration;
/**
* Deprecated: Use deletion_mode per tenant configuration instead.
* @deprecated
*/
allow_deletes?: boolean;
/**
* Define streams sharding behavior.
*/
shard_streams?: {
/**
* Automatically shard streams to keep them under the per-stream rate limit.
* Sharding is dictated by the desired rate.
* CLI flag: -shard-streams.enabled
* @default true
*/
enabled?: boolean;
/**
* Whether to log sharding streams behavior or not. Not recommended for
* production environments.
* CLI flag: -shard-streams.logging-enabled
* @default true
*/
logging_enabled?: boolean;
/**
* Threshold used to cut a new shard. Default (1536KB) means if a rate is above
* 1536KB/s, it will be sharded into two streams.
* CLI flag: -shard-streams.desired-rate
* @default "1536KB"
*/
desired_rate?: int;
};
blocked_queries?: blocked_query[];
/**
* Define a list of required selector labels.
*/
required_labels?: string[];
/**
* Minimum number of label matchers a query should contain.
*/
minimum_labels_number?: int;
/**
* The shard size defines how many index gateways should be used by a tenant for
* querying. If the global shard factor is 0, the global shard factor is set to
* the deprecated -replication-factor for backwards compatibility reasons.
* CLI flag: -index-gateway.shard-size
* @default 0
*/
index_gateway_shard_size?: int;
/**
* Experimental. The shard size defines how many bloom gateways should be used by
* a tenant for querying.
* CLI flag: -bloom-gateway.shard-size
* @default 0
*/
bloom_gateway_shard_size?: int;
/**
* Experimental. Whether to use the bloom gateway component in the read path to
* filter chunks.
* CLI flag: -bloom-gateway.enable-filtering
* @default true
*/
bloom_gateway_enable_filtering?: boolean;
/**
* Experimental. Interval for computing the cache key in the Bloom Gateway.
* CLI flag: -bloom-gateway.cache-key-interval
* @default "15m"
*/
bloom_gateway_cache_key_interval?: duration;
/**
* Experimental. The shard size defines how many bloom compactors should be used
* by a tenant when computing blooms. If it's set to 0, shuffle sharding is
* disabled.
* CLI flag: -bloom-compactor.shard-size
* @default 0
*/
bloom_compactor_shard_size?: int;
/**
* Experimental. Whether to compact chunks into bloom filters.
* CLI flag: -bloom-compactor.enable-compaction
* @default true
*/
bloom_compactor_enable_compaction?: boolean;
/**
* Experimental. The maximum bloom block size. A value of 0 sets an unlimited
* size. Default is 200MB. The actual block size might exceed this limit since
* blooms will be added to blocks until the block exceeds the maximum block size.
* CLI flag: -bloom-compactor.max-block-size
* @default "200MB"
*/
bloom_compactor_max_block_size?: int;
/**
* Experimental. The maximum bloom size per log stream. A log stream whose
* generated bloom filter exceeds this size will be discarded. A value of 0 sets
* an unlimited size. Default is 128MB.
* CLI flag: -bloom-compactor.max-bloom-size
* @default "128MB"
*/
bloom_compactor_max_bloom_size?: int;
/**
* Experimental. Whether to create blooms for the tenant.
* CLI flag: -bloom-build.enable
* @default true
*/
bloom_creation_enabled?: boolean;
/**
* Experimental. Number of splits to create for the series keyspace when building
* blooms. The series keyspace is split into this many parts to parallelize bloom
* creation.
* CLI flag: -bloom-build.split-keyspace-by
* @default 256
*/
bloom_split_series_keyspace_by?: int;
/**
* Experimental. Maximum number of builders to use when building blooms. 0 allows
* unlimited builders.
* CLI flag: -bloom-build.max-builders
* @default 0
*/
bloom_build_max_builders?: int;
/**
* Experimental. Timeout for a builder to finish a task. If a builder does not
* respond within this time, it is considered failed and the task will be
* requeued. 0 disables the timeout.
* CLI flag: -bloom-build.builder-response-timeout
* @default "0s"
*/
bloom_build_builder_response_timeout?: duration;
/**
* Experimental. Maximum number of retries for a failed task. If a task fails
* more than this number of times, it is considered failed and will not be
* retried. A value of 0 disables this limit.
* CLI flag: -bloom-build.task-max-retries
* @default 3
*/
bloom_build_task_max_retries?: int;
/**
* Experimental. Length of the n-grams created when computing blooms from log
* lines.
* CLI flag: -bloom-compactor.ngram-length
* @default 4
*/
bloom_ngram_length?: int;
/**
* Experimental. Skip factor for the n-grams created when computing blooms from
* log lines.
* CLI flag: -bloom-compactor.ngram-skip
* @default 1
*/
bloom_ngram_skip?: int;
/**
* Experimental. Scalable Bloom Filter desired false-positive rate.
* CLI flag: -bloom-compactor.false-positive-rate
* @default 0.01
*/
bloom_false_positive_rate?: float;
/**
* Experimental. Compression algorithm for bloom block pages.
* CLI flag: -bloom-compactor.block-encoding
* @default "none"
*/
bloom_block_encoding?: string;
/**
* Allow user to send structured metadata in push payload.
* CLI flag: -validation.allow-structured-metadata
* @default true
*/
allow_structured_metadata?: boolean;
/**
* Maximum size accepted for structured metadata per log line.
* CLI flag: -limits.max-structured-metadata-size
* @default "64KB"
*/
max_structured_metadata_size?: int;
/**
* Maximum number of structured metadata entries per log line.
* CLI flag: -limits.max-structured-metadata-entries-count
* @default 128
*/
max_structured_metadata_entries_count?: int;
/**
* OTLP log ingestion configurations
*/
otlp_config?: {
/**
* Configuration for resource attributes to store them as index labels or
* Structured Metadata or drop them altogether
*/
resource_attributes?: {
/**
* Configure whether to ignore the default list of resource attributes set in
* 'distributor.otlp.default_resource_attributes_as_index_labels' to be
* stored as index labels and only use the given resource attributes config
* @default true
*/
ignore_defaults?: boolean;
attributes_config?: attributes_config[];
};
/**
* Configuration for scope attributes to store them as Structured Metadata or
* drop them altogether
*/
scope_attributes?: attributes_config[];
/**
* Configuration for log attributes to store them as Structured Metadata or
* drop them altogether
*/
log_attributes?: attributes_config[];
};
};
/**
* The `local_storage_config` block configures the usage of local file system as object storage backend.
*/
export type local_storage_config = {
/**
* Directory to store chunks in.
* CLI flag: -local.chunk-directory
* @default ""
*/
directory?: string;
};
/**
* Configuration for `memberlist` client. Only applies if the selected kvstore is memberlist.
*
* When a memberlist config with atleast 1 join_members is defined, kvstore of type memberlist is automatically selected for all the components that require a ring unless otherwise specified in the component's configuration section.
*/
export type memberlist = {
/**
* Name of the node in memberlist cluster. Defaults to hostname.
* CLI flag: -memberlist.nodename
* @default ""
*/
node_name?: string;
/**
* Add random suffix to the node name.
* CLI flag: -memberlist.randomize-node-name
* @default true
*/
randomize_node_name?: boolean;
/**
* The timeout for establishing a connection with a remote node, and for
* read/write operations.
* CLI flag: -memberlist.stream-timeout
* @default "10s"
*/
stream_timeout?: duration;
/**
* Multiplication factor used when sending out messages (factor * log(N+1)).
* CLI flag: -memberlist.retransmit-factor
* @default 4
*/
retransmit_factor?: int;
/**
* How often to use pull/push sync.
* CLI flag: -memberlist.pullpush-interval
* @default "30s"
*/
pull_push_interval?: duration;
/**
* How often to gossip.
* CLI flag: -memberlist.gossip-interval
* @default "200ms"
*/
gossip_interval?: duration;
/**
* How many nodes to gossip to.
* CLI flag: -memberlist.gossip-nodes
* @default 3
*/
gossip_nodes?: int;
/**
* How long to keep gossiping to dead nodes, to give them chance to refute their
* death.
* CLI flag: -memberlist.gossip-to-dead-nodes-time
* @default "30s"
*/
gossip_to_dead_nodes_time?: duration;
/**
* How soon can dead node's name be reclaimed with new address. 0 to disable.
* CLI flag: -memberlist.dead-node-reclaim-time
* @default "0s"
*/
dead_node_reclaim_time?: duration;
/**
* Enable message compression. This can be used to reduce bandwidth usage at the
* cost of slightly more CPU utilization.
* CLI flag: -memberlist.compression-enabled
* @default true
*/
compression_enabled?: boolean;
/**
* Gossip address to advertise to other members in the cluster. Used for NAT
* traversal.
* CLI flag: -memberlist.advertise-addr
* @default ""
*/
advertise_addr?: string;
/**
* Gossip port to advertise to other members in the cluster. Used for NAT
* traversal.
* CLI flag: -memberlist.advertise-port
* @default 7946
*/
advertise_port?: int;
/**
* The cluster label is an optional string to include in outbound packets and
* gossip streams. Other members in the memberlist cluster will discard any
* message whose label doesn't match the configured one, unless the
* 'cluster-label-verification-disabled' configuration option is set to true.
* CLI flag: -memberlist.cluster-label
* @default ""
*/
cluster_label?: string;
/**
* When true, memberlist doesn't verify that inbound packets and gossip streams
* have the cluster label matching the configured one. This verification should
* be disabled while rolling out the change to the configured cluster label in a
* live memberlist cluster.
* CLI flag: -memberlist.cluster-label-verification-disabled
* @default true
*/
cluster_label_verification_disabled?: boolean;
/**
* Other cluster members to join. Can be specified multiple times. It can be an
* IP, hostname or an entry specified in the DNS Service Discovery format.
* CLI flag: -memberlist.join
* @default "[]"
*/
join_members?: string[];
/**
* Min backoff duration to join other cluster members.
* CLI flag: -memberlist.min-join-backoff
* @default "1s"
*/
min_join_backoff?: duration;
/**
* Max backoff duration to join other cluster members.
* CLI flag: -memberlist.max-join-backoff
* @default "1m"
*/
max_join_backoff?: duration;
/**
* Max number of retries to join other cluster members.
* CLI flag: -memberlist.max-join-retries
* @default 10
*/
max_join_retries?: int;
/**
* If this node fails to join memberlist cluster, abort.
* CLI flag: -memberlist.abort-if-join-fails
* @default true
*/
abort_if_cluster_join_fails?: boolean;
/**
* If not 0, how often to rejoin the cluster. Occasional rejoin can help to fix
* the cluster split issue, and is harmless otherwise. For example when using
* only few components as a seed nodes (via -memberlist.join), then it's
* recommended to use rejoin. If -memberlist.join points to dynamic service that
* resolves to all gossiping nodes (eg. Kubernetes headless service), then rejoin
* is not needed.
* CLI flag: -memberlist.rejoin-interval
* @default "0s"
*/
rejoin_interval?: duration;
/**
* How long to keep LEFT ingesters in the ring.
* CLI flag: -memberlist.left-ingesters-timeout
* @default "5m"
*/
left_ingesters_timeout?: duration;
/**
* Timeout for leaving memberlist cluster.
* CLI flag: -memberlist.leave-timeout
* @default "20s"
*/
leave_timeout?: duration;
/**
* How much space to use for keeping received and sent messages in memory for
* troubleshooting (two buffers). 0 to disable.
* CLI flag: -memberlist.message-history-buffer-bytes
* @default 0
*/
message_history_buffer_bytes?: int;
/**
* IP address to listen on for gossip messages. Multiple addresses may be
* specified. Defaults to 0.0.0.0
* CLI flag: -memberlist.bind-addr
* @default "[]"
*/
bind_addr?: string[];
/**
* Port to listen on for gossip messages.
* CLI flag: -memberlist.bind-port
* @default 7946
*/
bind_port?: int;
/**
* Timeout used when connecting to other nodes to send packet.
* CLI flag: -memberlist.packet-dial-timeout
* @default "2s"
*/
packet_dial_timeout?: duration;
/**
* Timeout for writing 'packet' data.
* CLI flag: -memberlist.packet-write-timeout
* @default "5s"
*/
packet_write_timeout?: duration;
/**
* Enable TLS on the memberlist transport layer.
* CLI flag: -memberlist.tls-enabled
* @default true
*/
tls_enabled?: boolean;
/**
* Path to the client certificate, which will be used for authenticating with the
* server. Also requires the key path to be configured.
* CLI flag: -memberlist.tls-cert-path
* @default ""
*/
tls_cert_path?: string;
/**
* Path to the key for the client certificate. Also requires the client
* certificate to be configured.
* CLI flag: -memberlist.tls-key-path
* @default ""
*/
tls_key_path?: string;
/**
* Path to the CA certificates to validate server certificate against. If not
* set, the host's root CA certificates are used.
* CLI flag: -memberlist.tls-ca-path
* @default ""
*/
tls_ca_path?: string;
/**
* Override the expected name on the server certificate.
* CLI flag: -memberlist.tls-server-name
* @default ""
*/
tls_server_name?: string;
/**
* Skip validating server certificate.
* CLI flag: -memberlist.tls-insecure-skip-verify
* @default true
*/
tls_insecure_skip_verify?: boolean;
/**
* Override the default cipher suite list (separated by commas). Allowed values:
*
* Secure Ciphers:
* - TLS_AES_128_GCM_SHA256
* - TLS_AES_256_GCM_SHA384
* - TLS_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
*
* Insecure Ciphers:
* - TLS_RSA_WITH_RC4_128_SHA
* - TLS_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA
* - TLS_RSA_WITH_AES_256_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA256
* - TLS_RSA_WITH_AES_128_GCM_SHA256
* - TLS_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* CLI flag: -memberlist.tls-cipher-suites
* @default ""
*/
tls_cipher_suites?: string;
/**
* Override the default minimum TLS version. Allowed values: VersionTLS10,
* VersionTLS11, VersionTLS12, VersionTLS13
* CLI flag: -memberlist.tls-min-version
* @default ""
*/
tls_min_version?: string;
};
/**
* Configures additional object stores for a given storage provider.
* Supported stores: aws, azure, bos, filesystem, gcs, swift.
* Example:
* storage_config:
* named_stores:
* aws:
* store-1:
* endpoint: s3://foo-bucket
* region: us-west1
* Named store from this example can be used by setting object_store to store-1 in period_config.
*/
export type named_stores_config = {
aws?: Record<string, aws_storage_config>;
azure?: Record<string, azure_storage_config>;
bos?: Record<string, bos_storage_config>;
filesystem?: Record<string, local_storage_config>;
gcs?: Record<string, gcs_storage_config>;
alibabacloud?: Record<string, alibabacloud_storage_config>;
swift?: Record<string, swift_storage_config>;
cos?: Record<string, cos_storage_config>;
};
/**
* These are values which allow you to control aspects of Loki's operation, most commonly used for controlling types of higher verbosity logging, the values here can be overridden in the `configs` section of the `runtime_config` file.
*/
export type operational_config = {
/**
* Log every new stream created by a push request (very verbose, recommend to
* enable via runtime config only).
* CLI flag: -operation-config.log-stream-creation
* @default true
*/
log_stream_creation?: boolean;
/**
* Log every push request (very verbose, recommend to enable via runtime config
* only).
* CLI flag: -operation-config.log-push-request
* @default true
*/
log_push_request?: boolean;
/**
* Log every stream in a push request (very verbose, recommend to enable via
* runtime config only).
* CLI flag: -operation-config.log-push-request-streams
* @default true
*/
log_push_request_streams?: boolean;
/**
* Log push errors with a rate limited logger, will show client push errors
* without overly spamming logs.
* CLI flag: -operation-config.limited-log-push-errors
* @default true
*/
limited_log_push_errors?: boolean;
};
/**
* The `period_config` block configures what index schemas should be used for from specific time periods.
*/
export type period_config = {
/**
* The date of the first day that index buckets should be created. Use a date in
* the past if this is your only period_config, otherwise use a date when you
* want the schema to switch over. In YYYY-MM-DD format, for example: 2018-04-15.
*/
from?: daytime;
/**
* store and object_store below affect which <storage_config> key is used. Which
* index to use. Either tsdb or boltdb-shipper. Following stores are deprecated:
* aws, aws-dynamo, gcp, gcp-columnkey, bigtable, bigtable-hashed, cassandra,
* grpc.
* @default ""
*/
store?: string;
/**
* Which store to use for the chunks. Either aws (alias s3), azure, gcs,
* alibabacloud, bos, cos, swift, filesystem, or a named_store (refer to
* named_stores_config). Following stores are deprecated: aws-dynamo, gcp,
* gcp-columnkey, bigtable, bigtable-hashed, cassandra, grpc.
* @default ""
*/
object_store?: string;
/**
* The schema version to use, current recommended schema is v13.
* @default ""
*/
schema?: string;
/**
* Configures how the index is updated and stored.
*/
index?: {
/**
* Path prefix for index tables. Prefix always needs to end with a path
* delimiter '/', except when the prefix is empty.
* @default "index/"
*/
path_prefix?: string;
/**
* Table prefix for all period tables.
* @default ""
*/
prefix?: string;
/**
* Table period.
*/
period?: duration;
/**
* A map to be added to all managed tables.
*/
tags?: Record<string, string>;
};
/**
* Configured how the chunks are updated and stored.
*/
chunks?: {
/**
* Table prefix for all period tables.
* @default ""
*/
prefix?: string;
/**
* Table period.
*/
period?: duration;
/**
* A map to be added to all managed tables.
*/
tags?: Record<string, string>;
};
/**
* How many shards will be created. Only used if schema is v10 or greater.
* @default 16
*/
row_shards?: int;
};
/**
* Configures the `querier`. Only appropriate when running all modules or just the querier.
*/
export type querier = {
/**
* Maximum duration for which the live tailing requests are served.
* CLI flag: -querier.tail-max-duration
* @default "1h"
*/
tail_max_duration?: duration;
/**
* Time to wait before sending more than the minimum successful query requests.
* CLI flag: -querier.extra-query-delay
* @default "0s"
*/
extra_query_delay?: duration;
/**
* Maximum lookback beyond which queries are not sent to ingester. 0 means all
* queries are sent to ingester.
* CLI flag: -querier.query-ingesters-within
* @default "3h"
*/
query_ingesters_within?: duration;
engine?: {
/**
* The maximum amount of time to look back for log lines. Used only for instant
* log queries.
* CLI flag: -querier.engine.max-lookback-period
* @default "30s"
*/
max_look_back_period?: duration;
};
/**
* The maximum number of queries that can be simultaneously processed by the
* querier.
* CLI flag: -querier.max-concurrent
* @default 4
*/
max_concurrent?: int;
/**
* Only query the store, and not attempt any ingesters. This is useful for
* running a standalone querier pool operating only against stored data.
* CLI flag: -querier.query-store-only
* @default true
*/
query_store_only?: boolean;
/**
* When true, queriers only query the ingesters, and not stored data. This is
* useful when the object store is unavailable.
* CLI flag: -querier.query-ingester-only
* @default true
*/
query_ingester_only?: boolean;
/**
* When true, allow queries to span multiple tenants.
* CLI flag: -querier.multi-tenant-queries-enabled
* @default true
*/
multi_tenant_queries_enabled?: boolean;
/**
* When true, querier limits sent via a header are enforced.
* CLI flag: -querier.per-request-limits-enabled
* @default true
*/
per_request_limits_enabled?: boolean;
};
/**
* The `query_range` block configures the query splitting and caching in the Loki query-frontend.
*/
export type query_range = {
/**
* Mutate incoming queries to align their start and end with their step.
* CLI flag: -querier.align-querier-with-step
* @default true
*/
align_queries_with_step?: boolean;
results_cache?: {
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is: frontend
*/
cache?: cache_config;
/**
* Use compression in cache. The default is an empty value '', which disables
* compression. Supported values are: 'snappy' and ''.
* CLI flag: -frontend.compression
* @default ""
*/
compression?: string;
};
/**
* Cache query results.
* CLI flag: -querier.cache-results
* @default true
*/
cache_results?: boolean;
/**
* Maximum number of retries for a single request; beyond this, the downstream
* error is returned.
* CLI flag: -querier.max-retries-per-request
* @default 5
*/
max_retries?: int;
/**
* Perform query parallelisations based on storage sharding configuration and
* query ASTs. This feature is supported only by the chunks storage engine.
* CLI flag: -querier.parallelise-shardable-queries
* @default true
*/
parallelise_shardable_queries?: boolean;
/**
* A comma-separated list of LogQL vector and range aggregations that should be
* sharded. Possible values 'quantile_over_time', 'last_over_time',
* 'first_over_time'.
* CLI flag: -querier.shard-aggregations
* @default ""
*/
shard_aggregations?: string;
/**
* Cache index stats query results.
* CLI flag: -querier.cache-index-stats-results
* @default true
*/
cache_index_stats_results?: boolean;
/**
* If a cache config is not specified and cache_index_stats_results is true, the
* config for the results cache is used.
*/
index_stats_results_cache?: {
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is:
* frontend.index-stats-results-cache
*/
cache?: cache_config;
/**
* Use compression in cache. The default is an empty value '', which disables
* compression. Supported values are: 'snappy' and ''.
* CLI flag: -frontend.index-stats-results-cache.compression
* @default ""
*/
compression?: string;
};
/**
* Cache volume query results.
* CLI flag: -querier.cache-volume-results
* @default true
*/
cache_volume_results?: boolean;
/**
* If a cache config is not specified and cache_volume_results is true, the
* config for the results cache is used.
*/
volume_results_cache?: {
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is:
* frontend.volume-results-cache
*/
cache?: cache_config;
/**
* Use compression in cache. The default is an empty value '', which disables
* compression. Supported values are: 'snappy' and ''.
* CLI flag: -frontend.volume-results-cache.compression
* @default ""
*/
compression?: string;
};
/**
* Cache instant metric query results.
* CLI flag: -querier.cache-instant-metric-results
* @default true
*/
cache_instant_metric_results?: boolean;
/**
* If a cache config is not specified and cache_instant_metric_results is true,
* the config for the results cache is used.
*/
instant_metric_results_cache?: {
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is:
* frontend.instant-metric-results-cache
*/
cache?: cache_config;
/**
* Use compression in cache. The default is an empty value '', which disables
* compression. Supported values are: 'snappy' and ''.
* CLI flag: -frontend.instant-metric-results-cache.compression
* @default ""
*/
compression?: string;
};
/**
* Whether to align the splits of instant metric query with splitByInterval and
* query's exec time. Useful when instant_metric_cache is enabled
* CLI flag: -querier.instant-metric-query-split-align
* @default true
*/
instant_metric_query_split_align?: boolean;
/**
* Cache series query results.
* CLI flag: -querier.cache-series-results
* @default true
*/
cache_series_results?: boolean;
/**
* If series_results_cache is not configured and cache_series_results is true,
* the config for the results cache is used.
*/
series_results_cache?: {
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is:
* frontend.series-results-cache
*/
cache?: cache_config;
/**
* Use compression in cache. The default is an empty value '', which disables
* compression. Supported values are: 'snappy' and ''.
* CLI flag: -frontend.series-results-cache.compression
* @default ""
*/
compression?: string;
};
/**
* Cache label query results.
* CLI flag: -querier.cache-label-results
* @default true
*/
cache_label_results?: boolean;
/**
* If label_results_cache is not configured and cache_label_results is true, the
* config for the results cache is used.
*/
label_results_cache?: {
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is:
* frontend.label-results-cache
*/
cache?: cache_config;
/**
* Use compression in cache. The default is an empty value '', which disables
* compression. Supported values are: 'snappy' and ''.
* CLI flag: -frontend.label-results-cache.compression
* @default ""
*/
compression?: string;
};
};
/**
* The `query_scheduler` block configures the Loki query scheduler. When configured it separates the tenant query queues from the query-frontend.
*/
export type query_scheduler = {
/**
* Maximum number of outstanding requests per tenant per query-scheduler.
* In-flight requests above this limit will fail with HTTP response status code
* 429.
* CLI flag: -query-scheduler.max-outstanding-requests-per-tenant
* @default 32000
*/
max_outstanding_requests_per_tenant?: int;
/**
* Maximum number of levels of nesting of hierarchical queues. 0 means that
* hierarchical queues are disabled.
* CLI flag: -query-scheduler.max-queue-hierarchy-levels
* @default 3
*/
max_queue_hierarchy_levels?: int;
/**
* If a querier disconnects without sending notification about graceful shutdown,
* the query-scheduler will keep the querier in the tenant's shard until the
* forget delay has passed. This feature is useful to reduce the blast radius
* when shuffle-sharding is enabled.
* CLI flag: -query-scheduler.querier-forget-delay
* @default "0s"
*/
querier_forget_delay?: duration;
/**
* This configures the gRPC client used to report errors back to the
* query-frontend.
* The CLI flags prefix for this block configuration is:
* query-scheduler.grpc-client-config
*/
grpc_client_config?: grpc_client;
/**
* Set to true to have the query schedulers create and place themselves in a
* ring. If no frontend_address or scheduler_address are present anywhere else in
* the configuration, Loki will toggle this value to true.
* CLI flag: -query-scheduler.use-scheduler-ring
* @default true
*/
use_scheduler_ring?: boolean;
/**
* The hash ring configuration. This option is required only if
* use_scheduler_ring is true.
*/
scheduler_ring?: {
kvstore?: {
/**
* Backend storage to use for the ring. Supported values are: consul, etcd,
* inmemory, memberlist, multi.
* CLI flag: -query-scheduler.ring.store
* @default "consul"
*/
store?: string;
/**
* The prefix for the keys in the store. Should end with a /.
* CLI flag: -query-scheduler.ring.prefix
* @default "collectors/"
*/
prefix?: string;
/**
* Configuration for a Consul client. Only applies if the selected kvstore is
* consul.
* The CLI flags prefix for this block configuration is: query-scheduler.ring
*/
consul?: consul;
/**
* Configuration for an ETCD v3 client. Only applies if the selected kvstore
* is etcd.
* The CLI flags prefix for this block configuration is: query-scheduler.ring
*/
etcd?: etcd;
multi?: {
/**
* Primary backend storage used by multi-client.
* CLI flag: -query-scheduler.ring.multi.primary
* @default ""
*/
primary?: string;
/**
* Secondary backend storage used by multi-client.
* CLI flag: -query-scheduler.ring.multi.secondary
* @default ""
*/
secondary?: string;
/**
* Mirror writes to secondary store.
* CLI flag: -query-scheduler.ring.multi.mirror-enabled
* @default true
*/
mirror_enabled?: boolean;
/**
* Timeout for storing value to secondary store.
* CLI flag: -query-scheduler.ring.multi.mirror-timeout
* @default "2s"
*/
mirror_timeout?: duration;
};
};
/**
* Period at which to heartbeat to the ring. 0 = disabled.
* CLI flag: -query-scheduler.ring.heartbeat-period
* @default "15s"
*/
heartbeat_period?: duration;
/**
* The heartbeat timeout after which compactors are considered unhealthy within
* the ring. 0 = never (timeout disabled).
* CLI flag: -query-scheduler.ring.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* File path where tokens are stored. If empty, tokens are not stored at
* shutdown and restored at startup.
* CLI flag: -query-scheduler.ring.tokens-file-path
* @default ""
*/
tokens_file_path?: string;
/**
* True to enable zone-awareness and replicate blocks across different
* availability zones.
* CLI flag: -query-scheduler.ring.zone-awareness-enabled
* @default true
*/
zone_awareness_enabled?: boolean;
/**
* Instance ID to register in the ring.
* CLI flag: -query-scheduler.ring.instance-id
* @default "<hostname>"
*/
instance_id?: string;
/**
* Name of network interface to read address from.
* CLI flag: -query-scheduler.ring.instance-interface-names
* @default "[<private network interfaces>]"
*/
instance_interface_names?: string[];
/**
* Port to advertise in the ring (defaults to server.grpc-listen-port).
* CLI flag: -query-scheduler.ring.instance-port
* @default 0
*/
instance_port?: int;
/**
* IP address to advertise in the ring.
* CLI flag: -query-scheduler.ring.instance-addr
* @default ""
*/
instance_addr?: string;
/**
* The availability zone where this instance is running. Required if
* zone-awareness is enabled.
* CLI flag: -query-scheduler.ring.instance-availability-zone
* @default ""
*/
instance_availability_zone?: string;
/**
* Enable using a IPv6 instance address.
* CLI flag: -query-scheduler.ring.instance-enable-ipv6
* @default true
*/
instance_enable_ipv6?: boolean;
};
};
/**
* The `ruler` block configures the Loki ruler.
*/
export type ruler = {
/**
* Base URL of the Grafana instance.
* CLI flag: -ruler.external.url
*/
external_url?: url;
/**
* Datasource UID for the dashboard.
* CLI flag: -ruler.datasource-uid
* @default ""
*/
datasource_uid?: string;
/**
* Labels to add to all alerts.
*/
external_labels?: Label[];
/**
* The grpc_client block configures the gRPC client used to communicate between a
* client and server component in Loki.
* The CLI flags prefix for this block configuration is: ruler.client
*/
ruler_client?: grpc_client;
/**
* How frequently to evaluate rules.
* CLI flag: -ruler.evaluation-interval
* @default "1m"
*/
evaluation_interval?: duration;
/**
* How frequently to poll for rule changes.
* CLI flag: -ruler.poll-interval
* @default "1m"
*/
poll_interval?: duration;
/**
* Deprecated: Use -ruler-storage. CLI flags and their respective YAML config
* options instead.
* @deprecated
*/
storage?: {
/**
* Method to use for backend rule storage (configdb, azure, gcs, s3, swift,
* local, bos, cos)
* CLI flag: -ruler.storage.type
* @default ""
*/
type?: string;
/**
* Configures backend rule storage for Azure.
* The CLI flags prefix for this block configuration is: ruler.storage
*/
azure?: azure_storage_config;
/**
* Configures backend rule storage for AlibabaCloud Object Storage (OSS).
* The CLI flags prefix for this block configuration is: ruler
*/
alibabacloud?: alibabacloud_storage_config;
/**
* Configures backend rule storage for GCS.
* The CLI flags prefix for this block configuration is: ruler.storage
*/
gcs?: gcs_storage_config;
/**
* Configures backend rule storage for S3.
* The CLI flags prefix for this block configuration is: ruler
*/
s3?: s3_storage_config;
/**
* Configures backend rule storage for Baidu Object Storage (BOS).
* The CLI flags prefix for this block configuration is: ruler.storage
*/
bos?: bos_storage_config;
/**
* Configures backend rule storage for Swift.
* The CLI flags prefix for this block configuration is: ruler.storage
*/
swift?: swift_storage_config;
/**
* Configures backend rule storage for IBM Cloud Object Storage (COS).
* The CLI flags prefix for this block configuration is: ruler.storage
*/
cos?: cos_storage_config;
/**
* Configures backend rule storage for a local file system directory.
*/
local?: {
/**
* Directory to scan for rules
* CLI flag: -ruler.storage.local.directory
* @default ""
*/
directory?: string;
};
};
/**
* File path to store temporary rule files.
* CLI flag: -ruler.rule-path
* @default "/rules"
*/
rule_path?: string;
/**
* Comma-separated list of Alertmanager URLs to send notifications to. Each
* Alertmanager URL is treated as a separate group in the configuration. Multiple
* Alertmanagers in HA per group can be supported by using DNS resolution via
* '-ruler.alertmanager-discovery'.
* CLI flag: -ruler.alertmanager-url
* @default ""
*/
alertmanager_url?: string;
/**
* Use DNS SRV records to discover Alertmanager hosts.
* CLI flag: -ruler.alertmanager-discovery
* @default true
*/
enable_alertmanager_discovery?: boolean;
/**
* How long to wait between refreshing DNS resolutions of Alertmanager hosts.
* CLI flag: -ruler.alertmanager-refresh-interval
* @default "1m"
*/
alertmanager_refresh_interval?: duration;
/**
* If enabled requests to Alertmanager will utilize the V2 API.
* CLI flag: -ruler.alertmanager-use-v2
* @default true
*/
enable_alertmanager_v2?: boolean;
/**
* List of alert relabel configs.
*/
alert_relabel_configs?: relabel_config[];
/**
* Capacity of the queue for notifications to be sent to the Alertmanager.
* CLI flag: -ruler.notification-queue-capacity
* @default 10000
*/
notification_queue_capacity?: int;
/**
* HTTP timeout duration when sending notifications to the Alertmanager.
* CLI flag: -ruler.notification-timeout
* @default "10s"
*/
notification_timeout?: duration;
alertmanager_client?: {
/**
* Path to the client certificate, which will be used for authenticating with
* the server. Also requires the key path to be configured.
* CLI flag: -ruler.alertmanager-client.tls-cert-path
* @default ""
*/
tls_cert_path?: string;
/**
* Path to the key for the client certificate. Also requires the client
* certificate to be configured.
* CLI flag: -ruler.alertmanager-client.tls-key-path
* @default ""
*/
tls_key_path?: string;
/**
* Path to the CA certificates to validate server certificate against. If not
* set, the host's root CA certificates are used.
* CLI flag: -ruler.alertmanager-client.tls-ca-path
* @default ""
*/
tls_ca_path?: string;
/**
* Override the expected name on the server certificate.
* CLI flag: -ruler.alertmanager-client.tls-server-name
* @default ""
*/
tls_server_name?: string;
/**
* Skip validating server certificate.
* CLI flag: -ruler.alertmanager-client.tls-insecure-skip-verify
* @default true
*/
tls_insecure_skip_verify?: boolean;
/**
* Override the default cipher suite list (separated by commas). Allowed
* values:
*
* Secure Ciphers:
* - TLS_AES_128_GCM_SHA256
* - TLS_AES_256_GCM_SHA384
* - TLS_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
*
* Insecure Ciphers:
* - TLS_RSA_WITH_RC4_128_SHA
* - TLS_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA
* - TLS_RSA_WITH_AES_256_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA256
* - TLS_RSA_WITH_AES_128_GCM_SHA256
* - TLS_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* CLI flag: -ruler.alertmanager-client.tls-cipher-suites
* @default ""
*/
tls_cipher_suites?: string;
/**
* Override the default minimum TLS version. Allowed values: VersionTLS10,
* VersionTLS11, VersionTLS12, VersionTLS13
* CLI flag: -ruler.alertmanager-client.tls-min-version
* @default ""
*/
tls_min_version?: string;
/**
* HTTP Basic authentication username. It overrides the username set in the URL
* (if any).
* CLI flag: -ruler.alertmanager-client.basic-auth-username
* @default ""
*/
basic_auth_username?: string;
/**
* HTTP Basic authentication password. It overrides the password set in the URL
* (if any).
* CLI flag: -ruler.alertmanager-client.basic-auth-password
* @default ""
*/
basic_auth_password?: string;
/**
* HTTP Header authorization type (default: Bearer).
* CLI flag: -ruler.alertmanager-client.type
* @default "Bearer"
*/
type?: string;
/**
* HTTP Header authorization credentials.
* CLI flag: -ruler.alertmanager-client.credentials
* @default ""
*/
credentials?: string;
/**
* HTTP Header authorization credentials file.
* CLI flag: -ruler.alertmanager-client.credentials-file
* @default ""
*/
credentials_file?: string;
};
/**
* Max time to tolerate outage for restoring "for" state of alert.
* CLI flag: -ruler.for-outage-tolerance
* @default "1h"
*/
for_outage_tolerance?: duration;
/**
* Minimum duration between alert and restored "for" state. This is maintained
* only for alerts with configured "for" time greater than the grace period.
* CLI flag: -ruler.for-grace-period
* @default "10m"
*/
for_grace_period?: duration;
/**
* Minimum amount of time to wait before resending an alert to Alertmanager.
* CLI flag: -ruler.resend-delay
* @default "1m"
*/
resend_delay?: duration;
/**
* Distribute rule evaluation using ring backend.
* CLI flag: -ruler.enable-sharding
* @default true
*/
enable_sharding?: boolean;
/**
* The sharding strategy to use. Supported values are: default, shuffle-sharding.
* CLI flag: -ruler.sharding-strategy
* @default "default"
*/
sharding_strategy?: string;
/**
* The sharding algorithm to use for deciding how rules & groups are sharded.
* Supported values are: by-group, by-rule.
* CLI flag: -ruler.sharding-algo
* @default "by-group"
*/
sharding_algo?: string;
/**
* Time to spend searching for a pending ruler when shutting down.
* CLI flag: -ruler.search-pending-for
* @default "5m"
*/
search_pending_for?: duration;
/**
* Ring used by Loki ruler. The CLI flags prefix for this block configuration is
* 'ruler.ring'.
*/
ring?: {
kvstore?: {
/**
* Backend storage to use for the ring. Supported values are: consul, etcd,
* inmemory, memberlist, multi.
* CLI flag: -ruler.ring.store
* @default "consul"
*/
store?: string;
/**
* The prefix for the keys in the store. Should end with a /.
* CLI flag: -ruler.ring.prefix
* @default "rulers/"
*/
prefix?: string;
/**
* Configuration for a Consul client. Only applies if the selected kvstore is
* consul.
* The CLI flags prefix for this block configuration is: ruler.ring
*/
consul?: consul;
/**
* Configuration for an ETCD v3 client. Only applies if the selected kvstore
* is etcd.
* The CLI flags prefix for this block configuration is: ruler.ring
*/
etcd?: etcd;
multi?: {
/**
* Primary backend storage used by multi-client.
* CLI flag: -ruler.ring.multi.primary
* @default ""
*/
primary?: string;
/**
* Secondary backend storage used by multi-client.
* CLI flag: -ruler.ring.multi.secondary
* @default ""
*/
secondary?: string;
/**
* Mirror writes to secondary store.
* CLI flag: -ruler.ring.multi.mirror-enabled
* @default true
*/
mirror_enabled?: boolean;
/**
* Timeout for storing value to secondary store.
* CLI flag: -ruler.ring.multi.mirror-timeout
* @default "2s"
*/
mirror_timeout?: duration;
};
};
/**
* Interval between heartbeats sent to the ring. 0 = disabled.
* CLI flag: -ruler.ring.heartbeat-period
* @default "5s"
*/
heartbeat_period?: duration;
/**
* The heartbeat timeout after which ruler ring members are considered
* unhealthy within the ring. 0 = never (timeout disabled).
* CLI flag: -ruler.ring.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* Name of network interface to read addresses from.
* CLI flag: -ruler.ring.instance-interface-names
* @default "[<private network interfaces>]"
*/
instance_interface_names?: string[];
/**
* The number of tokens the lifecycler will generate and put into the ring if
* it joined without transferring tokens from another lifecycler.
* CLI flag: -ruler.ring.num-tokens
* @default 128
*/
num_tokens?: int;
};
/**
* Period with which to attempt to flush rule groups.
* CLI flag: -ruler.flush-period
* @default "1m"
*/
flush_period?: duration;
/**
* Enable the ruler API.
* CLI flag: -ruler.enable-api
* @default true
*/
enable_api?: boolean;
/**
* Comma separated list of tenants whose rules this ruler can evaluate. If
* specified, only these tenants will be handled by ruler, otherwise this ruler
* can process rules from all tenants. Subject to sharding.
* CLI flag: -ruler.enabled-tenants
* @default ""
*/
enabled_tenants?: string;
/**
* Comma separated list of tenants whose rules this ruler cannot evaluate. If
* specified, a ruler that would normally pick the specified tenant(s) for
* processing will ignore them instead. Subject to sharding.
* CLI flag: -ruler.disabled-tenants
* @default ""
*/
disabled_tenants?: string;
/**
* Report the wall time for ruler queries to complete as a per user metric and as
* an info level log message.
* CLI flag: -ruler.query-stats-enabled
* @default true
*/
query_stats_enabled?: boolean;
/**
* Disable the rule_group label on exported metrics.
* CLI flag: -ruler.disable-rule-group-label
* @default true
*/
disable_rule_group_label?: boolean;
wal?: {
/**
* The directory in which to write tenant WAL files. Each tenant will have its
* own directory one level below this directory.
* CLI flag: -ruler.wal.dir
* @default "ruler-wal"
*/
dir?: string;
/**
* Frequency with which to run the WAL truncation process.
* CLI flag: -ruler.wal.truncate-frequency
* @default "1h"
*/
truncate_frequency?: duration;
/**
* Minimum age that samples must exist in the WAL before being truncated.
* CLI flag: -ruler.wal.min-age
* @default "5m"
*/
min_age?: duration;
/**
* Maximum age that samples must exist in the WAL before being truncated.
* CLI flag: -ruler.wal.max-age
* @default "4h"
*/
max_age?: duration;
};
wal_cleaner?: {
/**
* The minimum age of a WAL to consider for cleaning.
* CLI flag: -ruler.wal-cleaner.min-age
* @default "12h"
*/
min_age?: duration;
/**
* How often to run the WAL cleaner. 0 = disabled.
* CLI flag: -ruler.wal-cleaner.period
* @default "0s"
*/
period?: duration;
};
/**
* Remote-write configuration to send rule samples to a Prometheus remote-write
* endpoint.
*/
remote_write?: {
/**
* Deprecated: Use 'clients' instead. Configure remote write client.
* @deprecated
*/
client?: RemoteWriteConfig;
/**
* Configure remote write clients. A map with remote client id as key.
*/
clients?: Record<string, RemoteWriteConfig>;
/**
* Enable remote-write functionality.
* CLI flag: -ruler.remote-write.enabled
* @default true
*/
enabled?: boolean;
/**
* Minimum period to wait between refreshing remote-write reconfigurations.
* This should be greater than or equivalent to
* -limits.per-user-override-period.
* CLI flag: -ruler.remote-write.config-refresh-period
* @default "10s"
*/
config_refresh_period?: duration;
/**
* Add X-Scope-OrgID header in remote write requests.
* CLI flag: -ruler.remote-write.add-org-id-header
* @default true
*/
add_org_id_header?: boolean;
};
/**
* Configuration for rule evaluation.
*/
evaluation?: {
/**
* The evaluation mode for the ruler. Can be either 'local' or 'remote'. If set
* to 'local', the ruler will evaluate rules locally. If set to 'remote', the
* ruler will evaluate rules remotely. If unset, the ruler will evaluate rules
* locally.
* CLI flag: -ruler.evaluation.mode
* @default "local"
*/
mode?: string;
/**
* Upper bound of random duration to wait before rule evaluation to avoid
* contention during concurrent execution of rules. Jitter is calculated
* consistently for a given rule. Set 0 to disable (default).
* CLI flag: -ruler.evaluation.max-jitter
* @default "0s"
*/
max_jitter?: duration;
query_frontend?: {
/**
* GRPC listen address of the query-frontend(s). Must be a DNS address
* (prefixed with dns:///) to enable client side load balancing.
* CLI flag: -ruler.evaluation.query-frontend.address
* @default ""
*/
address?: string;
/**
* Set to true if query-frontend connection requires TLS.
* CLI flag: -ruler.evaluation.query-frontend.tls-enabled
* @default true
*/
tls_enabled?: boolean;
/**
* Path to the client certificate, which will be used for authenticating with
* the server. Also requires the key path to be configured.
* CLI flag: -ruler.evaluation.query-frontend.tls-cert-path
* @default ""
*/
tls_cert_path?: string;
/**
* Path to the key for the client certificate. Also requires the client
* certificate to be configured.
* CLI flag: -ruler.evaluation.query-frontend.tls-key-path
* @default ""
*/
tls_key_path?: string;
/**
* Path to the CA certificates to validate server certificate against. If not
* set, the host's root CA certificates are used.
* CLI flag: -ruler.evaluation.query-frontend.tls-ca-path
* @default ""
*/
tls_ca_path?: string;
/**
* Override the expected name on the server certificate.
* CLI flag: -ruler.evaluation.query-frontend.tls-server-name
* @default ""
*/
tls_server_name?: string;
/**
* Skip validating server certificate.
* CLI flag: -ruler.evaluation.query-frontend.tls-insecure-skip-verify
* @default true
*/
tls_insecure_skip_verify?: boolean;
/**
* Override the default cipher suite list (separated by commas). Allowed
* values:
*
* Secure Ciphers:
* - TLS_AES_128_GCM_SHA256
* - TLS_AES_256_GCM_SHA384
* - TLS_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
*
* Insecure Ciphers:
* - TLS_RSA_WITH_RC4_128_SHA
* - TLS_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA
* - TLS_RSA_WITH_AES_256_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA256
* - TLS_RSA_WITH_AES_128_GCM_SHA256
* - TLS_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* CLI flag: -ruler.evaluation.query-frontend.tls-cipher-suites
* @default ""
*/
tls_cipher_suites?: string;
/**
* Override the default minimum TLS version. Allowed values: VersionTLS10,
* VersionTLS11, VersionTLS12, VersionTLS13
* CLI flag: -ruler.evaluation.query-frontend.tls-min-version
* @default ""
*/
tls_min_version?: string;
};
};
};
/**
* Configuration for 'runtime config' module, responsible for reloading runtime configuration file.
*/
export type runtime_config = {
/**
* How often to check runtime config files.
* CLI flag: -runtime-config.reload-period
* @default "10s"
*/
period?: duration;
/**
* Comma separated list of yaml files with the configuration that can be updated
* at runtime. Runtime config files will be merged from left to right.
* CLI flag: -runtime-config.file
* @default ""
*/
file?: string;
};
/**
* The `s3_storage_config` block configures the connection to Amazon S3 object storage backend. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `common`
* - `ruler`
*
* &nbsp;
*/
export type s3_storage_config = {
/**
* S3 endpoint URL with escaped Key and Secret encoded. If only region is
* specified as a host, proper endpoint will be deduced. Use
* inmemory:///<bucket-name> to use a mock in-memory implementation.
* CLI flag: -<prefix>.storage.s3.url
*/
s3?: url;
/**
* Set this to `true` to force the request to use path-style addressing.
* CLI flag: -<prefix>.storage.s3.force-path-style
* @default true
*/
s3forcepathstyle?: boolean;
/**
* Comma separated list of bucket names to evenly distribute chunks over.
* Overrides any buckets specified in s3.url flag
* CLI flag: -<prefix>.storage.s3.buckets
* @default ""
*/
bucketnames?: string;
/**
* S3 Endpoint to connect to.
* CLI flag: -<prefix>.storage.s3.endpoint
* @default ""
*/
endpoint?: string;
/**
* AWS region to use.
* CLI flag: -<prefix>.storage.s3.region
* @default ""
*/
region?: string;
/**
* AWS Access Key ID
* CLI flag: -<prefix>.storage.s3.access-key-id
* @default ""
*/
access_key_id?: string;
/**
* AWS Secret Access Key
* CLI flag: -<prefix>.storage.s3.secret-access-key
* @default ""
*/
secret_access_key?: string;
/**
* AWS Session Token
* CLI flag: -<prefix>.storage.s3.session-token
* @default ""
*/
session_token?: string;
/**
* Disable https on s3 connection.
* CLI flag: -<prefix>.storage.s3.insecure
* @default true
*/
insecure?: boolean;
http_config?: {
/**
* Timeout specifies a time limit for requests made by s3 Client.
* CLI flag: -<prefix>.storage.s3.http.timeout
* @default "0s"
*/
timeout?: duration;
/**
* The maximum amount of time an idle connection will be held open.
* CLI flag: -<prefix>.storage.s3.http.idle-conn-timeout
* @default "1m30s"
*/
idle_conn_timeout?: duration;
/**
* If non-zero, specifies the amount of time to wait for a server's response
* headers after fully writing the request.
* CLI flag: -<prefix>.storage.s3.http.response-header-timeout
* @default "0s"
*/
response_header_timeout?: duration;
/**
* Set to true to skip verifying the certificate chain and hostname.
* CLI flag: -<prefix>.storage.s3.http.insecure-skip-verify
* @default true
*/
insecure_skip_verify?: boolean;
/**
* Path to the trusted CA file that signed the SSL certificate of the S3
* endpoint.
* CLI flag: -<prefix>.storage.s3.http.ca-file
* @default ""
*/
ca_file?: string;
};
/**
* The signature version to use for authenticating against S3. Supported values
* are: v4.
* CLI flag: -<prefix>.storage.s3.signature-version
* @default "v4"
*/
signature_version?: string;
/**
* The S3 storage class which objects will use. Supported values are: GLACIER,
* DEEP_ARCHIVE, GLACIER_IR, INTELLIGENT_TIERING, ONEZONE_IA, OUTPOSTS,
* REDUCED_REDUNDANCY, STANDARD, STANDARD_IA.
* CLI flag: -<prefix>.storage.s3.storage-class
* @default "STANDARD"
*/
storage_class?: string;
sse?: {
/**
* Enable AWS Server Side Encryption. Supported values: SSE-KMS, SSE-S3.
* CLI flag: -<prefix>.storage.s3.sse.type
* @default ""
*/
type?: string;
/**
* KMS Key ID used to encrypt objects in S3
* CLI flag: -<prefix>.storage.s3.sse.kms-key-id
* @default ""
*/
kms_key_id?: string;
/**
* KMS Encryption Context used for object encryption. It expects JSON formatted
* string.
* CLI flag: -<prefix>.storage.s3.sse.kms-encryption-context
* @default ""
*/
kms_encryption_context?: string;
};
/**
* Configures back off when S3 get Object.
*/
backoff_config?: {
/**
* Minimum backoff time when s3 get Object
* CLI flag: -<prefix>.storage.s3.min-backoff
* @default "100ms"
*/
min_period?: duration;
/**
* Maximum backoff time when s3 get Object
* CLI flag: -<prefix>.storage.s3.max-backoff
* @default "3s"
*/
max_period?: duration;
/**
* Maximum number of times to retry when s3 get Object
* CLI flag: -<prefix>.storage.s3.max-retries
* @default 5
*/
max_retries?: int;
};
};
/**
* Configures the chunk index schema and where it is stored.
*/
export type schema_config = {
configs?: period_config[];
};
/**
* Configures the `server` of the launched module(s).
*/
export type server = {
/**
* HTTP server listen network, default tcp
* CLI flag: -server.http-listen-network
* @default "tcp"
*/
http_listen_network?: string;
/**
* HTTP server listen address.
* CLI flag: -server.http-listen-address
* @default ""
*/
http_listen_address?: string;
/**
* HTTP server listen port.
* CLI flag: -server.http-listen-port
* @default 3100
*/
http_listen_port?: int;
/**
* Maximum number of simultaneous http connections, <=0 to disable
* CLI flag: -server.http-conn-limit
* @default 0
*/
http_listen_conn_limit?: int;
/**
* gRPC server listen network
* CLI flag: -server.grpc-listen-network
* @default "tcp"
*/
grpc_listen_network?: string;
/**
* gRPC server listen address.
* CLI flag: -server.grpc-listen-address
* @default ""
*/
grpc_listen_address?: string;
/**
* gRPC server listen port.
* CLI flag: -server.grpc-listen-port
* @default 9095
*/
grpc_listen_port?: int;
/**
* Maximum number of simultaneous grpc connections, <=0 to disable
* CLI flag: -server.grpc-conn-limit
* @default 0
*/
grpc_listen_conn_limit?: int;
/**
* Comma-separated list of cipher suites to use. If blank, the default Go cipher
* suites is used.
* CLI flag: -server.tls-cipher-suites
* @default ""
*/
tls_cipher_suites?: string;
/**
* Minimum TLS version to use. Allowed values: VersionTLS10, VersionTLS11,
* VersionTLS12, VersionTLS13. If blank, the Go TLS minimum version is used.
* CLI flag: -server.tls-min-version
* @default ""
*/
tls_min_version?: string;
http_tls_config?: {
/**
* Server TLS certificate. This configuration parameter is YAML only.
* @default ""
*/
cert?: string;
/**
* Server TLS key. This configuration parameter is YAML only.
* @default ""
*/
key?: string;
/**
* Root certificate authority used to verify client certificates. This
* configuration parameter is YAML only.
* @default ""
*/
client_ca?: string;
/**
* HTTP server cert path.
* CLI flag: -server.http-tls-cert-path
* @default ""
*/
cert_file?: string;
/**
* HTTP server key path.
* CLI flag: -server.http-tls-key-path
* @default ""
*/
key_file?: string;
/**
* HTTP TLS Client Auth type.
* CLI flag: -server.http-tls-client-auth
* @default ""
*/
client_auth_type?: string;
/**
* HTTP TLS Client CA path.
* CLI flag: -server.http-tls-ca-path
* @default ""
*/
client_ca_file?: string;
};
grpc_tls_config?: {
/**
* Server TLS certificate. This configuration parameter is YAML only.
* @default ""
*/
cert?: string;
/**
* Server TLS key. This configuration parameter is YAML only.
* @default ""
*/
key?: string;
/**
* Root certificate authority used to verify client certificates. This
* configuration parameter is YAML only.
* @default ""
*/
client_ca?: string;
/**
* GRPC TLS server cert path.
* CLI flag: -server.grpc-tls-cert-path
* @default ""
*/
cert_file?: string;
/**
* GRPC TLS server key path.
* CLI flag: -server.grpc-tls-key-path
* @default ""
*/
key_file?: string;
/**
* GRPC TLS Client Auth type.
* CLI flag: -server.grpc-tls-client-auth
* @default ""
*/
client_auth_type?: string;
/**
* GRPC TLS Client CA path.
* CLI flag: -server.grpc-tls-ca-path
* @default ""
*/
client_ca_file?: string;
};
/**
* Register the intrumentation handlers (/metrics etc).
* CLI flag: -server.register-instrumentation
* @default true
*/
register_instrumentation?: boolean;
/**
* If set to true, gRPC statuses will be reported in instrumentation labels with
* their string representations. Otherwise, they will be reported as "error".
* CLI flag: -server.report-grpc-codes-in-instrumentation-label-enabled
* @default true
*/
report_grpc_codes_in_instrumentation_label_enabled?: boolean;
/**
* Timeout for graceful shutdowns
* CLI flag: -server.graceful-shutdown-timeout
* @default "30s"
*/
graceful_shutdown_timeout?: duration;
/**
* Read timeout for entire HTTP request, including headers and body.
* CLI flag: -server.http-read-timeout
* @default "30s"
*/
http_server_read_timeout?: duration;
/**
* Read timeout for HTTP request headers. If set to 0, value of
* -server.http-read-timeout is used.
* CLI flag: -server.http-read-header-timeout
* @default "0s"
*/
http_server_read_header_timeout?: duration;
/**
* Write timeout for HTTP server
* CLI flag: -server.http-write-timeout
* @default "30s"
*/
http_server_write_timeout?: duration;
/**
* Idle timeout for HTTP server
* CLI flag: -server.http-idle-timeout
* @default "2m"
*/
http_server_idle_timeout?: duration;
/**
* Log closed connections that did not receive any response, most likely because
* client didn't send any request within timeout.
* CLI flag: -server.http-log-closed-connections-without-response-enabled
* @default true
*/
http_log_closed_connections_without_response_enabled?: boolean;
/**
* Limit on the size of a gRPC message this server can receive (bytes).
* CLI flag: -server.grpc-max-recv-msg-size-bytes
* @default 4194304
*/
grpc_server_max_recv_msg_size?: int;
/**
* Limit on the size of a gRPC message this server can send (bytes).
* CLI flag: -server.grpc-max-send-msg-size-bytes
* @default 4194304
*/
grpc_server_max_send_msg_size?: int;
/**
* Limit on the number of concurrent streams for gRPC calls per client connection
* (0 = unlimited)
* CLI flag: -server.grpc-max-concurrent-streams
* @default 100
*/
grpc_server_max_concurrent_streams?: int;
/**
* The duration after which an idle connection should be closed. Default:
* infinity
* CLI flag: -server.grpc.keepalive.max-connection-idle
* @default "2562047h47m16.854775807s"
*/
grpc_server_max_connection_idle?: duration;
/**
* The duration for the maximum amount of time a connection may exist before it
* will be closed. Default: infinity
* CLI flag: -server.grpc.keepalive.max-connection-age
* @default "2562047h47m16.854775807s"
*/
grpc_server_max_connection_age?: duration;
/**
* An additive period after max-connection-age after which the connection will be
* forcibly closed. Default: infinity
* CLI flag: -server.grpc.keepalive.max-connection-age-grace
* @default "2562047h47m16.854775807s"
*/
grpc_server_max_connection_age_grace?: duration;
/**
* Duration after which a keepalive probe is sent in case of no activity over the
* connection., Default: 2h
* CLI flag: -server.grpc.keepalive.time
* @default "2h"
*/
grpc_server_keepalive_time?: duration;
/**
* After having pinged for keepalive check, the duration after which an idle
* connection should be closed, Default: 20s
* CLI flag: -server.grpc.keepalive.timeout
* @default "20s"
*/
grpc_server_keepalive_timeout?: duration;
/**
* Minimum amount of time a client should wait before sending a keepalive ping.
* If client sends keepalive ping more often, server will send GOAWAY and close
* the connection.
* CLI flag: -server.grpc.keepalive.min-time-between-pings
* @default "10s"
*/
grpc_server_min_time_between_pings?: duration;
/**
* If true, server allows keepalive pings even when there are no active
* streams(RPCs). If false, and client sends ping when there are no active
* streams, server will send GOAWAY and close the connection.
* CLI flag: -server.grpc.keepalive.ping-without-stream-allowed
* @default true
*/
grpc_server_ping_without_stream_allowed?: boolean;
/**
* If non-zero, configures the amount of GRPC server workers used to serve the
* requests.
* CLI flag: -server.grpc.num-workers
* @default 0
*/
grpc_server_num_workers?: int;
/**
* Output log messages in the given format. Valid formats: [logfmt, json]
* CLI flag: -log.format
* @default "logfmt"
*/
log_format?: string;
/**
* Only log messages with the given severity or above. Valid levels: [debug,
* info, warn, error]
* CLI flag: -log.level
* @default "info"
*/
log_level?: string;
/**
* Optionally log the source IPs.
* CLI flag: -server.log-source-ips-enabled
* @default true
*/
log_source_ips_enabled?: boolean;
/**
* Header field storing the source IPs. Only used if
* server.log-source-ips-enabled is true. If not set the default Forwarded,
* X-Real-IP and X-Forwarded-For headers are used
* CLI flag: -server.log-source-ips-header
* @default ""
*/
log_source_ips_header?: string;
/**
* Regex for matching the source IPs. Only used if server.log-source-ips-enabled
* is true. If not set the default Forwarded, X-Real-IP and X-Forwarded-For
* headers are used
* CLI flag: -server.log-source-ips-regex
* @default ""
*/
log_source_ips_regex?: string;
/**
* Optionally log request headers.
* CLI flag: -server.log-request-headers
* @default true
*/
log_request_headers?: boolean;
/**
* Optionally log requests at info level instead of debug level. Applies to
* request headers as well if server.log-request-headers is enabled.
* CLI flag: -server.log-request-at-info-level-enabled
* @default true
*/
log_request_at_info_level_enabled?: boolean;
/**
* Comma separated list of headers to exclude from loggin. Only used if
* server.log-request-headers is true.
* CLI flag: -server.log-request-headers-exclude-list
* @default ""
*/
log_request_exclude_headers_list?: string;
/**
* Base path to serve all API routes from (e.g. /v1/)
* CLI flag: -server.path-prefix
* @default ""
*/
http_path_prefix?: string;
};
/**
* The `storage_config` block configures one of many possible stores for both the index and chunks. Which configuration to be picked should be defined in schema_config block.
*/
export type storage_config = {
/**
* The alibabacloud_storage_config block configures the connection to Alibaba
* Cloud Storage object storage backend.
* The CLI flags prefix for this block configuration is: common
*/
alibabacloud?: alibabacloud_storage_config;
/**
* The aws_storage_config block configures the connection to dynamoDB and S3
* object storage. Either one of them or both can be configured.
*/
aws?: aws_storage_config;
/**
* The azure_storage_config block configures the connection to Azure object
* storage backend.
*/
azure?: azure_storage_config;
/**
* The bos_storage_config block configures the connection to Baidu Object Storage
* (BOS) object storage backend.
*/
bos?: bos_storage_config;
/**
* Deprecated: Configures storing indexes in Bigtable. Required fields only
* required when bigtable is defined in config.
* @deprecated
*/
bigtable?: {
/**
* Bigtable project ID.
* CLI flag: -bigtable.project
* @default ""
*/
project?: string;
/**
* Bigtable instance ID. Please refer to
* https://cloud.google.com/docs/authentication/production for more information
* about how to configure authentication.
* CLI flag: -bigtable.instance
* @default ""
*/
instance?: string;
/**
* The grpc_client block configures the gRPC client used to communicate between
* a client and server component in Loki.
* The CLI flags prefix for this block configuration is: bigtable
*/
grpc_client_config?: grpc_client;
/**
* If enabled, once a tables info is fetched, it is cached.
* CLI flag: -bigtable.table-cache.enabled
* @default true
*/
table_cache_enabled?: boolean;
/**
* Duration to cache tables before checking again.
* CLI flag: -bigtable.table-cache.expiration
* @default "30m"
*/
table_cache_expiration?: duration;
};
/**
* Configures storing chunks in GCS. Required fields only required when gcs is
* defined in config.
*/
gcs?: gcs_storage_config;
/**
* Deprecated: Configures storing chunks and/or the index in Cassandra.
* @deprecated
*/
cassandra?: {
/**
* Comma-separated hostnames or IPs of Cassandra instances.
* CLI flag: -cassandra.addresses
* @default ""
*/
addresses?: string;
/**
* Port that Cassandra is running on
* CLI flag: -cassandra.port
* @default 9042
*/
port?: int;
/**
* Keyspace to use in Cassandra.
* CLI flag: -cassandra.keyspace
* @default ""
*/
keyspace?: string;
/**
* Consistency level for Cassandra.
* CLI flag: -cassandra.consistency
* @default "QUORUM"
*/
consistency?: string;
/**
* Replication factor to use in Cassandra.
* CLI flag: -cassandra.replication-factor
* @default 3
*/
replication_factor?: int;
/**
* Instruct the cassandra driver to not attempt to get host info from the
* system.peers table.
* CLI flag: -cassandra.disable-initial-host-lookup
* @default true
*/
disable_initial_host_lookup?: boolean;
/**
* Use SSL when connecting to cassandra instances.
* CLI flag: -cassandra.ssl
* @default true
*/
SSL?: boolean;
/**
* Require SSL certificate validation.
* CLI flag: -cassandra.host-verification
* @default true
*/
host_verification?: boolean;
/**
* Policy for selecting Cassandra host. Supported values are: round-robin,
* token-aware.
* CLI flag: -cassandra.host-selection-policy
* @default "round-robin"
*/
host_selection_policy?: string;
/**
* Path to certificate file to verify the peer.
* CLI flag: -cassandra.ca-path
* @default ""
*/
CA_path?: string;
/**
* Path to certificate file used by TLS.
* CLI flag: -cassandra.tls-cert-path
* @default ""
*/
tls_cert_path?: string;
/**
* Path to private key file used by TLS.
* CLI flag: -cassandra.tls-key-path
* @default ""
*/
tls_key_path?: string;
/**
* Enable password authentication when connecting to cassandra.
* CLI flag: -cassandra.auth
* @default true
*/
auth?: boolean;
/**
* Username to use when connecting to cassandra.
* CLI flag: -cassandra.username
* @default ""
*/
username?: string;
/**
* Password to use when connecting to cassandra.
* CLI flag: -cassandra.password
* @default ""
*/
password?: string;
/**
* File containing password to use when connecting to cassandra.
* CLI flag: -cassandra.password-file
* @default ""
*/
password_file?: string;
/**
* If set, when authenticating with cassandra a custom authenticator will be
* expected during the handshake. This flag can be set multiple times.
* CLI flag: -cassandra.custom-authenticator
* @default "[]"
*/
custom_authenticators?: string[];
/**
* Timeout when connecting to cassandra.
* CLI flag: -cassandra.timeout
* @default "2s"
*/
timeout?: duration;
/**
* Initial connection timeout, used during initial dial to server.
* CLI flag: -cassandra.connect-timeout
* @default "5s"
*/
connect_timeout?: duration;
/**
* Interval to retry connecting to cassandra nodes marked as DOWN.
* CLI flag: -cassandra.reconnent-interval
* @default "1s"
*/
reconnect_interval?: duration;
/**
* Number of retries to perform on a request. Set to 0 to disable retries.
* CLI flag: -cassandra.max-retries
* @default 0
*/
max_retries?: int;
/**
* Maximum time to wait before retrying a failed request.
* CLI flag: -cassandra.retry-max-backoff
* @default "10s"
*/
retry_max_backoff?: duration;
/**
* Minimum time to wait before retrying a failed request.
* CLI flag: -cassandra.retry-min-backoff
* @default "100ms"
*/
retry_min_backoff?: duration;
/**
* Limit number of concurrent queries to Cassandra. Set to 0 to disable the
* limit.
* CLI flag: -cassandra.query-concurrency
* @default 0
*/
query_concurrency?: int;
/**
* Number of TCP connections per host.
* CLI flag: -cassandra.num-connections
* @default 2
*/
num_connections?: int;
/**
* Convict hosts of being down on failure.
* CLI flag: -cassandra.convict-hosts-on-failure
* @default true
*/
convict_hosts_on_failure?: boolean;
/**
* Table options used to create index or chunk tables. This value is used as
* plain text in the table `WITH` like this, "CREATE TABLE
* <generated_by_cortex> (...) WITH <cassandra.table-options>". For details,
* see https://cortexmetrics.io/docs/production/cassandra. By default it will
* use the default table options of your Cassandra cluster.
* CLI flag: -cassandra.table-options
* @default ""
*/
table_options?: string;
};
/**
* Deprecated: Configures storing index in BoltDB. Required fields only required
* when boltdb is present in the configuration.
* @deprecated
*/
boltdb?: {
/**
* Location of BoltDB index files.
* CLI flag: -boltdb.dir
* @default ""
*/
directory?: string;
};
/**
* Configures storing the chunks on the local file system. Required fields only
* required when filesystem is present in the configuration.
*/
filesystem?: local_storage_config;
/**
* The swift_storage_config block configures the connection to OpenStack Object
* Storage (Swift) object storage backend.
*/
swift?: swift_storage_config;
/**
* Deprecated:
* @deprecated
*/
grpc_store?: {
/**
* Hostname or IP of the gRPC store instance.
* CLI flag: -grpc-store.server-address
* @default ""
*/
server_address?: string;
};
hedging?: {
/**
* If set to a non-zero value a second request will be issued at the provided
* duration. Default is 0 (disabled)
* CLI flag: -store.hedge-requests-at
* @default "0s"
*/
at?: duration;
/**
* The maximum of hedge requests allowed.
* CLI flag: -store.hedge-requests-up-to
* @default 2
*/
up_to?: int;
/**
* The maximum of hedge requests allowed per seconds.
* CLI flag: -store.hedge-max-per-second
* @default 5
*/
max_per_second?: int;
};
/**
* Configures additional object stores for a given storage provider.
* Supported stores: aws, azure, bos, filesystem, gcs, swift.
* Example:
* storage_config:
* named_stores:
* aws:
* store-1:
* endpoint: s3://foo-bucket
* region: us-west1
* Named store from this example can be used by setting object_store to store-1
* in period_config.
*/
named_stores?: named_stores_config;
/**
* The cos_storage_config block configures the connection to IBM Cloud Object
* Storage (COS) backend.
*/
cos?: cos_storage_config;
/**
* Cache validity for active index entries. Should be no higher than
* -ingester.max-chunk-idle.
* CLI flag: -store.index-cache-validity
* @default "5m"
*/
index_cache_validity?: duration;
congestion_control?: {
/**
* Use storage congestion control (default: disabled).
* CLI flag: -store.congestion-control.enabled
* @default true
*/
enabled?: boolean;
controller?: {
/**
* Congestion control strategy to use (default: none, options: 'aimd').
* CLI flag: -store.congestion-control.strategy
* @default ""
*/
strategy?: string;
aimd?: {
/**
* AIMD starting throughput window size: how many requests can be sent per
* second (default: 2000).
* CLI flag: -store.congestion-control.strategy.aimd.start
* @default 2000
*/
start?: int;
/**
* AIMD maximum throughput window size: upper limit of requests sent per
* second (default: 10000).
* CLI flag: -store.congestion-control.strategy.aimd.upper-bound
* @default 10000
*/
upper_bound?: int;
/**
* AIMD backoff factor when upstream service is throttled to decrease
* number of requests sent per second (default: 0.5).
* CLI flag: -store.congestion-control.strategy.aimd.backoff-factor
* @default 0.5
*/
backoff_factor?: float;
};
};
retry?: {
/**
* Congestion control retry strategy to use (default: none, options:
* 'limited').
* CLI flag: -store.congestion-control.retry.strategy
* @default ""
*/
strategy?: string;
/**
* Maximum number of retries allowed.
* CLI flag: -store.congestion-control.retry.strategy.limited.limit
* @default 2
*/
limit?: int;
};
hedging?: {
config?: {
at?: duration;
up_to?: int;
max_per_second?: int;
};
/**
* Congestion control hedge strategy to use (default: none, options:
* 'limited').
* CLI flag: -store.congestion-control.hedge.strategy
* @default ""
*/
strategy?: string;
};
};
/**
* Experimental. Sets a constant prefix for all keys inserted into object
* storage. Example: loki/
* CLI flag: -store.object-prefix
* @default ""
*/
object_prefix?: string;
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is: store.index-cache-read
*/
index_queries_cache_config?: cache_config;
/**
* Disable broad index queries which results in reduced cache usage and faster
* query performance at the expense of somewhat higher QPS on the index store.
* CLI flag: -store.disable-broad-index-queries
* @default true
*/
disable_broad_index_queries?: boolean;
/**
* Maximum number of parallel chunk reads.
* CLI flag: -store.max-parallel-get-chunk
* @default 150
*/
max_parallel_get_chunk?: int;
/**
* The maximum number of chunks to fetch per batch.
* CLI flag: -store.max-chunk-batch-size
* @default 50
*/
max_chunk_batch_size?: int;
/**
* Configures storing index in an Object Store
* (GCS/S3/Azure/Swift/COS/Filesystem) in the form of boltdb files. Required
* fields only required when boltdb-shipper is defined in config.
*/
boltdb_shipper?: {
/**
* Directory where ingesters would write index files which would then be
* uploaded by shipper to configured storage
* CLI flag: -boltdb.shipper.active-index-directory
* @default ""
*/
active_index_directory?: string;
/**
* Cache location for restoring index files from storage for queries
* CLI flag: -boltdb.shipper.cache-location
* @default ""
*/
cache_location?: string;
/**
* TTL for index files restored in cache for queries
* CLI flag: -boltdb.shipper.cache-ttl
* @default "24h"
*/
cache_ttl?: duration;
/**
* Resync downloaded files with the storage
* CLI flag: -boltdb.shipper.resync-interval
* @default "5m"
*/
resync_interval?: duration;
/**
* Number of days of common index to be kept downloaded for queries. For per
* tenant index query readiness, use limits overrides config.
* CLI flag: -boltdb.shipper.query-ready-num-days
* @default 0
*/
query_ready_num_days?: int;
index_gateway_client?: {
/**
* The grpc_client block configures the gRPC client used to communicate
* between a client and server component in Loki.
* The CLI flags prefix for this block configuration is:
* boltdb.shipper.index-gateway-client.grpc
*/
grpc_client_config?: grpc_client;
/**
* Hostname or IP of the Index Gateway gRPC server running in simple mode.
* Can also be prefixed with dns+, dnssrv+, or dnssrvnoa+ to resolve a DNS A
* record with multiple IP's, a DNS SRV record with a followup A record
* lookup, or a DNS SRV record without a followup A record lookup,
* respectively.
* CLI flag: -boltdb.shipper.index-gateway-client.server-address
* @default ""
*/
server_address?: string;
/**
* Whether requests sent to the gateway should be logged or not.
* CLI flag: -boltdb.shipper.index-gateway-client.log-gateway-requests
* @default true
*/
log_gateway_requests?: boolean;
};
/** @default "" **/
ingestername?: string;
/** @default "" **/
mode?: string;
ingesterdbretainperiod?: duration;
/**
* Build per tenant index files
* CLI flag: -boltdb.shipper.build-per-tenant-index
* @default true
*/
build_per_tenant_index?: boolean;
};
/**
* Configures storing index in an Object Store
* (GCS/S3/Azure/Swift/COS/Filesystem) in a prometheus TSDB-like format. Required
* fields only required when TSDB is defined in config.
*/
tsdb_shipper?: {
/**
* Directory where ingesters would write index files which would then be
* uploaded by shipper to configured storage
* CLI flag: -tsdb.shipper.active-index-directory
* @default ""
*/
active_index_directory?: string;
/**
* Cache location for restoring index files from storage for queries
* CLI flag: -tsdb.shipper.cache-location
* @default ""
*/
cache_location?: string;
/**
* TTL for index files restored in cache for queries
* CLI flag: -tsdb.shipper.cache-ttl
* @default "24h"
*/
cache_ttl?: duration;
/**
* Resync downloaded files with the storage
* CLI flag: -tsdb.shipper.resync-interval
* @default "5m"
*/
resync_interval?: duration;
/**
* Number of days of common index to be kept downloaded for queries. For per
* tenant index query readiness, use limits overrides config.
* CLI flag: -tsdb.shipper.query-ready-num-days
* @default 0
*/
query_ready_num_days?: int;
index_gateway_client?: {
/**
* The grpc_client block configures the gRPC client used to communicate
* between a client and server component in Loki.
* The CLI flags prefix for this block configuration is:
* tsdb.shipper.index-gateway-client.grpc
*/
grpc_client_config?: grpc_client;
/**
* Hostname or IP of the Index Gateway gRPC server running in simple mode.
* Can also be prefixed with dns+, dnssrv+, or dnssrvnoa+ to resolve a DNS A
* record with multiple IP's, a DNS SRV record with a followup A record
* lookup, or a DNS SRV record without a followup A record lookup,
* respectively.
* CLI flag: -tsdb.shipper.index-gateway-client.server-address
* @default ""
*/
server_address?: string;
/**
* Whether requests sent to the gateway should be logged or not.
* CLI flag: -tsdb.shipper.index-gateway-client.log-gateway-requests
* @default true
*/
log_gateway_requests?: boolean;
};
/** @default "" **/
ingestername?: string;
/** @default "" **/
mode?: string;
ingesterdbretainperiod?: duration;
};
/**
* Experimental: Configures the bloom shipper component, which contains the store
* abstraction to fetch bloom filters from and put them to object storage.
*/
bloom_shipper?: {
/**
* Working directory to store downloaded bloom blocks. Supports multiple
* directories, separated by comma.
* CLI flag: -bloom.shipper.working-directory
* @default "/data/blooms"
*/
working_directory?: string;
/**
* Maximum size of bloom pages that should be queried. Larger pages than this
* limit are skipped when querying blooms to limit memory usage.
* CLI flag: -bloom.max-query-page-size
* @default "64MiB"
*/
max_query_page_size?: int;
/**
* The amount of maximum concurrent bloom blocks downloads. Usually set to 2x
* number of CPU cores.
* CLI flag: -bloom.download-parallelism
* @default 8
*/
download_parallelism?: int;
blocks_cache?: {
/**
* Cache for bloom blocks. Soft limit of the cache in bytes. Exceeding this
* limit will trigger evictions of least recently used items in the
* background.
* CLI flag: -bloom.blocks-cache.soft-limit
* @default "32GiB"
*/
soft_limit?: int;
/**
* Cache for bloom blocks. Hard limit of the cache in bytes. Exceeding this
* limit will block execution until soft limit is deceeded.
* CLI flag: -bloom.blocks-cache.hard-limit
* @default "64GiB"
*/
hard_limit?: int;
/**
* Cache for bloom blocks. The time to live for items in the cache before
* they get purged.
* CLI flag: -bloom.blocks-cache.ttl
* @default "24h"
*/
ttl?: duration;
};
/**
* The cache_config block configures the cache backend for a specific Loki
* component.
* The CLI flags prefix for this block configuration is: bloom.metas-cache
*/
metas_cache?: cache_config;
metas_lru_cache?: {
/**
* In-memory LRU cache for bloom metas. Whether embedded cache is enabled.
* CLI flag: -bloom.metas-lru-cache.enabled
* @default true
*/
enabled?: boolean;
/**
* In-memory LRU cache for bloom metas. Maximum memory size of the cache in
* MB.
* CLI flag: -bloom.metas-lru-cache.max-size-mb
* @default 100
*/
max_size_mb?: int;
/**
* In-memory LRU cache for bloom metas. Maximum number of entries in the
* cache.
* CLI flag: -bloom.metas-lru-cache.max-size-items
* @default 0
*/
max_size_items?: int;
/**
* In-memory LRU cache for bloom metas. The time to live for items in the
* cache before they get purged.
* CLI flag: -bloom.metas-lru-cache.ttl
* @default "1h"
*/
ttl?: duration;
};
};
};
/**
* The `swift_storage_config` block configures the connection to OpenStack Object Storage (Swift) object storage backend. The supported CLI flags `<prefix>` used to reference this configuration block are:
*
* - `common.storage`
* - `ruler.storage`
*
* &nbsp;
*/
export type swift_storage_config = {
/**
* OpenStack Swift authentication API version. 0 to autodetect.
* CLI flag: -<prefix>.swift.auth-version
* @default 0
*/
auth_version?: int;
/**
* OpenStack Swift authentication URL
* CLI flag: -<prefix>.swift.auth-url
* @default ""
*/
auth_url?: string;
/**
* Set this to true to use the internal OpenStack Swift endpoint URL
* CLI flag: -<prefix>.swift.internal
* @default true
*/
internal?: boolean;
/**
* OpenStack Swift username.
* CLI flag: -<prefix>.swift.username
* @default ""
*/
username?: string;
/**
* OpenStack Swift user's domain name.
* CLI flag: -<prefix>.swift.user-domain-name
* @default ""
*/
user_domain_name?: string;
/**
* OpenStack Swift user's domain ID.
* CLI flag: -<prefix>.swift.user-domain-id
* @default ""
*/
user_domain_id?: string;
/**
* OpenStack Swift user ID.
* CLI flag: -<prefix>.swift.user-id
* @default ""
*/
user_id?: string;
/**
* OpenStack Swift API key.
* CLI flag: -<prefix>.swift.password
* @default ""
*/
password?: string;
/**
* OpenStack Swift user's domain ID.
* CLI flag: -<prefix>.swift.domain-id
* @default ""
*/
domain_id?: string;
/**
* OpenStack Swift user's domain name.
* CLI flag: -<prefix>.swift.domain-name
* @default ""
*/
domain_name?: string;
/**
* OpenStack Swift project ID (v2,v3 auth only).
* CLI flag: -<prefix>.swift.project-id
* @default ""
*/
project_id?: string;
/**
* OpenStack Swift project name (v2,v3 auth only).
* CLI flag: -<prefix>.swift.project-name
* @default ""
*/
project_name?: string;
/**
* ID of the OpenStack Swift project's domain (v3 auth only), only needed if it
* differs the from user domain.
* CLI flag: -<prefix>.swift.project-domain-id
* @default ""
*/
project_domain_id?: string;
/**
* Name of the OpenStack Swift project's domain (v3 auth only), only needed if it
* differs from the user domain.
* CLI flag: -<prefix>.swift.project-domain-name
* @default ""
*/
project_domain_name?: string;
/**
* OpenStack Swift Region to use (v2,v3 auth only).
* CLI flag: -<prefix>.swift.region-name
* @default ""
*/
region_name?: string;
/**
* Name of the OpenStack Swift container to put chunks in.
* CLI flag: -<prefix>.swift.container-name
* @default ""
*/
container_name?: string;
/**
* Max retries on requests error.
* CLI flag: -<prefix>.swift.max-retries
* @default 3
*/
max_retries?: int;
/**
* Time after which a connection attempt is aborted.
* CLI flag: -<prefix>.swift.connect-timeout
* @default "10s"
*/
connect_timeout?: duration;
/**
* Time after which an idle request is aborted. The timeout watchdog is reset
* each time some data is received, so the timeout triggers after X time no data
* is received on a request.
* CLI flag: -<prefix>.swift.request-timeout
* @default "5s"
*/
request_timeout?: duration;
};
/**
* The `table_manager` block configures the table manager for retention.
*/
export type table_manager = {
/**
* If true, disable all changes to DB capacity
* CLI flag: -table-manager.throughput-updates-disabled
* @default true
*/
throughput_updates_disabled?: boolean;
/**
* If true, enables retention deletes of DB tables
* CLI flag: -table-manager.retention-deletes-enabled
* @default true
*/
retention_deletes_enabled?: boolean;
/**
* Tables older than this retention period are deleted. Must be either 0
* (disabled) or a multiple of 24h. When enabled, be aware this setting is
* destructive to data!
* CLI flag: -table-manager.retention-period
* @default "0s"
*/
retention_period?: duration;
/**
* How frequently to poll backend to learn our capacity.
* CLI flag: -table-manager.poll-interval
* @default "2m"
*/
poll_interval?: duration;
/**
* Periodic tables grace period (duration which table will be created/deleted
* before/after it's needed).
* CLI flag: -table-manager.periodic-table.grace-period
* @default "10m"
*/
creation_grace_period?: duration;
index_tables_provisioning?: {
/**
* Enables on demand throughput provisioning for the storage provider (if
* supported). Applies only to tables which are not autoscaled. Supported by
* DynamoDB
* CLI flag: -table-manager.index-table.enable-ondemand-throughput-mode
* @default true
*/
enable_ondemand_throughput_mode?: boolean;
/**
* Table default write throughput. Supported by DynamoDB
* CLI flag: -table-manager.index-table.write-throughput
* @default 1000
*/
provisioned_write_throughput?: int;
/**
* Table default read throughput. Supported by DynamoDB
* CLI flag: -table-manager.index-table.read-throughput
* @default 300
*/
provisioned_read_throughput?: int;
write_scale?: {
/**
* Should we enable autoscale for the table.
* CLI flag: -table-manager.index-table.write-throughput.scale.enabled
* @default true
*/
enabled?: boolean;
/**
* AWS AutoScaling role ARN
* CLI flag: -table-manager.index-table.write-throughput.scale.role-arn
* @default ""
*/
role_arn?: string;
/**
* DynamoDB minimum provision capacity.
* CLI flag: -table-manager.index-table.write-throughput.scale.min-capacity
* @default 3000
*/
min_capacity?: int;
/**
* DynamoDB maximum provision capacity.
* CLI flag: -table-manager.index-table.write-throughput.scale.max-capacity
* @default 6000
*/
max_capacity?: int;
/**
* DynamoDB minimum seconds between each autoscale up.
* CLI flag: -table-manager.index-table.write-throughput.scale.out-cooldown
* @default 1800
*/
out_cooldown?: int;
/**
* DynamoDB minimum seconds between each autoscale down.
* CLI flag: -table-manager.index-table.write-throughput.scale.in-cooldown
* @default 1800
*/
in_cooldown?: int;
/**
* DynamoDB target ratio of consumed capacity to provisioned capacity.
* CLI flag: -table-manager.index-table.write-throughput.scale.target-value
* @default 80
*/
target?: float;
};
read_scale?: {
/**
* Should we enable autoscale for the table.
* CLI flag: -table-manager.index-table.read-throughput.scale.enabled
* @default true
*/
enabled?: boolean;
/**
* AWS AutoScaling role ARN
* CLI flag: -table-manager.index-table.read-throughput.scale.role-arn
* @default ""
*/
role_arn?: string;
/**
* DynamoDB minimum provision capacity.
* CLI flag: -table-manager.index-table.read-throughput.scale.min-capacity
* @default 3000
*/
min_capacity?: int;
/**
* DynamoDB maximum provision capacity.
* CLI flag: -table-manager.index-table.read-throughput.scale.max-capacity
* @default 6000
*/
max_capacity?: int;
/**
* DynamoDB minimum seconds between each autoscale up.
* CLI flag: -table-manager.index-table.read-throughput.scale.out-cooldown
* @default 1800
*/
out_cooldown?: int;
/**
* DynamoDB minimum seconds between each autoscale down.
* CLI flag: -table-manager.index-table.read-throughput.scale.in-cooldown
* @default 1800
*/
in_cooldown?: int;
/**
* DynamoDB target ratio of consumed capacity to provisioned capacity.
* CLI flag: -table-manager.index-table.read-throughput.scale.target-value
* @default 80
*/
target?: float;
};
/**
* Enables on demand throughput provisioning for the storage provider (if
* supported). Applies only to tables which are not autoscaled. Supported by
* DynamoDB
* CLI flag: -table-manager.index-table.inactive-enable-ondemand-throughput-mode
* @default true
*/
enable_inactive_throughput_on_demand_mode?: boolean;
/**
* Table write throughput for inactive tables. Supported by DynamoDB
* CLI flag: -table-manager.index-table.inactive-write-throughput
* @default 1
*/
inactive_write_throughput?: int;
/**
* Table read throughput for inactive tables. Supported by DynamoDB
* CLI flag: -table-manager.index-table.inactive-read-throughput
* @default 300
*/
inactive_read_throughput?: int;
inactive_write_scale?: {
/**
* Should we enable autoscale for the table.
* CLI flag: -table-manager.index-table.inactive-write-throughput.scale.enabled
* @default true
*/
enabled?: boolean;
/**
* AWS AutoScaling role ARN
* CLI flag: -table-manager.index-table.inactive-write-throughput.scale.role-arn
* @default ""
*/
role_arn?: string;
/**
* DynamoDB minimum provision capacity.
* CLI flag: -table-manager.index-table.inactive-write-throughput.scale.min-capacity
* @default 3000
*/
min_capacity?: int;
/**
* DynamoDB maximum provision capacity.
* CLI flag: -table-manager.index-table.inactive-write-throughput.scale.max-capacity
* @default 6000
*/
max_capacity?: int;
/**
* DynamoDB minimum seconds between each autoscale up.
* CLI flag: -table-manager.index-table.inactive-write-throughput.scale.out-cooldown
* @default 1800
*/
out_cooldown?: int;
/**
* DynamoDB minimum seconds between each autoscale down.
* CLI flag: -table-manager.index-table.inactive-write-throughput.scale.in-cooldown
* @default 1800
*/
in_cooldown?: int;
/**
* DynamoDB target ratio of consumed capacity to provisioned capacity.
* CLI flag: -table-manager.index-table.inactive-write-throughput.scale.target-value
* @default 80
*/
target?: float;
};
inactive_read_scale?: {
/**
* Should we enable autoscale for the table.
* CLI flag: -table-manager.index-table.inactive-read-throughput.scale.enabled
* @default true
*/
enabled?: boolean;
/**
* AWS AutoScaling role ARN
* CLI flag: -table-manager.index-table.inactive-read-throughput.scale.role-arn
* @default ""
*/
role_arn?: string;
/**
* DynamoDB minimum provision capacity.
* CLI flag: -table-manager.index-table.inactive-read-throughput.scale.min-capacity
* @default 3000
*/
min_capacity?: int;
/**
* DynamoDB maximum provision capacity.
* CLI flag: -table-manager.index-table.inactive-read-throughput.scale.max-capacity
* @default 6000
*/
max_capacity?: int;
/**
* DynamoDB minimum seconds between each autoscale up.
* CLI flag: -table-manager.index-table.inactive-read-throughput.scale.out-cooldown
* @default 1800
*/
out_cooldown?: int;
/**
* DynamoDB minimum seconds between each autoscale down.
* CLI flag: -table-manager.index-table.inactive-read-throughput.scale.in-cooldown
* @default 1800
*/
in_cooldown?: int;
/**
* DynamoDB target ratio of consumed capacity to provisioned capacity.
* CLI flag: -table-manager.index-table.inactive-read-throughput.scale.target-value
* @default 80
*/
target?: float;
};
/**
* Number of last inactive tables to enable write autoscale.
* CLI flag: -table-manager.index-table.inactive-write-throughput.scale-last-n
* @default 4
*/
inactive_write_scale_lastn?: int;
/**
* Number of last inactive tables to enable read autoscale.
* CLI flag: -table-manager.index-table.inactive-read-throughput.scale-last-n
* @default 4
*/
inactive_read_scale_lastn?: int;
};
chunk_tables_provisioning?: {
/**
* Enables on demand throughput provisioning for the storage provider (if
* supported). Applies only to tables which are not autoscaled. Supported by
* DynamoDB
* CLI flag: -table-manager.chunk-table.enable-ondemand-throughput-mode
* @default true
*/
enable_ondemand_throughput_mode?: boolean;
/**
* Table default write throughput. Supported by DynamoDB
* CLI flag: -table-manager.chunk-table.write-throughput
* @default 1000
*/
provisioned_write_throughput?: int;
/**
* Table default read throughput. Supported by DynamoDB
* CLI flag: -table-manager.chunk-table.read-throughput
* @default 300
*/
provisioned_read_throughput?: int;
write_scale?: {
/**
* Should we enable autoscale for the table.
* CLI flag: -table-manager.chunk-table.write-throughput.scale.enabled
* @default true
*/
enabled?: boolean;
/**
* AWS AutoScaling role ARN
* CLI flag: -table-manager.chunk-table.write-throughput.scale.role-arn
* @default ""
*/
role_arn?: string;
/**
* DynamoDB minimum provision capacity.
* CLI flag: -table-manager.chunk-table.write-throughput.scale.min-capacity
* @default 3000
*/
min_capacity?: int;
/**
* DynamoDB maximum provision capacity.
* CLI flag: -table-manager.chunk-table.write-throughput.scale.max-capacity
* @default 6000
*/
max_capacity?: int;
/**
* DynamoDB minimum seconds between each autoscale up.
* CLI flag: -table-manager.chunk-table.write-throughput.scale.out-cooldown
* @default 1800
*/
out_cooldown?: int;
/**
* DynamoDB minimum seconds between each autoscale down.
* CLI flag: -table-manager.chunk-table.write-throughput.scale.in-cooldown
* @default 1800
*/
in_cooldown?: int;
/**
* DynamoDB target ratio of consumed capacity to provisioned capacity.
* CLI flag: -table-manager.chunk-table.write-throughput.scale.target-value
* @default 80
*/
target?: float;
};
read_scale?: {
/**
* Should we enable autoscale for the table.
* CLI flag: -table-manager.chunk-table.read-throughput.scale.enabled
* @default true
*/
enabled?: boolean;
/**
* AWS AutoScaling role ARN
* CLI flag: -table-manager.chunk-table.read-throughput.scale.role-arn
* @default ""
*/
role_arn?: string;
/**
* DynamoDB minimum provision capacity.
* CLI flag: -table-manager.chunk-table.read-throughput.scale.min-capacity
* @default 3000
*/
min_capacity?: int;
/**
* DynamoDB maximum provision capacity.
* CLI flag: -table-manager.chunk-table.read-throughput.scale.max-capacity
* @default 6000
*/
max_capacity?: int;
/**
* DynamoDB minimum seconds between each autoscale up.
* CLI flag: -table-manager.chunk-table.read-throughput.scale.out-cooldown
* @default 1800
*/
out_cooldown?: int;
/**
* DynamoDB minimum seconds between each autoscale down.
* CLI flag: -table-manager.chunk-table.read-throughput.scale.in-cooldown
* @default 1800
*/
in_cooldown?: int;
/**
* DynamoDB target ratio of consumed capacity to provisioned capacity.
* CLI flag: -table-manager.chunk-table.read-throughput.scale.target-value
* @default 80
*/
target?: float;
};
/**
* Enables on demand throughput provisioning for the storage provider (if
* supported). Applies only to tables which are not autoscaled. Supported by
* DynamoDB
* CLI flag: -table-manager.chunk-table.inactive-enable-ondemand-throughput-mode
* @default true
*/
enable_inactive_throughput_on_demand_mode?: boolean;
/**
* Table write throughput for inactive tables. Supported by DynamoDB
* CLI flag: -table-manager.chunk-table.inactive-write-throughput
* @default 1
*/
inactive_write_throughput?: int;
/**
* Table read throughput for inactive tables. Supported by DynamoDB
* CLI flag: -table-manager.chunk-table.inactive-read-throughput
* @default 300
*/
inactive_read_throughput?: int;
inactive_write_scale?: {
/**
* Should we enable autoscale for the table.
* CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.enabled
* @default true
*/
enabled?: boolean;
/**
* AWS AutoScaling role ARN
* CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.role-arn
* @default ""
*/
role_arn?: string;
/**
* DynamoDB minimum provision capacity.
* CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.min-capacity
* @default 3000
*/
min_capacity?: int;
/**
* DynamoDB maximum provision capacity.
* CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.max-capacity
* @default 6000
*/
max_capacity?: int;
/**
* DynamoDB minimum seconds between each autoscale up.
* CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.out-cooldown
* @default 1800
*/
out_cooldown?: int;
/**
* DynamoDB minimum seconds between each autoscale down.
* CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.in-cooldown
* @default 1800
*/
in_cooldown?: int;
/**
* DynamoDB target ratio of consumed capacity to provisioned capacity.
* CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale.target-value
* @default 80
*/
target?: float;
};
inactive_read_scale?: {
/**
* Should we enable autoscale for the table.
* CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.enabled
* @default true
*/
enabled?: boolean;
/**
* AWS AutoScaling role ARN
* CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.role-arn
* @default ""
*/
role_arn?: string;
/**
* DynamoDB minimum provision capacity.
* CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.min-capacity
* @default 3000
*/
min_capacity?: int;
/**
* DynamoDB maximum provision capacity.
* CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.max-capacity
* @default 6000
*/
max_capacity?: int;
/**
* DynamoDB minimum seconds between each autoscale up.
* CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.out-cooldown
* @default 1800
*/
out_cooldown?: int;
/**
* DynamoDB minimum seconds between each autoscale down.
* CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.in-cooldown
* @default 1800
*/
in_cooldown?: int;
/**
* DynamoDB target ratio of consumed capacity to provisioned capacity.
* CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale.target-value
* @default 80
*/
target?: float;
};
/**
* Number of last inactive tables to enable write autoscale.
* CLI flag: -table-manager.chunk-table.inactive-write-throughput.scale-last-n
* @default 4
*/
inactive_write_scale_lastn?: int;
/**
* Number of last inactive tables to enable read autoscale.
* CLI flag: -table-manager.chunk-table.inactive-read-throughput.scale-last-n
* @default 4
*/
inactive_read_scale_lastn?: int;
};
};
/**
* The TLS configuration.
*/
export type tls_config = {
/**
* Path to the client certificate, which will be used for authenticating with the
* server. Also requires the key path to be configured.
* CLI flag: -frontend.tail-tls-config.tls-cert-path
* @default ""
*/
tls_cert_path?: string;
/**
* Path to the key for the client certificate. Also requires the client
* certificate to be configured.
* CLI flag: -frontend.tail-tls-config.tls-key-path
* @default ""
*/
tls_key_path?: string;
/**
* Path to the CA certificates to validate server certificate against. If not
* set, the host's root CA certificates are used.
* CLI flag: -frontend.tail-tls-config.tls-ca-path
* @default ""
*/
tls_ca_path?: string;
/**
* Override the expected name on the server certificate.
* CLI flag: -frontend.tail-tls-config.tls-server-name
* @default ""
*/
tls_server_name?: string;
/**
* Skip validating server certificate.
* CLI flag: -frontend.tail-tls-config.tls-insecure-skip-verify
* @default true
*/
tls_insecure_skip_verify?: boolean;
/**
* Override the default cipher suite list (separated by commas). Allowed values:
*
* Secure Ciphers:
* - TLS_AES_128_GCM_SHA256
* - TLS_AES_256_GCM_SHA384
* - TLS_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
*
* Insecure Ciphers:
* - TLS_RSA_WITH_RC4_128_SHA
* - TLS_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA
* - TLS_RSA_WITH_AES_256_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA256
* - TLS_RSA_WITH_AES_128_GCM_SHA256
* - TLS_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* CLI flag: -frontend.tail-tls-config.tls-cipher-suites
* @default ""
*/
tls_cipher_suites?: string;
/**
* Override the default minimum TLS version. Allowed values: VersionTLS10,
* VersionTLS11, VersionTLS12, VersionTLS13
* CLI flag: -frontend.tail-tls-config.tls-min-version
* @default ""
*/
tls_min_version?: string;
};
/**
* Configuration for `tracing`.
*/
export type tracing = {
/**
* Set to false to disable tracing.
* CLI flag: -tracing.enabled
* @default true
*/
enabled?: boolean;
};
export type LokiConfig = {
/**
* A comma-separated list of components to run. The default value 'all' runs Loki
* in single binary mode. The value 'read' is an alias to run only read-path
* related components such as the querier and query-frontend, but all in the same
* process. The value 'write' is an alias to run only write-path related
* components such as the distributor and compactor, but all in the same process.
* Supported values: all, compactor, distributor, ingester, querier,
* query-scheduler, ingester-querier, query-frontend, index-gateway, ruler,
* table-manager, read, write. A full list of available targets can be printed
* when running Loki with the '-list-targets' command line flag.
* CLI flag: -target
* @default "all"
*/
target?: string;
/**
* Enables authentication through the X-Scope-OrgID header, which must be present
* if true. If false, the OrgID will always be set to 'fake'.
* CLI flag: -auth.enabled
* @default true
*/
auth_enabled?: boolean;
/**
* The amount of virtual memory in bytes to reserve as ballast in order to
* optimize garbage collection. Larger ballasts result in fewer garbage
* collection passes, reducing CPU overhead at the cost of heap size. The ballast
* will not consume physical memory, because it is never read from. It will,
* however, distort metrics, because it is counted as live memory.
* CLI flag: -config.ballast-bytes
* @default 0
*/
ballast_bytes?: int;
/**
* Configures the server of the launched module(s).
*/
server?: server;
/**
* Configures the distributor.
*/
distributor?: distributor;
/**
* Configures the querier. Only appropriate when running all modules or just the
* querier.
*/
querier?: querier;
/**
* The query_scheduler block configures the Loki query scheduler. When configured
* it separates the tenant query queues from the query-frontend.
*/
query_scheduler?: query_scheduler;
/**
* The frontend block configures the Loki query-frontend.
*/
frontend?: frontend;
/**
* The query_range block configures the query splitting and caching in the Loki
* query-frontend.
*/
query_range?: query_range;
/**
* The ruler block configures the Loki ruler.
*/
ruler?: ruler;
/**
* The ingester_client block configures how the distributor will connect to
* ingesters. Only appropriate when running all components, the distributor, or
* the querier.
*/
ingester_client?: ingester_client;
/**
* The ingester block configures the ingester and how the ingester will register
* itself to a key value store.
*/
ingester?: ingester;
pattern_ingester?: {
/**
* Whether the pattern ingester is enabled.
* CLI flag: -pattern-ingester.enabled
* @default true
*/
enabled?: boolean;
/**
* Configures how the lifecycle of the pattern ingester will operate and where
* it will register for discovery.
*/
lifecycler?: {
ring?: {
kvstore?: {
/**
* Backend storage to use for the ring. Supported values are: consul,
* etcd, inmemory, memberlist, multi.
* CLI flag: -pattern-ingester.store
* @default "consul"
*/
store?: string;
/**
* The prefix for the keys in the store. Should end with a /.
* CLI flag: -pattern-ingester.prefix
* @default "collectors/"
*/
prefix?: string;
/**
* Configuration for a Consul client. Only applies if the selected
* kvstore is consul.
* The CLI flags prefix for this block configuration is: pattern-ingester
*/
consul?: consul;
/**
* Configuration for an ETCD v3 client. Only applies if the selected
* kvstore is etcd.
* The CLI flags prefix for this block configuration is: pattern-ingester
*/
etcd?: etcd;
multi?: {
/**
* Primary backend storage used by multi-client.
* CLI flag: -pattern-ingester.multi.primary
* @default ""
*/
primary?: string;
/**
* Secondary backend storage used by multi-client.
* CLI flag: -pattern-ingester.multi.secondary
* @default ""
*/
secondary?: string;
/**
* Mirror writes to secondary store.
* CLI flag: -pattern-ingester.multi.mirror-enabled
* @default true
*/
mirror_enabled?: boolean;
/**
* Timeout for storing value to secondary store.
* CLI flag: -pattern-ingester.multi.mirror-timeout
* @default "2s"
*/
mirror_timeout?: duration;
};
};
/**
* The heartbeat timeout after which ingesters are skipped for
* reads/writes. 0 = never (timeout disabled).
* CLI flag: -pattern-ingester.ring.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* The number of ingesters to write to and read from.
* CLI flag: -pattern-ingester.distributor.replication-factor
* @default 1
*/
replication_factor?: int;
/**
* True to enable the zone-awareness and replicate ingested samples across
* different availability zones.
* CLI flag: -pattern-ingester.distributor.zone-awareness-enabled
* @default true
*/
zone_awareness_enabled?: boolean;
/**
* Comma-separated list of zones to exclude from the ring. Instances in
* excluded zones will be filtered out from the ring.
* CLI flag: -pattern-ingester.distributor.excluded-zones
* @default ""
*/
excluded_zones?: string;
};
/**
* Number of tokens for each ingester.
* CLI flag: -pattern-ingester.num-tokens
* @default 128
*/
num_tokens?: int;
/**
* Period at which to heartbeat to consul. 0 = disabled.
* CLI flag: -pattern-ingester.heartbeat-period
* @default "5s"
*/
heartbeat_period?: duration;
/**
* Heartbeat timeout after which instance is assumed to be unhealthy. 0 =
* disabled.
* CLI flag: -pattern-ingester.heartbeat-timeout
* @default "1m"
*/
heartbeat_timeout?: duration;
/**
* Observe tokens after generating to resolve collisions. Useful when using
* gossiping ring.
* CLI flag: -pattern-ingester.observe-period
* @default "0s"
*/
observe_period?: duration;
/**
* Period to wait for a claim from another member; will join automatically
* after this.
* CLI flag: -pattern-ingester.join-after
* @default "0s"
*/
join_after?: duration;
/**
* Minimum duration to wait after the internal readiness checks have passed
* but before succeeding the readiness endpoint. This is used to slowdown
* deployment controllers (eg. Kubernetes) after an instance is ready and
* before they proceed with a rolling update, to give the rest of the cluster
* instances enough time to receive ring updates.
* CLI flag: -pattern-ingester.min-ready-duration
* @default "15s"
*/
min_ready_duration?: duration;
/**
* Name of network interface to read address from.
* CLI flag: -pattern-ingester.lifecycler.interface
* @default "[<private network interfaces>]"
*/
interface_names?: string[];
/**
* Enable IPv6 support. Required to make use of IP addresses from IPv6
* interfaces.
* CLI flag: -pattern-ingester.enable-inet6
* @default true
*/
enable_inet6?: boolean;
/**
* Duration to sleep for before exiting, to ensure metrics are scraped.
* CLI flag: -pattern-ingester.final-sleep
* @default "0s"
*/
final_sleep?: duration;
/**
* File path where tokens are stored. If empty, tokens are not stored at
* shutdown and restored at startup.
* CLI flag: -pattern-ingester.tokens-file-path
* @default ""
*/
tokens_file_path?: string;
/**
* The availability zone where this instance is running.
* CLI flag: -pattern-ingester.availability-zone
* @default ""
*/
availability_zone?: string;
/**
* Unregister from the ring upon clean shutdown. It can be useful to disable
* for rolling restarts with consistent naming in conjunction with
* -distributor.extend-writes=false.
* CLI flag: -pattern-ingester.unregister-on-shutdown
* @default true
*/
unregister_on_shutdown?: boolean;
/**
* When enabled the readiness probe succeeds only after all instances are
* ACTIVE and healthy in the ring, otherwise only the instance itself is
* checked. This option should be disabled if in your cluster multiple
* instances can be rolled out simultaneously, otherwise rolling updates may
* be slowed down.
* CLI flag: -pattern-ingester.readiness-check-ring-health
* @default true
*/
readiness_check_ring_health?: boolean;
/**
* IP address to advertise in the ring.
* CLI flag: -pattern-ingester.lifecycler.addr
* @default ""
*/
address?: string;
/**
* port to advertise in consul (defaults to server.grpc-listen-port).
* CLI flag: -pattern-ingester.lifecycler.port
* @default 0
*/
port?: int;
/**
* ID to register in the ring.
* CLI flag: -pattern-ingester.lifecycler.ID
* @default "<hostname>"
*/
id?: string;
};
/**
* Configures how the pattern ingester will connect to the ingesters.
*/
client_config?: {
/**
* Configures how connections are pooled.
*/
pool_config?: {
/**
* How frequently to clean up clients for ingesters that have gone away.
* CLI flag: -pattern-ingester.client-cleanup-period
* @default "15s"
*/
client_cleanup_period?: duration;
/**
* Run a health check on each ingester client during periodic cleanup.
* CLI flag: -pattern-ingester.health-check-ingesters
* @default true
*/
health_check_ingesters?: boolean;
/**
* Timeout for the health check.
* CLI flag: -pattern-ingester.remote-timeout
* @default "1s"
*/
remote_timeout?: duration;
};
/**
* The remote request timeout on the client side.
* CLI flag: -pattern-ingester.client.timeout
* @default "5s"
*/
remote_timeout?: duration;
/**
* Configures how the gRPC connection to ingesters work as a client.
* The CLI flags prefix for this block configuration is:
* pattern-ingester.client
*/
grpc_client_config?: grpc_client;
};
/**
* How many flushes can happen concurrently from each stream.
* CLI flag: -pattern-ingester.concurrent-flushes
* @default 32
*/
concurrent_flushes?: int;
/**
* How often should the ingester see if there are any blocks to flush. The
* first flush check is delayed by a random time up to 0.8x the flush check
* period. Additionally, there is +/- 1% jitter added to the interval.
* CLI flag: -pattern-ingester.flush-check-period
* @default "30s"
*/
flush_check_period?: duration;
};
/**
* The index_gateway block configures the Loki index gateway server, responsible
* for serving index queries without the need to constantly interact with the
* object store.
*/
index_gateway?: index_gateway;
/**
* Experimental: The bloom_compactor block configures the Loki bloom compactor
* server, responsible for compacting stream indexes into bloom filters and
* merging them as bloom blocks.
*/
bloom_compactor?: bloom_compactor;
bloom_build?: {
/**
* Flag to enable or disable the usage of the bloom-planner and bloom-builder
* components.
* CLI flag: -bloom-build.enabled
* @default true
*/
enabled?: boolean;
planner?: {
/**
* Interval at which to re-run the bloom creation planning.
* CLI flag: -bloom-build.planner.interval
* @default "8h"
*/
planning_interval?: duration;
/**
* Newest day-table offset (from today, inclusive) to build blooms for.
* Increase to lower cost by not re-writing data to object storage too
* frequently since recent data changes more often at the cost of not having
* blooms available as quickly.
* CLI flag: -bloom-build.planner.min-table-offset
* @default 1
*/
min_table_offset?: int;
/**
* Oldest day-table offset (from today, inclusive) to compact. This can be
* used to lower cost by not trying to compact older data which doesn't
* change. This can be optimized by aligning it with the maximum
* `reject_old_samples_max_age` setting of any tenant.
* CLI flag: -bloom-build.planner.max-table-offset
* @default 2
*/
max_table_offset?: int;
/**
* Maximum number of tasks to queue per tenant.
* CLI flag: -bloom-build.planner.max-tasks-per-tenant
* @default 30000
*/
max_queued_tasks_per_tenant?: int;
};
builder?: {
/**
* The grpc_client block configures the gRPC client used to communicate
* between a client and server component in Loki.
* The CLI flags prefix for this block configuration is:
* bloom-build.builder.grpc
*/
grpc_config?: grpc_client;
/**
* Hostname (and port) of the bloom planner
* CLI flag: -bloom-build.builder.planner-address
* @default ""
*/
planner_address?: string;
};
};
/**
* Experimental: The bloom_gateway block configures the Loki bloom gateway
* server, responsible for serving queries for filtering chunks based on filter
* expressions.
*/
bloom_gateway?: bloom_gateway;
/**
* The storage_config block configures one of many possible stores for both the
* index and chunks. Which configuration to be picked should be defined in
* schema_config block.
*/
storage_config?: storage_config;
/**
* The chunk_store_config block configures how chunks will be cached and how long
* to wait before saving them to the backing store.
*/
chunk_store_config?: chunk_store_config;
/**
* Configures the chunk index schema and where it is stored.
*/
schema_config?: schema_config;
/**
* The compactor block configures the compactor component, which compacts index
* shards for performance.
*/
compactor?: compactor;
compactor_grpc_client?: {
/**
* gRPC client max receive message size (bytes).
* CLI flag: -compactor.grpc-client.grpc-max-recv-msg-size
* @default 104857600
*/
max_recv_msg_size?: int;
/**
* gRPC client max send message size (bytes).
* CLI flag: -compactor.grpc-client.grpc-max-send-msg-size
* @default 104857600
*/
max_send_msg_size?: int;
/**
* Use compression when sending messages. Supported values are: 'gzip',
* 'snappy' and '' (disable compression)
* CLI flag: -compactor.grpc-client.grpc-compression
* @default ""
*/
grpc_compression?: string;
/**
* Rate limit for gRPC client; 0 means disabled.
* CLI flag: -compactor.grpc-client.grpc-client-rate-limit
* @default 0
*/
rate_limit?: float;
/**
* Rate limit burst for gRPC client.
* CLI flag: -compactor.grpc-client.grpc-client-rate-limit-burst
* @default 0
*/
rate_limit_burst?: int;
/**
* Enable backoff and retry when we hit rate limits.
* CLI flag: -compactor.grpc-client.backoff-on-ratelimits
* @default true
*/
backoff_on_ratelimits?: boolean;
backoff_config?: {
/**
* Minimum delay when backing off.
* CLI flag: -compactor.grpc-client.backoff-min-period
* @default "100ms"
*/
min_period?: duration;
/**
* Maximum delay when backing off.
* CLI flag: -compactor.grpc-client.backoff-max-period
* @default "10s"
*/
max_period?: duration;
/**
* Number of times to backoff and retry before failing.
* CLI flag: -compactor.grpc-client.backoff-retries
* @default 10
*/
max_retries?: int;
};
/**
* Initial stream window size. Values less than the default are not supported
* and are ignored. Setting this to a value other than the default disables the
* BDP estimator.
* CLI flag: -compactor.grpc-client.initial-stream-window-size
* @default "63KiB1023B"
*/
initial_stream_window_size?: int;
/**
* Initial connection window size. Values less than the default are not
* supported and are ignored. Setting this to a value other than the default
* disables the BDP estimator.
* CLI flag: -compactor.grpc-client.initial-connection-window-size
* @default "63KiB1023B"
*/
initial_connection_window_size?: int;
/**
* Enable TLS in the gRPC client. This flag needs to be enabled when any other
* TLS flag is set. If set to false, insecure connection to gRPC server will be
* used.
* CLI flag: -compactor.grpc-client.tls-enabled
* @default true
*/
tls_enabled?: boolean;
/**
* Path to the client certificate, which will be used for authenticating with
* the server. Also requires the key path to be configured.
* CLI flag: -compactor.grpc-client.tls-cert-path
* @default ""
*/
tls_cert_path?: string;
/**
* Path to the key for the client certificate. Also requires the client
* certificate to be configured.
* CLI flag: -compactor.grpc-client.tls-key-path
* @default ""
*/
tls_key_path?: string;
/**
* Path to the CA certificates to validate server certificate against. If not
* set, the host's root CA certificates are used.
* CLI flag: -compactor.grpc-client.tls-ca-path
* @default ""
*/
tls_ca_path?: string;
/**
* Override the expected name on the server certificate.
* CLI flag: -compactor.grpc-client.tls-server-name
* @default ""
*/
tls_server_name?: string;
/**
* Skip validating server certificate.
* CLI flag: -compactor.grpc-client.tls-insecure-skip-verify
* @default true
*/
tls_insecure_skip_verify?: boolean;
/**
* Override the default cipher suite list (separated by commas). Allowed
* values:
*
* Secure Ciphers:
* - TLS_AES_128_GCM_SHA256
* - TLS_AES_256_GCM_SHA384
* - TLS_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
* - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
* - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
*
* Insecure Ciphers:
* - TLS_RSA_WITH_RC4_128_SHA
* - TLS_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA
* - TLS_RSA_WITH_AES_256_CBC_SHA
* - TLS_RSA_WITH_AES_128_CBC_SHA256
* - TLS_RSA_WITH_AES_128_GCM_SHA256
* - TLS_RSA_WITH_AES_256_GCM_SHA384
* - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_RC4_128_SHA
* - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
* - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
* - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
* CLI flag: -compactor.grpc-client.tls-cipher-suites
* @default ""
*/
tls_cipher_suites?: string;
/**
* Override the default minimum TLS version. Allowed values: VersionTLS10,
* VersionTLS11, VersionTLS12, VersionTLS13
* CLI flag: -compactor.grpc-client.tls-min-version
* @default ""
*/
tls_min_version?: string;
/**
* The maximum amount of time to establish a connection. A value of 0 means
* default gRPC client connect timeout and backoff.
* CLI flag: -compactor.grpc-client.connect-timeout
* @default "5s"
*/
connect_timeout?: duration;
/**
* Initial backoff delay after first connection failure. Only relevant if
* ConnectTimeout > 0.
* CLI flag: -compactor.grpc-client.connect-backoff-base-delay
* @default "1s"
*/
connect_backoff_base_delay?: duration;
/**
* Maximum backoff delay when establishing a connection. Only relevant if
* ConnectTimeout > 0.
* CLI flag: -compactor.grpc-client.connect-backoff-max-delay
* @default "5s"
*/
connect_backoff_max_delay?: duration;
};
/**
* The limits_config block configures global and per-tenant limits in Loki. The
* values here can be overridden in the `overrides` section of the runtime_config
* file
*/
limits_config?: limits_config;
/**
* The frontend_worker configures the worker - running within the Loki querier -
* picking up and executing queries enqueued by the query-frontend.
*/
frontend_worker?: frontend_worker;
/**
* The table_manager block configures the table manager for retention.
*/
table_manager?: table_manager;
/**
* Configuration for memberlist client. Only applies if the selected kvstore is
* memberlist.
*
* When a memberlist config with atleast 1 join_members is defined, kvstore of
* type memberlist is automatically selected for all the components that require
* a ring unless otherwise specified in the component's configuration section.
*/
memberlist?: memberlist;
/**
* Configuration for 'runtime config' module, responsible for reloading runtime
* configuration file.
*/
runtime_config?: runtime_config;
/**
* These are values which allow you to control aspects of Loki's operation, most
* commonly used for controlling types of higher verbosity logging, the values
* here can be overridden in the `configs` section of the `runtime_config` file.
*/
operational_config?: operational_config;
/**
* Configuration for tracing.
*/
tracing?: tracing;
/**
* Configuration for analytics.
*/
analytics?: analytics;
/**
* Common configuration to be shared between multiple modules. If a more specific
* configuration is given in other sections, the related configuration within
* this section will be ignored.
*/
common?: common;
/**
* How long to wait between SIGTERM and shutdown. After receiving SIGTERM, Loki
* will report 503 Service Unavailable status via /ready endpoint.
* CLI flag: -shutdown-delay
* @default "0s"
*/
shutdown_delay?: duration;
/**
* Namespace of the metrics that in previous releases had cortex as namespace.
* This setting is deprecated and will be removed in the next minor release.
* CLI flag: -metrics-namespace
* @default "loki"
*/
metrics_namespace?: string;
};
// Scalar aliases used by the Loki documentation. This bit is hand-written.
/** Presumably an ISO-8601 timestamp, except that in the one place it's used, it asks for a plain calendar date. Consult the docs. **/
type daytime = string;
/** any integer matching the regular expression [1-9]+[0-9]* **/
type int = number;
type float = number;
/** a duration matching the regular expression /[0-9]+(ns|us|µs|ms|[smh])/ **/
type duration = string;
/** a string matching the regular expression `[a-zA-Z_][a-zA-Z0-9_]*` **/
type labelname = string;
/** a string of unicode characters **/
type labelvalue = string;
/** a valid path relative to current working directory or an absolute path. **/
type filename = string;
/** a valid string consisting of a hostname or IP followed by an optional port number **/
type host = string;
/** a string that represents a secret, such as a password **/
type secret = string;
type url = string;
/** Undocumented. I think this is a string, but I'm not sure **/
type Label = string;
/** Undocumented, but this is pretty obvious. Don't try to use a Javascript regex here. It needs to be serialized to YAML. **/
type Regexp = string;
/** Undocumented. **/
type RemoteWriteConfig = unknown;
/** Undocumented. **/
type StreamRetention = unknown;
/** Not documented on page. @see https://grafana.com/docs/loki/latest/operations/blocking-queries/ */
type blocked_query = any;
/** Undocumented - this is a guess. **/
type headers = Record<string, string>;
/** Undocumented **/
type relabel_config = unknown;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment