Skip to main content

Features

Prometheus includes various experimental and production features that can be enabled via environment variables.

Enabling Features

All feature flags are boolean (true/false):

environment:
PROMETHEUS_ENABLE_NATIVE_HISTOGRAM: "true"
PROMETHEUS_ENABLE_EXEMPLAR_STORAGE: "true"
# ... other features

Native Histogram

Native histograms provide higher fidelity for histogram metrics:

environment:
PROMETHEUS_ENABLE_NATIVE_HISTOGRAM: "true"

This enables the /api/v2/format endpoint and native histogram support in the scrape configuration.

Exemplar Storage

Store traces alongside metrics for correlation:

environment:
PROMETHEUS_ENABLE_EXEMPLAR_STORAGE: "true"

Exemplars can be attached to histogram metrics using the trace_id label.

Memory Snapshot on Shutdown

Save in-memory WAL to disk on container shutdown:

environment:
PROMETHEUS_ENABLE_MEMORY_SNAPSHOT_ON_SHUTDOWN: "true"

This helps preserve data that hasn't been compacted yet.

Web Lifecycle

Enable configuration reload and shutdown endpoints:

environment:
PROMETHEUS_ENABLE_WEB_LIFECYCLE: "true"

This enables:

  • POST /-/reload - Reload configuration
  • GET /-/quit - Shutdown gracefully

Remote Write Receiver

Receive metrics from remote Prometheus instances:

environment:
PROMETHEUS_ENABLE_WEB_REMOTE_WRITE_RECEIVER: "true"

OTLP Receiver

Receive OpenTelemetry metrics:

environment:
PROMETHEUS_ENABLE_WEB_OTLP_RECEIVER: "true"

Additional Experimental Features

VariableFeatureDescription
PROMETHEUS_ENABLE_EXTRA_SCRAPE_METRICSExtra scrape metricsInclude additional scrape timing metrics
PROMETHEUS_ENABLE_PER_STEP_STATSPer-step statsEnable per-step statistics in PromQL
PROMETHEUS_ENABLE_PROMQL_FUNCTIONSExperimental PromQL functionsEnable experimental functions
PROMETHEUS_ENABLE_CREATED_TIMESTAMPS_ZERO_INJECTIONZero injection for created timestampsInject zero for missing created timestamps
PROMETHEUS_ENABLE_CONCURRENT_RULE_EVALConcurrent rule evaluationEvaluate rules concurrently
PROMETHEUS_ENABLE_OLD_UIOld UIEnable the classic Prometheus UI
PROMETHEUS_ENABLE_METADATA_WAL_RECORDSMetadata WAL recordsStore metadata in WAL
PROMETHEUS_ENABLE_DELAYED_COMPACTIONDelayed compactionDelay compaction operations
PROMETHEUS_ENABLE_PROMQL_DELAYED_NAME_REMOVALDelayed name removalDelay metric name removal in PromQL
PROMETHEUS_ENABLE_AUTO_RELOAD_CONFIGAuto reload configAutomatically reload config on changes
PROMETHEUS_ENABLE_OLTP_DELTA_CONVERSIONOTLP delta conversionConvert OTLP metrics with delta temporality
PROMETHEUS_ENABLE_PROMQL_DURATION_EXPRDuration expressionsEnable duration expressions in PromQL
PROMETHEUS_ENABLE_OLTP_NATIVE_DELTAOTLP native deltaNative delta ingestion for OTLP
PROMETHEUS_ENABLE_TYPE_AND_UNIT_LABELSType and unit labelsAdd type and unit labels to metrics
PROMETHEUS_ENABLE_USE_UNCACHED_IOUncached I/OUse uncached I/O for storage
services:
prometheus:
image: ghcr.io/supanadit/containers/prometheus:3.8.1-r2
container_name: prometheus
environment:
PROMETHEUS_PORT: 9090
PROMETHEUS_ENABLE_NATIVE_HISTOGRAM: "true"
PROMETHEUS_ENABLE_EXEMPLAR_STORAGE: "true"
PROMETHEUS_ENABLE_WEB_LIFECYCLE: "true"
PROMETHEUS_STORAGE_TSDB_RETENTION_TIME: "30d"
ports:
- "9090:9090"
volumes:
- prometheus_data:/opt/prometheus/data
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml