Starting Prometheus

Start Prometheus with your newly created configuration file:

./prometheus

It should log a number of startup messages and then start serving on port 9090:

time=2025-02-18T15:28:38.155Z level=INFO source=main.go:640 msg="No time or size retention was set so using the default time retention" duration=15d
time=2025-02-18T15:28:38.155Z level=INFO source=main.go:687 msg="Starting Prometheus Server" mode=server version="(version=3.2.0, branch=HEAD, revision=bf7ec404b2a4933a81b0ffe2baba32b92d471655)"
time=2025-02-18T15:28:38.155Z level=INFO source=main.go:692 msg="operational information" build_context="(go=go1.23.6, platform=linux/amd64, user=root@793dd0d4a527, date=20250217-18:43:06, tags=netgo,builtinassets,stringlabels)" host_details="(Linux 6.12.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 18 Jan 2025 02:26:57 +0000 x86_64 workstation (none))" fd_limits="(soft=524288, hard=524288)" vm_limits="(soft=unlimited, hard=unlimited)"
time=2025-02-18T15:28:38.155Z level=INFO source=main.go:768 msg="Leaving GOMAXPROCS=20: CPU quota undefined" component=automaxprocs
time=2025-02-18T15:28:38.156Z level=INFO source=web.go:654 msg="Start listening for connections" component=web address=0.0.0.0:9090
time=2025-02-18T15:28:38.156Z level=INFO source=main.go:1228 msg="Starting TSDB ..."
time=2025-02-18T15:28:38.157Z level=INFO source=tls_config.go:347 msg="Listening on" component=web address=[::]:9090
time=2025-02-18T15:28:38.157Z level=INFO source=tls_config.go:350 msg="TLS is disabled." component=web http2=false address=[::]:9090
time=2025-02-18T15:28:38.158Z level=INFO source=head.go:628 msg="Replaying on-disk memory mappable chunks if any" component=tsdb
time=2025-02-18T15:28:38.158Z level=INFO source=head.go:715 msg="On-disk memory mappable chunks replay completed" component=tsdb duration=737ns
time=2025-02-18T15:28:38.158Z level=INFO source=head.go:723 msg="Replaying WAL, this may take a while" component=tsdb
time=2025-02-18T15:28:38.158Z level=INFO source=head.go:795 msg="WAL segment loaded" component=tsdb segment=0 maxSegment=0
time=2025-02-18T15:28:38.158Z level=INFO source=head.go:832 msg="WAL replay completed" component=tsdb checkpoint_replay_duration=10.267µs wal_replay_duration=139.163µs wbl_replay_duration=145ns chunk_snapshot_load_duration=0s mmap_chunk_replay_duration=737ns total_replay_duration=169.282µs
time=2025-02-18T15:28:38.159Z level=INFO source=main.go:1249 msg="filesystem information" fs_type=EXT4_SUPER_MAGIC
time=2025-02-18T15:28:38.159Z level=INFO source=main.go:1252 msg="TSDB started"
time=2025-02-18T15:28:38.159Z level=INFO source=main.go:1437 msg="Loading configuration file" filename=prometheus.yml
time=2025-02-18T15:28:38.159Z level=INFO source=main.go:1476 msg="updated GOGC" old=100 new=75
time=2025-02-18T15:28:38.159Z level=INFO source=main.go:1486 msg="Completed loading of configuration file" db_storage=667ns remote_storage=703ns web_handler=81ns query_engine=364ns scrape=64.45µs scrape_sd=10.547µs notify=502ns notify_sd=301ns rules=938ns tracing=3.166µs filename=prometheus.yml totalDuration=176.565µs
time=2025-02-18T15:28:38.159Z level=INFO source=main.go:1213 msg="Server is ready to receive web requests."
time=2025-02-18T15:28:38.159Z level=INFO source=manager.go:175 msg="Starting rule manager..." component="rule manager"

By default, Prometheus stores its database in the ./data directory (this can be configured using the flag --storage.tsdb.path) and reads its configuration from the file prometheus.yml (flag --config.file).

NOTE: Any settings provided via the configuration file are reloadable during runtime (by sending a HUP signal or by triggering a reload via the HTTP API), while any changes to flag-based settings require a full server restart to take effect.

You should now be able to reach the Prometheus server's query page at http://<machine-ip>:9090/:

Prometheus query page

Give the server a couple of seconds to collect data about itself from its own HTTP metrics endpoint.

You can also verify that Prometheus is serving metrics about itself by navigating to its metrics endpoint: http://<machine-ip>:9090/metrics

This should show a long list of metrics looking something like this:

# HELP go_gc_cycles_automatic_gc_cycles_total Count of completed GC cycles generated by the Go runtime.
# TYPE go_gc_cycles_automatic_gc_cycles_total counter
go_gc_cycles_automatic_gc_cycles_total 14
# HELP go_gc_cycles_forced_gc_cycles_total Count of completed GC cycles forced by the application.
# TYPE go_gc_cycles_forced_gc_cycles_total counter
go_gc_cycles_forced_gc_cycles_total 0
# HELP go_gc_cycles_total_gc_cycles_total Count of all completed GC cycles.
# TYPE go_gc_cycles_total_gc_cycles_total counter
go_gc_cycles_total_gc_cycles_total 14
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 3.0831e-05
go_gc_duration_seconds{quantile="0.25"} 8.0444e-05
go_gc_duration_seconds{quantile="0.5"} 0.000176452
go_gc_duration_seconds{quantile="0.75"} 0.00024054
go_gc_duration_seconds{quantile="1"} 0.000409422
go_gc_duration_seconds_sum 0.002412221
go_gc_duration_seconds_count 14
# HELP go_gc_gogc_percent Heap size target percentage configured by the user, otherwise 100. This value is set by the GOGC environment variable, and the runtime/debug.SetGCPercent function.
# TYPE go_gc_gogc_percent gauge
go_gc_gogc_percent 75
# HELP go_gc_gomemlimit_bytes Go runtime memory limit configured by the user, otherwise math.MaxInt64. This value is set by the GOMEMLIMIT environment variable, and the runtime/debug.SetMemoryLimit function.
# TYPE go_gc_gomemlimit_bytes gauge
go_gc_gomemlimit_bytes 9.223372036854776e+18

# [...]