apiVersion: v1
kind: ConfigMap
metadata:
  name: trickster-conf
  labels:
    name: trickster-conf

data:
  trickster-conf: |-
    [main]

        # instance_id allows you to run multiple trickster processes on the same host and log to separate files
        # Useful for baremetal, not so much for elastic deployments, so only uncomment if you really need it
        #instance_id = 1

    # Configuration options for the Proxy Server
    [proxy_server]

        # listen_port defines the port on which Trickster's Proxy server listens.
        # since this is a proxy for Prometheus, we use 9090 by default, just like Prometheus does
        listen_port = 9090

    [cache]
        # cache_type defines what kind of cache Trickster uses
        # options are 'boltdb, 'filesystem', 'memory', and 'redis'.  'memory' is the default
        cache_type = 'memory'

        # record_ttl_secs defines the relative expiration of cached queries. default is 6 hours (21600 seconds)
        record_ttl_secs = 21600

            # Configuration options when using a Redis Cache
            #[cache.redis]

            # protocol defines the protocol for connecting to redis ('unix' or 'tcp') 'tcp' is default
            #protocol = 'tcp'

            # endpoint defines the fqdn+port or path to a unix socket file for connecting to redis
            # default is 'redis:6379'
            #endpoint = 'redis:6379'

            # Configuration options when using a Filesystem Cache
            #[cache.filesystem]

            # cache_path defines the directory location under which the Trickster cache will be maintained
            # default is '/tmp/trickster'
            #cache_path = '/tmp/trickster'
            # Configuration options when using a BoltDb Cache
            #[cache.boltdb]

            # filename defines the file where the Trickster cache will be maintained
            # default is 'trickster.db'
            # filename = 'trickster.db'

            # bucket defines the name of the BotlDb bucket (similar to a namespace) under which our key value store lives
            # default is 'trickster'
            # bucket = 'trickster'


    # Configuration options for mapping Origin(s)
    [origins]

        # The default origin
        [origins.default]

            # origin_url defines the URL of the origin. Default is http://prometheus:9090
            origin_url = 'http://prometheus:9090'

            # api path defines the path of the Prometheus API (usually '/api/v1')
            api_path = '/api/v1'

            # default_step defines the step (in seconds) of a query_range request if one is
            # not provided by the client. This helps to correct improperly formed client requests.
            default_step = 300

            # ignore_no_cache_header disables a client's ability to send a no-cache to refresh a cached query. Default is false
            #ignore_no_cache_header = false

            # max_value_age_secs defines the maximum age of specific datapoints in seconds. Default is 86400 (24 hours)
            max_value_age_secs = 86400

            # fast_forward_disable, when set to true, will turn off the 'fast forward' feature for any requests proxied to this origin
            #fast_forward_disable = false

        # For multi-origin support, origins are named, and the name is the second word of the configuration section name.
        # In this example, an origin is named "foo". Clients can indicate this origin in their path (http://trickster.example.com:9090/foo/query_range?.....)
        # there are other ways for clients to indicate which origin to use in a multi-origin setup. See the documentation for more information
        #[origins.foo]
            #origin_url = 'http://prometheus-foo:9090'
            #api_path = '/api/v1'
            #default_step = 300
            #ignore_no_cache_header = false
            #max_value_age_secs = 86400

    # Configuration Options for Metrics Instrumentation
    [metrics]

        # listen_port defines the port that Trickster's metrics server listens on at /metrics
        listen_port = 8082

    # Configuration Options for Logging Instrumentation
    [logging]

        # log_level defines the verbosity of the logger. Possible values are 'debug', 'info', 'warn', 'error'
        # default is info
        log_level = 'info'

        # log_file defines the file location to store logs. These will be auto-rolled and maintained for you.
        # not specifying a log_file (this is the default behavior) will print logs to STDOUT
        #log_file = '/some/path/to/trickster.log'
