Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Metrics

curl http://serveur:8081/metrics          # Prometheus text, no credential
# prometheus.yml
scrape_configs:
  - job_name: craftfilegate
    static_configs:
      - targets: ['serveur:8081']   # probes_listen, else control_listen, else admin.listen
OutputFormatAccess
GET /metricsPrometheus text 0.0.4public; on [server] probes_listen or control_listen only, when they are set
GET /admin/resourcesthe same snapshot in JSON, plus sessions, active bans, backends, thresholdspermission overview
OTLP exportthe same numbers, one snapshot per interval[telemetry] metrics = true, see Telemetry
  • Values are cumulative since startup, per pod. Compute a rate between two reads (rate()).
  • An unknown value is absent (null in JSON, no data point in OTLP), never 0: the “Absent when” column says when.
  • The OTLP name is the Prometheus name without _total.

Catalog

Prometheus seriesOTLP instrumentTypeLabelsAbsent whenMeaning
craftfilegate_connections_totalcraftfilegate_connectionscounterSSH sessions opened after a successful authentication
craftfilegate_connections_rejected_totalcraftfilegate_connections_rejectedcounterrefusals at the SFTP door, one per attempt (connection_rejected lines with source=sftp, summarized ones included)
craftfilegate_sftp_operations_totalcraftfilegate_sftp_operationscounterop (21 values)SFTP packets received, refusals included
craftfilegate_sftp_bytes_read_totalcraftfilegate_sftp_bytes_readcounterbytes served over SFTP
craftfilegate_sftp_bytes_written_totalcraftfilegate_sftp_bytes_writtencounterbytes accepted over SFTP
craftfilegate_api_requests_totalcraftfilegate_api_requestscounterrequests received by the file API, 429 and refusals included
craftfilegate_banned_ips_totalcraftfilegate_banned_ipscounterban verdicts of this pod, all doors
craftfilegate_sftp_accept_errors_totalcraftfilegate_sftp_accept_errorscounterfailed accept() on the SFTP port
craftfilegate_log_write_errors_totalcraftfilegate_log_write_errorscounterlog or audit lines not written
craftfilegate_audit_refusals_suppressed_totalcraftfilegate_audit_refusals_suppressedcountersource (sftp, api, admin)anonymous refusals summarized instead of written
craftfilegate_audit_refusal_summary_overflow_totalcraftfilegate_audit_refusal_summary_overflowcounterrefusals that arrived with the summary table full
craftfilegate_otel_spans_ended_totalcraftfilegate_otel_spans_endedcountertelemetry offspans ended
craftfilegate_otel_spans_exported_totalcraftfilegate_otel_spans_exportedcountertelemetry offspans accepted by the collector
craftfilegate_otel_spans_export_failed_totalcraftfilegate_otel_spans_export_failedcountertelemetry offspans lost
craftfilegate_admin_tls_cert_not_after_secondscraftfilegate_admin_tls_cert_not_after_secondsgaugeno TLS, unreadable dateexpiry of the served certificate, Unix seconds
craftfilegate_admin_tls_cert_expiry_unreadablecraftfilegate_admin_tls_cert_expiry_unreadablegaugeno TLS1 unreadable date, 0 read
craftfilegate_sftp_rate_limit_tracked_addressescraftfilegate_sftp_rate_limit_tracked_addressesgaugeno [sftp.rate_limit], or before its first sweepaddresses tracked by the limiter
craftfilegate_api_rate_limit_tracked_addressescraftfilegate_api_rate_limit_tracked_addressesgaugeno [api.rate_limit], or before its first sweepsame for the API
craftfilegate_local_userscraftfilegate_local_usersgaugehash_formatno local storelocal accounts per hash format
craftfilegate_reload_watch_modecraftfilegate_reload_watch_modegaugemode (inotify, poll, sighup)before arming1 for the active mode
craftfilegate_jwks_cache_age_secondscraftfilegate_jwks_cache_age_secondsgaugeno JWKS, no successful loadage of the JWKS cache
craftfilegate_jwks_refresh_failures_totalcraftfilegate_jwks_refresh_failurescounterno JWKSfailed refreshes
craftfilegate_jwks_cached_keyscraftfilegate_jwks_cached_keysgaugeno JWKSkeys in the cache
craftfilegate_grants_activecraftfilegate_grants_activegaugeno [admin]temporary accesses that grant their role now
craftfilegate_grant_sessions_cut_totalcraftfilegate_grant_sessions_cutcounterreason (expired, revoked)no [admin]SFTP sessions and REST transfers cut at the end of a temporary access they used
craftfilegate_grants_store_local_onlycraftfilegate_grants_store_local_onlygaugeno [admin]1: temporary accesses held in memory while a cluster peer answers
craftfilegate_cluster_peerscraftfilegate_cluster_peersgaugestatusno [cluster]peers of the channel between instances by status: reachable, unreachable, certificate_mismatch
craftfilegate_cluster_relay_totalcraftfilegate_cluster_relaycounterroute (health, sessions, bans, kick, unban), result (answered, refused, failed)no [cluster]operator requests relayed to a peer
craftfilegate_cluster_cert_not_after_secondscraftfilegate_cluster_cert_not_after_secondsgaugeno [cluster], unreadable dateexpiry of the shared certificate, Unix seconds; never checked
craftfilegate_cluster_reachable_peerscraftfilegate_cluster_reachable_peersgaugeno [cluster]peers reachable in the last round
craftfilegate_cluster_isolatedcraftfilegate_cluster_isolatedgaugeno [cluster]1: fewer than min_peers peers reachable for isolated_after_secs (detectors)
craftfilegate_unready_detectorcraftfilegate_unready_detectorgaugedetector (storage_alone, isolated, isolated_and_storage_down)no [cluster]1 while the detector is active
craftfilegate_withdrawncraftfilegate_withdrawngaugeno [cluster]1: /readyz not ready because of a detector in unready_when
craftfilegate_stale_partials_clock_skew_secondscraftfilegate_stale_partials_clock_skew_secondsgaugebackendnothing measuredstorage clock minus server clock
craftfilegate_password_hash_pool_placescraftfilegate_password_hash_pool_placesgaugeno local storethreads plus queue slots of the hashing pool
craftfilegate_password_hash_pool_in_usecraftfilegate_password_hash_pool_in_usegaugeno local storeslots taken
craftfilegate_password_hash_pool_full_totalcraftfilegate_password_hash_pool_fullcounterno local storeverifications refused because the pool was full
craftfilegate_jwt_refused_totalcraftfilegate_jwt_refusedcounterno JWTtokens refused by the verifier
craftfilegate_backend_operations_totalcraftfilegate_backend_operationscounterbackendbackend unusedcalls to the storage
craftfilegate_backend_errors_totalcraftfilegate_backend_errorscounterbackendbackend unusedstorage failures (I/O, unreachable, credentials refused); not client refusals
craftfilegate_backend_bytes_read_totalcraftfilegate_backend_bytes_readcounterbackendbackend unusedbytes read from the storage
craftfilegate_backend_bytes_written_totalcraftfilegate_backend_bytes_writtencounterbackendbackend unusedbytes written to the storage
craftfilegate_backend_upcraftfilegate_backend_upgaugebackendbefore the first visit, probe off1 the storage answers the probe, 0 it no longer answers
craftfilegate_backend_probe_secondscraftfilegate_backend_probe_secondsgaugebackendsameduration of the last visit
craftfilegate_local_symlink_refusals_totalcraftfilegate_local_symlink_refusalscounterbackendbackend not local or unusedpaths refused with symlink escape
process_resident_memory_bytesprocess_resident_memory_bytesgaugeoutside Linux, /proc silentresident memory
process_peak_resident_memory_bytesprocess_peak_resident_memory_bytesgaugesamepeak resident memory
process_cpu_seconds_totalprocess_cpu_secondscountersameCPU time, user + system
process_threadsprocess_threadsgaugesamethreads

