title: Traefik rate-limiting with docker labels
body: <p>I have problems setting up rateimiting with labels for docker backends using traefik 1.5-rc3</p>
  
  <p>Setting the following labels</p>
  
  <pre><code># enable rate limitation on frontend per IP. 5 Request avg per 3s, 15 Reqs in a row
  # see https://github.com/containous/traefik/blob/v1.5/docs/configuration/commons.md#rate-limiting
        - "traefik.frontend.rateLimit.extractorFunc=client.ip"
        - "traefik.frontend.rateLimit.rateSet.r1.period=3s"
        - "traefik.frontend.rateLimit.rateSet.r1.average=5"
        - "traefik.frontend.rateLimit.rateSet.r1.burst=15"
        - "traefik.frontend.rateLimit.rateSet.r2.period=10s"
        - "traefik.frontend.rateLimit.rateSet.r2.average=50"
        - "traefik.frontend.rateLimit.rateSet.r2.burst=100"
  </code></pre>
  
  <p>Does not print any rate-limiting output in the logfiles, nor is the configuration visible e.g. in the <code>/api</code> frontend structure:
  There is no error message or anything:</p>
  
  <pre><code>time="2018-01-17T16:11:08Z" level=debug msg="Could not load traefik.frontend.whitelistSourceRange labels"
  time="2018-01-17T16:11:08Z" level=debug msg="Could not load traefik.frontend.auth.basic labels"
  time="2018-01-17T16:11:08Z" level=debug msg="Validation of load balancer method for backend backend-xxx-xxx-1-xxx-xxxx-default failed: invalid load-balancing method ''. Using default method wrr."
  time="2018-01-17T16:11:08Z" level=debug msg="Configuration received from provider docker: {"backends":{"backend-xxx-xxx-1-xxx-xxx-default":{"servers":{"service-0":{"url":"http://172.20.0.5:3000","weight":0}},"loadBalancer":{"method":"wrr"}},"backend-xxx-xxx":{"loadBalancer":{"method":"wrr"},"maxConn":{"amount":10,"extractorFunc":"request.host"}}},"frontends":{"frontend-xxx-xxx-1-xxx-xxx-default":{"entryPoints":["http"],"backend":"backend-xxx-xxx-1-xxx-xxx-default","routes":{"service-default":{"rule":"Host:localhost"}},"passHostHeader":true,"priority":0,"basicAuth":[]}}}"
  </code></pre>
  
  <p>Same configuration in a static configuration toml:</p>
  
  <pre><code>[frontends.xxx.ratelimit]
  extractorfunc = "client.ip"
      [frontends.xxx.ratelimit.rateset.rateset1]
      period = "10s"
      average = 100
      burst = 200
      [frontends.xxx.ratelimit.rateset.rateset2]
      period = "3s"
      average = 5
      burst = 10
  </code></pre>
  
  <p>seems to work, because the logging states <code>Creating load-balancer rate limiter</code>:</p>
  
  <pre><code>{"loadBalancer":{"method":"wrr"}}},"frontends":{"xxx":{"entryPoints":["http"],"backend":"xxx","routes":{"test_1":{"rule":"Host:xxx,localhost"}},"priority":0,"basicAuth":null,"ratelimit":{"rateset":{"rateset1":{"period":10000000000,"average":100,"burst":200},"rateset2":{"period":3000000000,"average":5,"burst":10}},"extractorFunc":"client.ip"}}}}"
  ...
  time="2018-01-17T16:11:08Z" level=debug msg="Creating backend xxx"
  time="2018-01-17T16:11:08Z" level=debug msg="Creating load-balancer wrr"
  time="2018-01-17T16:11:08Z" level=debug msg="Creating load-balancer rate limiter"
  time="2018-01-17T16:11:08Z" level=debug msg="Creating retries max attempts 0"
  </code></pre>
  
  <p>Looking at the <a href="https://github.com/containous/traefik/pull/2584/files#diff-14d3729b1efef142844a9ed65045dc2d" rel="nofollow noreferrer">source-code</a> labels seems to be fine.</p>
  
  <p>What am I missing ? I just noted, the different casing on extractorfunc (backend) and extractorFunc (frontend) in the parsing methods.</p>
  
  <p>What needs to be done to setup rate limits via labels?</p>