github.com/go-graphite/carbonapi@v0.17.0/cmd/carbonapi/carbonapi.example.clickhouse.yaml (about)

     1  # Need to be URL, http or https
     2  # This url specifies the backend or a loadbalancer
     3  #
     4  # If you are using carbonzipper you should set it to
     5  # zipper's url
     6  #
     7  # If you are using plain go-carbon or graphite-clickhouse
     8  # you should set it to URL of go-carbon's carbonserver module
     9  # or graphite-clickhouse's http url.
    10  # Listen address, should always include hostname or ip address and a port.
    11  listen: "localhost:8081"
    12  # Controls headers that would be passed to the backend
    13  headersToPass:
    14    - "X-Dashboard-Id"
    15    - "X-Grafana-Org-Id"
    16    - "X-Panel-Id"
    17  # Max concurrent requests to CarbonZipper
    18  concurency: 1000
    19  cache:
    20     # Type of caching. Valid: "mem", "memcache", "null"
    21     type: "mem"
    22     # Cache limit in megabytes
    23     size_mb: 0
    24     # Default cache timeout value. Identical to DEFAULT_CACHE_DURATION in graphite-web.
    25     defaultTimeoutSec: 60
    26     # Only used by memcache type of cache. List of memcache servers.
    27     memcachedServers:
    28         - "127.0.0.1:1234"
    29         - "127.0.0.2:1235"
    30  # Amount of CPUs to use. 0 - unlimited
    31  cpus: 0
    32  # Timezone, default - local
    33  tz: ""
    34  
    35  # By default, functions like aggregate inherit tags from first series (for compatibility with graphite-web)
    36  # If set to true, tags are extracted from seriesByTag arguments
    37  #extractTagsFromArgs: false
    38  functionsConfig:
    39      graphiteWeb: ./graphiteWeb.example.yaml
    40  maxBatchSize: 0
    41  graphite:
    42      # Host:port where to send internal metrics
    43      # Empty = disabled
    44      host: ""
    45      interval: "60s"
    46      prefix: "carbon.api"
    47      # rules on how to construct metric name. For now only {prefix} and {fqdn} is supported.
    48      # {prefix} will be replaced with the content of {prefix}
    49      # {fqdn} will be repalced with fqdn
    50      pattern: "{prefix}.{fqdn}"
    51  # Maximium idle connections to carbonzipper
    52  idleConnections: 1000
    53  pidFile: ""
    54  # See https://github.com/go-graphite/carbonzipper/blob/master/example.conf#L70-L108 for format explanation
    55  upstreams:
    56      # Number of 100ms buckets to track request distribution in. Used to build
    57      # 'carbon.zipper.hostname.requests_in_0ms_to_100ms' metric and friends.
    58      # Requests beyond the last bucket are logged as slow (default of 10 implies
    59      # "slow" is >1 second).
    60      # The last bucket is _not_ called 'requests_in_Xms_to_inf' on purpose, so
    61      # we can change our minds about how many buckets we want to have and have
    62      # their names remain consistent.
    63      buckets: 10
    64      timeouts:
    65          find: "10s"
    66          render: "50s"
    67          connect: "200ms"
    68      # Number of concurrent requests to any given backend - default is no limit.
    69      # If set, you likely want >= MaxIdleConnsPerHost
    70      concurrencyLimitPerServer: 1000
    71  
    72      # Configures how often keep alive packets will be sent out
    73      keepAliveInterval: "30s"
    74  
    75      # Control http.MaxIdleConnsPerHost. Large values can lead to more idle
    76      # connections on the backend servers which may bump into limits; tune with care.
    77      maxIdleConnsPerHost: 1000
    78      backendsv2:
    79          backends:
    80            -
    81              groupName: "clickhouse-cluster1"
    82              # supported:
    83              #    carbonapi_v2_pb - carbonapi 0.11 or earlier version of protocol.
    84              #    carbonapi_v3_pb - new protocol, http interface (native)
    85              #    carbonapi_v3_grpc - new protocol, gRPC interface (native)
    86              #    protobuf, pb, pb3 - same as carbonapi_v2_pb
    87              #    msgpack - protocol used by graphite-web 1.1 and metrictank
    88              #    auto - carbonapi will do it's best to guess if it's carbonapi_v3_pb or carbonapi_v2_pb
    89              #
    90              #  non-native protocols will be internally converted to new protocol, which will increase memory consumption
    91              protocol: "carbonapi_v2_pb"
    92              # supported:
    93              #    "broadcast" - send request to all backends in group and merge responses. This was default behavior for carbonapi 0.11 or earlier
    94              #    "roundrobin" - send request to one backend.
    95              #    "all - same as "broadcast"
    96              #    "rr" - same as "roundrobin"
    97              lbMethod: "rr"
    98              # amount of retries in case of unsuccessful request
    99              maxTries: 3
   100              # amount of metrics per fetch request. Default: 0 - unlimited. If not specified, global will be used
   101              maxBatchSize: 0
   102              # interval for keep-alive http packets. If not specified, global will be used
   103              keepAliveInterval: "30s"
   104              # override for global concurrencyLimit.
   105              concurrencyLimit: 1000
   106              # override for global maxIdleConnsPerHost
   107              maxIdleConnsPerHost: 1000
   108              # per-group timeout override. If not specified, global will be used.
   109              # Please note that ONLY min(global, local) will be used.
   110              timeouts:
   111                  # Maximum backend request time for find requests.
   112                  find: "10s"
   113                  # Maximum backend request time for render requests. This is total one and doesn't take into account in-flight requests.
   114                  render: "50s"
   115                  # Timeout to connect to the server
   116                  connect: "200ms"
   117              servers:
   118                  - "http://127.0.0.2:8080"
   119                  - "http://127.0.0.3:8080"
   120            -
   121              groupName: "clickhouse-cluster-2"
   122              protocol: "carbonapi_v2_pb"
   123              lbMethod: "rr"
   124              maxTries: 3
   125              maxBatchSize: 0
   126              keepAliveInterval: "30s"
   127              concurrencyLimit: 1000
   128              maxIdleConnsPerHost: 1000
   129              timeouts:
   130                  find: "10s"
   131                  render: "50s"
   132                  connect: "200ms"
   133              servers:
   134                  - "http://127.0.0.4:8080"
   135                  - "http://127.0.0.5:8080"
   136  # If not zero, enabled cache for find requests
   137  # This parameter controls when it will expire (in seconds)
   138  # Default: 600 (10 minutes)
   139  graphTemplates: graphTemplates.example.yaml
   140  expireDelaySec: 10
   141  # Uncomment this to get the behavior of graphite-web as proposed in https://github.com/graphite-project/graphite-web/pull/2239
   142  # Beware this will make darkbackground graphs less readable
   143  #defaultColors:
   144  #      "red": "ff0000"
   145  #      "green": "00ff00"
   146  #      "blue": "#0000ff"
   147  #      "darkred": "#c80032"
   148  #      "darkgreen": "00c800"
   149  #      "darkblue": "002173"
   150  logger:
   151      - logger: ""
   152        file: "stderr"
   153        level: "debug"
   154        encoding: "console"
   155        encodingTime: "iso8601"
   156        encodingDuration: "seconds"
   157      - logger: ""
   158        file: "carbonapi.log"
   159        level: "info"
   160        encoding: "json"