craftfilegate_connections_rejected_total counts per attempt, several per connection: its ratio to craftfilegate_connections_total is not a failure rate per connection.

Console thresholds

[admin.metrics_thresholds] only decides where the Metrics tab flags a tile; the server does not alert. The keys and their defaults: reference.

Alerts

groups:
  - name: craftfilegate
    rules:
      - alert: CraftFileGateAdminCertExpiringSoon
        expr: craftfilegate_admin_tls_cert_not_after_seconds - time() < 30 * 86400
        for: 1h
      - alert: CraftFileGateAdminCertExpiryUnknown
        expr: craftfilegate_admin_tls_cert_expiry_unreadable == 1
      - alert: CraftFileGateBackendErrors
        expr: increase(craftfilegate_backend_errors_total[5m]) > 0
      - alert: CraftFileGateBackendDown
        expr: craftfilegate_backend_up == 0
      - alert: CraftFileGateStorageAlone
        expr: craftfilegate_unready_detector{detector="storage_alone"} == 1
      - alert: CraftFileGateIsolated
        expr: craftfilegate_cluster_isolated == 1

Alerting on a stale JWKS cache

      - alert: CraftFileGateJwksStale
        expr: craftfilegate_jwks_cache_age_seconds > 2 * 3600   # 2 x jwks_refresh_interval_secs
        for: 5m
      - alert: CraftFileGateJwksNeverLoaded
        expr: absent(craftfilegate_jwks_cache_age_seconds) and on() craftfilegate_jwks_cached_keys >= 0
        for: 5m

A stale cache keeps its keys: tokens signed by a key rotated since then are refused. jwks_age_secs makes the same judgment for /admin/status.