github.com/go-graphite/carbonapi@v0.17.0/cmd/carbonapi/carbonapi.example.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  listeners:
    12          - address: "127.0.0.1:8081"
    13          - address: "[::1]:8081"
    14          # OR
    15          - address: "localhost:8081"
    16            # Uncomment if you want to have HTTPS support and point to proper client
    17            # NOTE: in example, snake-oil certificates are assumed
    18            # serverTLSConfig:
    19            #   # specify CA file
    20            #   caCertFiles:
    21            #     - "/etc/ssl/certs/ca-certificates.crt"
    22            #   # specify certificate pairs
    23            #   certificatePairs:
    24            #     - certFile: "/etc/ssl/certs/ssl-cert-snakeoil.pem"
    25            #       privateKeyFile: "/etc/ssl/private/ssl-cert-snakeoil.key"
    26            #   # Required for virtual hosting (in case SNI is used)
    27            #   serverName: "example.com"
    28            #   # If InsecureSkipVerify is set to true, any certificates will be acceptable, this must not be set in production. Ever.
    29            #	  insecureSkipVerify: false
    30            #   # Override minimal supported TLS version, by default 1.3 is in use
    31            #	  minTLSVersion: "TLS 1.3"
    32            #   # Override highest supported TLS version, by default the highest possible for the version of Go used
    33            #   # to compile carbonapi will be advertised.
    34            #	  maxTLSVersion: "TLS 1.3"
    35            #   # Specify ciipher suites that can be used, order will be ignored
    36            #   # Only works with TLS 1.2 or lower as of Go 1.19
    37            #   # List of cipher suites can be seen here: https://cs.opensource.google/go/go/+/refs/tags/go1.19.3:src/crypto/tls/cipher_suites.go;l=53-74
    38            #   # Following list is NOT a recommendation, rather example of how to set them
    39            #	  cipherSuites:
    40            #     - "TLS_AES_256_GCM_SHA384"
    41            #     - "TLS_RSA_WITH_AES_256_GCM_SHA384"
    42            #     - "TLS_CHACHA20_POLY1305_SHA256"
    43            #   # Specify specific eliptic curvers that can be used
    44            #   # List: https://pkg.go.dev/crypto/tls#CurveID
    45            #   # Following list is NOT a recommendation, rather example of how to set them
    46            #   curves:
    47            #     - "CurveP521"
    48            #     - "X25519"
    49            #   # clientAuth is required for mTLS support
    50            #   # Supported options are stated in https://pkg.go.dev/crypto/tls#ClientAuthType
    51            #   # default: NoClientCert
    52            #   # if any other option is specified, you must uncomment and modify clientTLSConfig section
    53            #   clientAuth: "RequireAndVerifyClientCert"
    54            # # section used to specify CAs for mTLS verification. That must be provided even if matches caCertFiles
    55            # clientTLSConfig:
    56            #   caCertFiles:
    57            #     - "cmd/carbonapi/config_tests/mTLS-server.crt"
    58  # OR
    59  listen: "localhost:8081"
    60  
    61  # Specify URL Prefix for all handlers
    62  prefix: ""
    63  # Use custom caching DNS resolver instead of default one. You shouldn't use it unless you know what you are doing.
    64  useCachingDNSResolver: false
    65  # TTL for DNS records in DNS cache. Only matters if `useCachingDNSResolver` is enabled.
    66  cachingDNSRefreshTime: "1m"
    67  # Specify if metrics are exported over HTTP and if they are available on the same address or not
    68  # pprofEnabled controls if extra HTTP Handlers to profile and debug application will be available
    69  expvar:
    70    enabled: true
    71    pprofEnabled: false
    72    listen: ""
    73  # Allow extra charsets in metric names. By default only "Latin" is allowed
    74  # Please note that each unicodeRangeTables will slow down metric parsing a bit
    75  #   For list of supported tables, see: https://golang.org/src/unicode/tables.go?#L3437
    76  #   Special name "all" reserved to append all tables that's currently supported by Go
    77  #unicodeRangeTables:
    78  #   - "Latin"
    79  #   - "Cyrillic"
    80  #   - "Hiragana"
    81  #   - "Katakana"
    82  #   - "Han"
    83  ##   - "all"
    84  # Controls headers that would be passed to the backend
    85  headersToPass:
    86    - "X-Dashboard-Id"
    87    - "X-Grafana-Org-Id"
    88    - "X-Panel-Id"
    89  headersToLog:
    90    - "X-Dashboard-Id"
    91    - "X-Grafana-Org-Id"
    92    - "X-Panel-Id"
    93  # Specify custom function aliases.
    94  # This is example for alias "perMinute(metrics)" that will behave as "perSecond(metric)|scale(60)"
    95  define:
    96    -
    97      name: "perMinute"
    98      template: "perSecond({{.argString}})|scale(60)"
    99  # Control what status code will be returned where /render or find query do not return any metric. Default is 200
   100  notFoundStatusCode: 200
   101  # Max concurrent requests to CarbonZipper
   102  concurency: 1000
   103  cache:
   104     # Type of caching. Valid: "mem", "memcache", "null"
   105     type: "mem"
   106     # Cache limit in megabytes
   107     size_mb: 0
   108     # Default cache timeout value. Identical to DEFAULT_CACHE_DURATION in graphite-web.
   109     defaultTimeoutSec: 60
   110     # Only used by memcache type of cache. List of memcache servers.
   111     memcachedServers:
   112         - "127.0.0.1:1234"
   113         - "127.0.0.2:1235"
   114  # Amount of CPUs to use. 0 - unlimited
   115  cpus: 0
   116  # Timezone, default - local
   117  tz: ""
   118  
   119  # By default, functions like aggregate inherit tags from first series (for compatibility with graphite-web)
   120  # If set to true, tags are extracted from seriesByTag arguments
   121  #extractTagsFromArgs: false
   122  functionsConfig:
   123      graphiteWeb: ./graphiteWeb.example.yaml
   124      timeShift: ./timeShift.example.yaml
   125  #    moving: ./moving.example.yaml
   126  #    movingMedian: ./moving.example.yaml
   127  #    aliasByRedis: ./aliasByRedis.example.yaml
   128  maxBatchSize: 100
   129  graphite:
   130      # Host:port where to send internal metrics
   131      # Empty = disabled
   132      host: ""
   133      interval: "60s"
   134      prefix: "carbon.api"
   135      # rules on how to construct metric name. For now only {prefix} and {fqdn} is supported.
   136      # {prefix} will be replaced with the content of {prefix}
   137      # {fqdn} will be repalced with fqdn
   138      pattern: "{prefix}.{fqdn}"
   139  # Maximium idle connections to carbonzipper
   140  idleConnections: 10
   141  pidFile: ""
   142  # See https://github.com/go-graphite/carbonzipper/blob/master/example.conf#L70-L108 for format explanation
   143  upstreams:
   144      # Use TLD Cache. Useful when you have multiple backends that could contain
   145      # different TLDs.
   146      #
   147      # For example whenever you have multiple top level metric namespaces, like:
   148      #   one_min.some.metric
   149      #   ten_min.some_metric
   150      #   one_hour.some_metric
   151      #
   152      # `one_min`, `ten_min` and `one_hour` are considered to be TLDs
   153      # carbonapi by default will probe all backends and cache the responses
   154      # and will know which backends would contain the prefix of the request
   155      #
   156      # This option allows to disable that, which could be helpful for backends like
   157      # `clickhouse` or other backends where all metrics are part of the same cluster
   158      tldCacheDisabled: false
   159  
   160      # Number of 100ms buckets to track request distribution in. Used to build
   161      # 'carbon.zipper.hostname.requests_in_0ms_to_100ms' metric and friends.
   162      # Requests beyond the last bucket are logged as slow (default of 10 implies
   163      # "slow" is >1 second).
   164      # The last bucket is _not_ called 'requests_in_Xms_to_inf' on purpose, so
   165      # we can change our minds about how many buckets we want to have and have
   166      # their names remain consistent.
   167      buckets: 10
   168  
   169      # If request took more than specified amount of time, it will be logged as a slow request as well
   170      slowLogThreshold: "1s"
   171  
   172      timeouts:
   173          # Maximum backend request time for find requests.
   174          find: "2s"
   175          # Maximum backend request time for render requests. This is total one and doesn't take into account in-flight requests
   176          render: "10s"
   177          # Timeout to connect to the server
   178          connect: "200ms"
   179  
   180      # Number of concurrent requests to any given backend - default is no limit.
   181      # If set, you likely want >= MaxIdleConnsPerHost
   182      concurrencyLimitPerServer: 0
   183  
   184      # Configures how often keep alive packets will be sent out
   185      keepAliveInterval: "30s"
   186  
   187      # Control http.MaxIdleConnsPerHost. Large values can lead to more idle
   188      # connections on the backend servers which may bump into limits; tune with care.
   189      maxIdleConnsPerHost: 100
   190  
   191      # Only affects cases with maxBatchSize > 0. If set to `false` requests after split will be sent out one by one, otherwise in parallel
   192      doMultipleRequestsIfSplit: false
   193  
   194      # "http://host:port" array of instances of carbonserver stores
   195      # It MUST be specified.
   196      backends:
   197          - "http://127.0.0.2:8080"
   198          - "http://127.0.0.3:8080"
   199          - "http://127.0.0.4:8080"
   200          - "http://127.0.0.5:8080"
   201  
   202      #backends section will override this one!
   203      backendsv2:
   204          backends:
   205            -
   206              groupName: "group1"
   207              # supported:
   208              #    carbonapi_v2_pb - carbonapi 0.11 or earlier version of protocol.
   209              #    carbonapi_v3_pb - new protocol, http interface (native)
   210              #    carbonapi_v3_grpc - new protocol, gRPC interface (native)
   211              #    protobuf, pb, pb3 - same as carbonapi_v2_pb
   212              #    msgpack - protocol used by graphite-web 1.1 and metrictank
   213              #    auto - carbonapi will do it's best to guess if it's carbonapi_v3_pb or carbonapi_v2_pb
   214              #
   215              #  non-native protocols will be internally converted to new protocol, which will increase memory consumption
   216              protocol: "carbonapi_v2_pb"
   217              # supported:
   218              #    "broadcast" - send request to all backends in group and merge responses. This was default behavior for carbonapi 0.11 or earlier
   219              #    "roundrobin" - send request to one backend.
   220              #    "all - same as "broadcast"
   221              #    "rr" - same as "roundrobin"
   222              lbMethod: "broadcast"
   223              # amount of retries in case of unsuccessful request
   224              maxTries: 3
   225              # amount of metrics per fetch request. Default: 0 - unlimited. If not specified, global will be used
   226              maxBatchSize: 100
   227              # interval for keep-alive http packets. If not specified, global will be used
   228              keepAliveInterval: "10s"
   229              # override for global concurrencyLimit.
   230              concurrencyLimit: 0
   231              # override for global maxIdleConnsPerHost
   232              maxIdleConnsPerHost: 1000
   233              # force attempt to establish HTTP2 connection, instead of http1.1. Default: false
   234              # Backends must use https for this to take any effect
   235              forceAttemptHTTP2: false
   236              # Only affects cases with maxBatchSize > 0. If set to `false` requests after split will be sent out one by one, otherwise in parallel
   237              doMultipleRequestsIfSplit: false
   238              # per-group timeout override. If not specified, global will be used.
   239              # Please note that ONLY min(global, local) will be used.
   240              timeouts:
   241                  # Maximum backend request time for find requests.
   242                  find: "2s"
   243                  # Maximum backend request time for render requests. This is total one and doesn't take into account in-flight requests.
   244                  render: "50s"
   245                  # Timeout to connect to the server
   246                  connect: "200ms"
   247              servers:
   248                  - "http://127.0.0.2:8080"
   249                  - "http://127.0.0.3:8080"
   250  
   251            -
   252              groupName: "group2"
   253              protocol: "carbonapi_v3_pb"
   254              lbMethod: "roundrobin"
   255              servers:
   256                  - "http://127.0.0.4:8080"
   257                  - "http://127.0.0.5:8080"
   258  
   259  
   260      # carbonsearch is not used if empty
   261      carbonsearch:
   262          # Instance of carbonsearch backend
   263          backend: "http://127.0.0.1:8070"
   264          # carbonsearch prefix to reserve/register
   265          prefix: "virt.v1.*"
   266          # carbonsearch is not used if empty
   267      # carbonsearch section will override this one!
   268      carbonsearchv2:
   269          # Carbonsearch instances. Follows the same syntax as backendsv2
   270          backends:
   271              -
   272                groupName: "group1"
   273                protocol: "carbonapi_v2_pb"
   274                lbMethod: "broadcast"
   275                servers:
   276                    - "http://127.0.0.4:8080"
   277                    - "http://127.0.0.5:8080"
   278          # carbonsearch prefix to reserve/register
   279          prefix: "virt.v1.*"
   280  
   281      # Enable compatibility with graphite-web 0.9
   282      # This will affect graphite-web 1.0+ with multiple cluster_servers
   283      # Default: disabled
   284      graphite09compat: false
   285  # If not zero, enabled cache for find requests
   286  # This parameter controls when it will expire (in seconds)
   287  # Default: 600 (10 minutes)
   288  graphTemplates: graphTemplates.example.yaml
   289  expireDelaySec: 10
   290  # Uncomment this to get the behavior of graphite-web as proposed in https://github.com/graphite-project/graphite-web/pull/2239
   291  # Beware this will make darkbackground graphs less readable
   292  #defaultColors:
   293  #      "red": "ff0000"
   294  #      "green": "00ff00"
   295  #      "blue": "#0000ff"
   296  #      "darkred": "#c80032"
   297  #      "darkgreen": "00c800"
   298  #      "darkblue": "002173"
   299  logger:
   300      - logger: ""
   301        file: "stderr"
   302        level: "debug"
   303        encoding: "console"
   304        encodingTime: "iso8601"
   305        encodingDuration: "seconds"
   306      - logger: ""
   307        file: "carbonapi.log"
   308        level: "info"
   309        encoding: "json"