{{define "runtime_metrics"}}

Runtime

Counters held in this process, not in the database: they start at zero when the proxy starts and are lost on restart. Everything above comes from the database instead, and survives a restart — so a low count here alongside a large one above just means the proxy started recently.

Requests
{{.Requests}}
In flight
{{.ActiveRequests}}
Mean latency
{{.RequestMean}}
Artifact hit rate
{{if .ArtifactCache.HasTraffic}}{{.ArtifactCache.HitRatio}}%{{else}}—{{end}}
Upstream fetches
{{.UpstreamFetches}} · {{.UpstreamFetchMean}}
Served
{{.ResponseBytes}}
{{template "runtime_counts" dict "Title" "Responses by status" "Rows" .StatusClasses "Empty" "No requests yet"}} {{template "runtime_cache" dict "Title" "Artifact cache lookups" "Lookups" .ArtifactCache}}
{{template "runtime_cache" dict "Title" "Metadata cache lookups" "Lookups" .MetadataCache}}
served from cache
{{.MetadataServed}}
{{template "runtime_stats" dict "Title" "Storage operations" "Rows" .StorageOps "Empty" "No storage operations yet"}} {{template "runtime_counts" dict "Title" "Upstream errors" "Rows" .UpstreamErrors "Empty" "None"}} {{template "runtime_counts" dict "Title" "Storage errors" "Rows" .StorageErrors "Empty" "None"}} {{template "runtime_counts" dict "Title" "Integrity failures" "Rows" .IntegrityFailures "Empty" "None"}} {{template "runtime_counts" dict "Title" "Health probe failures" "Rows" .ProbeFailures "Empty" "None"}} {{template "runtime_counts" dict "Title" "Evicted artifacts" "Rows" .Evictions "Empty" "None"}} {{template "runtime_counts" dict "Title" "Evicted metadata" "Rows" .MetadataEvictions "Empty" "None"}} {{template "runtime_counts" dict "Title" "Metadata changed upstream" "Rows" .ChangeFeedExpired "Empty" "None"}} {{template "runtime_counts" dict "Title" "Circuit breaker trips" "Rows" .BreakerTrips "Empty" "None"}}

Circuit breakers

{{if .Breakers}}
{{range .Breakers}}
{{.Registry}}
{{if .Open}} {{.State}} {{else}} {{.State}} {{end}}
{{end}}
{{else}}

None reported — a breaker appears once its upstream has been fetched from.

{{end}}
{{if and .HasFailures (not .FailureDetailsOn)}}

Per-failure detail is off. Set ui_failure_details: true to list the packages, URLs and errors behind each failure count here, once /ui is behind authentication; the same detail is in the log.

{{end}}

Request sources

{{if .SourcesOn}}

{{if .TrustsForward}}Attributed by X-Forwarded-For{{else}}Attributed by peer address{{end}} {{- if .SourceCount}} · {{.SourceCount}} tracked{{end}}

{{end}}
{{if not .SourcesOn}}

Per-caller addresses are off. Set ui_request_sources: true to show them here, once /ui is behind authentication; the per-request detail is in the access log.

{{else if .Sources}} {{range .Sources}} {{end}}
Address Client Requests Downloaded Last seen
{{.Addr}} {{.Client}} {{.Requests}} {{.Bytes}} {{.LastSeen}}
{{else}}

No requests recorded yet.

{{end}}

By client

{{if .Clients}} {{range .Clients}} {{end}}
{{.Client}} {{.Requests}} {{.Bytes}}
{{else}}

None yet.

{{end}}
{{if .ScanningOn}}

Pre-cache scanning

{{template "runtime_stats" dict "Title" "Scans" "Rows" .Scans "Empty" "No scans yet"}} {{template "runtime_counts" dict "Title" "Artifacts blocked" "Rows" .ScansBlocked "Empty" "None"}} {{template "runtime_counts" dict "Title" "Scan errors" "Rows" .ScanErrors "Empty" "None"}}
{{else}}

Pre-cache scanning

Not configured. Enable it under scanning in the config to have artifacts scanned before they are committed to the cache.

{{end}}
{{end}} {{/* runtime_counts renders a labelled counter list, tinting failure rows. */}} {{define "runtime_counts"}}

{{.Title}}

{{if .Rows}}
{{range .Rows}}
{{.Label}}
{{.Count}}
{{if .Recent}}
{{template "recent_failures" .Recent}}
{{end}}
{{end}}
{{else}}

{{.Empty}}

{{end}}
{{end}} {{/* recent_failures lists the latest failures behind a failure count, newest first. */}} {{define "recent_failures"}}
Latest {{len .}}
{{end}} {{/* runtime_stats renders a histogram list: how many observations, and their mean. */}} {{define "runtime_stats"}}

{{.Title}}

{{if .Rows}} {{range .Rows}} {{end}}
count mean
{{.Label}} {{.Count}} {{.Mean}}
{{else}}

{{.Empty}}

{{end}}
{{end}} {{define "runtime_cache"}}

{{.Title}}

hits
{{.Lookups.Hits}}
misses
{{.Lookups.Misses}}
hit rate
{{if .Lookups.HasTraffic}}{{.Lookups.HitRatio}}%{{else}}—{{end}}
{{end}}