package com.lanyuanxiaoyao.service.executor.metrics;

import org.apache.flink.annotation.docs.Documentation;
import org.apache.flink.configuration.ConfigOption;

import static org.apache.flink.configuration.ConfigOptions.key;

/**
 * Config options for the {@link VictoriaMetricsReporter}.
 */
@Documentation.SuffixOption
public class VictoriaMetricsOptions {
    public static final ConfigOption<String> ENDPOINT =
            key("endpoint")
                    .stringType()
                    .noDefaultValue()
                    .withDescription("Victoria metrics endpoint. eg: http://localhost:8428/api/v1/import/prometheus");

    public static final ConfigOption<Integer> TIMEOUT =
            key("timeout")
                    .intType()
                    .defaultValue(60000)
                    .withDescription("Http push timeout. Default 1 minute");

    public static final ConfigOption<String> TAGS =
            key("tags")
                    .stringType()
                    .defaultValue("")
                    .withDescription("Extra tags for every metric");

    public static final ConfigOption<Boolean> ENABLE_AUTH =
            key("enable.auth")
                    .booleanType()
                    .defaultValue(false)
                    .withDescription("Enable metric server http basic auth");

    public static final ConfigOption<String> AUTH_USERNAME =
            key("auth.username")
                    .stringType()
                    .defaultValue("")
                    .withDescription("Basic auth username");

    public static final ConfigOption<String> AUTH_PASSWORD =
            key("auth.password")
                    .stringType()
                    .defaultValue("")
                    .withDescription("Basic auth password");
}
