Skip to content

Metrics

LinuxChata edited this page Sep 5, 2025 · 1 revision

The Shark.Fido2.Sample application exposes metrics at the /metrics endpoint.

Running the Prometheus Server

  1. Create a prometheus.yml file with the following content:

    global:
      scrape_interval: 5s
    
    scrape_configs:
      - job_name: "shark_fido2_sample"
        scheme: https
        tls_config:
          insecure_skip_verify: true
        static_configs:
          - targets: ["host.docker.internal:8082"]
    
  2. Start the Prometheus server in Docker

    docker run -p 9090:9090 -v ./prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus.

  3. Start the sample application.

  4. Open the application at https://localhost:8082/.

  5. Interact with the application (e.g., create public key credentials).

  6. Open the Prometheus server UI at http://localhost:9090/

  7. Run the following sample query and switch to the Graph tab to view requests per second (RPS) across all endpoints:

    sum(rate(http_requests_received_total[1m]))

Clone this wiki locally