Skip to content

Getting metrics to show up in crowdsec console #93

@andreatitolo

Description

@andreatitolo

Hi!

I am trying to get the bouncer metrics to show up in the crowdsec console and I guess also when running docker exec crowdsec cscli metrics show bouncers. For now I am only seeing the firewall-bouncer correctly.
Note that the caddy bouncer works correctly, I tested, and I can see it interfacing with the crowdsec API and successfully blocking IPs.

However, in the caddy bouncer logs I have this 'usage metrics disabled'. Is this the reason I'm not seeing Caddy bouncer metrics in the CrowdSec dashboard or in the bouncers metrics?

{
  "level": "info",
  "ts": redacted,
  "logger": "crowdsec",
  "msg": "usage metrics disabled",
  "instance_id": "redacted",
  "address": "http://crowdsec:8080/"
}

Context, I built caddy with xcaddy.

Dockerfile
FROM caddy:2.10.0-builder-alpine AS builder

RUN xcaddy build \
  --with github.com/hslatman/caddy-crowdsec-bouncer/http@main \
  --with github.com/hslatman/caddy-crowdsec-bouncer/layer4@main \
  --with github.com/hslatman/caddy-crowdsec-bouncer/appsec@main

FROM caddy:2.10.0-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
Caddyfile
{
        order crowdsec before respond
        crowdsec {
                api_url http://crowdsec:8080
                api_key API_KEY
                ticker_interval 3s
                appsec_url http://crowdsec:7422
        }
}

example.domain.com {

    reverse_proxy http://service:port
    crowdsec

}

Other things I tried to check:

Inspect the bouncer in crowdsec:

docker exec crowdsec cscli bouncers inspect [email protected]
-------------------------------------------------------
 Bouncer: [email protected]
-------------------------------------------------------
 Created At    2025-07-21 21:23:46.549413192 +0000 UTC
 Last Update   2025-08-14 12:46:16.338309782 +0000 UTC
 Revoked?      false
 IP Address    redacted
 Type          caddy-cs-bouncer
 Version       v0.9.2
 Last Pull     2025-08-14 12:46:16.325186784 +0000 UTC
 Auth type     api-key
 OS            ?
 Auto Created  true
-------------------------------------------------------⏎  

Check CrowdSec runtime information (docker exec caddy caddy crowdsec info)

{
  "Streaming": {
    "Enabled": true,
    "Interval": "3s"
  },
  "Live": {
    "Enabled": true,
    "Mode": "adhoc"
  },
  "AppSec": {
    "Enabled": true
  },
  "ShouldFailHard": false,
  "AuthType": "apikey",
  "UserAgent": "caddy-cs-bouncer/v0.9.2",
  "InstanceID": "redacted",
  "Uptime": 1176707632749,
  "NumberOfActiveDecisions": 15025
}

Checking if I can ping the crowdsec api with docker exec caddy caddy crowdsec ping responds in 'success'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions