Skip to content

Prometheus Metrics

Plik exposes Prometheus metrics on a separate HTTP port.

Configuration

toml
MetricsPort = 9090
MetricsAddress = "0.0.0.0"

TIP

MetricsPort defaults to 0 (disabled). Set it to a non-zero port to enable metrics.

Metrics are available at http://localhost:{MetricsPort}/metrics.

Available Metrics

HTTP Metrics

MetricTypeLabelsDescription
plik_http_request_totalCountermethod, path, codeCount of HTTP requests

Server Statistics

MetricTypeDescription
plik_uploads_countGaugeTotal uploads in the database
plik_anonymous_uploads_countGaugeAnonymous uploads in the database
plik_files_countGaugeTotal files in the database
plik_size_bytesGaugeTotal upload size (bytes)
plik_anonymous_size_bytesGaugeAnonymous uploads size (bytes)
plik_users_countGaugeTotal users in the database
plik_server_stats_refresh_duration_secondHistogramDuration of server stats refresh
plik_last_stats_refresh_timestampGaugeTimestamp of the last stats refresh

Cleaning Metrics

MetricTypeDescription
plik_cleaning_removed_uploadsCounterUploads removed (marked for deletion)
plik_cleaning_deleted_filesCounterFiles deleted from data backend
plik_cleaning_deleted_uploadsCounterUploads fully deleted
plik_cleaning_removed_orphan_filesCounterOrphan files cleaned
plik_cleaning_removed_orphan_tokensCounterOrphan tokens cleaned
plik_cleaning_duration_secondHistogramDuration of cleaning runs
plik_last_cleaning_timestampGaugeTimestamp of the last cleaning

Runtime Metrics

Standard Go runtime metrics (goroutines, memory, GC) via ProcessCollector and GoCollector.

Released under the MIT License.