m
This commit is contained in:
@@ -9,28 +9,48 @@ counter registry_push_upload_bytes_total by repo, user, node
|
|||||||
counter registry_push_upload_seconds_total by repo, user, node
|
counter registry_push_upload_seconds_total by repo, user, node
|
||||||
|
|
||||||
# -------- Field extraction (order-independent)
|
# -------- Field extraction (order-independent)
|
||||||
/"method":"([A-Z]+)"/ { method = $1 }
|
/"method":"([A-Z]+)"/ {
|
||||||
/"path":"([^"]+)"/ { path = $1 }
|
method = $1
|
||||||
/"remote_address":"([^"]*)"/ { node = $1 }
|
}
|
||||||
/"remote_user":"([^"]*)"/ { user = $1 }
|
/"path":"([^"]+)"/ {
|
||||||
/"status":([0-9]{3})/ { status = $1 }
|
path = $1
|
||||||
/"request_time":([0-9.]+)/ { request_time = $1 }
|
}
|
||||||
/"body_bytes_sent":([0-9]+)/ { body_bytes_sent = $1 }
|
/"remote_address":"([^"]*)"/ {
|
||||||
/"upstream_range":"([^"]*)"/ { up_range = $1 }
|
node = $1
|
||||||
/"docker_upload_uuid":"([^"]*)"/ { upload_uuid = $1 }
|
}
|
||||||
/"docker_content_digest":"([^"]*)"/ { digest = $1 }
|
/"remote_user":"([^"]*)"/ {
|
||||||
|
user = $1
|
||||||
|
}
|
||||||
|
/"status":([0-9]{3})/ {
|
||||||
|
status = $1
|
||||||
|
}
|
||||||
|
/"request_time":([0-9.]+)/ {
|
||||||
|
request_time = $1
|
||||||
|
}
|
||||||
|
/"body_bytes_sent":([0-9]+)/ {
|
||||||
|
body_bytes_sent = $1
|
||||||
|
}
|
||||||
|
/"upstream_range":"([^"]*)"/ {
|
||||||
|
up_range = $1
|
||||||
|
}
|
||||||
|
/"docker_upload_uuid":"([^"]*)"/ {
|
||||||
|
upload_uuid = $1
|
||||||
|
}
|
||||||
|
/"docker_content_digest":"([^"]*)"/ {
|
||||||
|
digest = $1
|
||||||
|
}
|
||||||
|
|
||||||
# Capture namespace/repo between /v2/ and the next section (blobs|manifests|tags|_catalog)
|
# Capture namespace/repo between /v2/ and the next section (blobs|manifests|tags|_catalog)
|
||||||
/"path":"\/v2\/(.+?)\/(blobs|manifests|tags|_catalog)/ {
|
/"path":"\/v2\/(.+?)\/(blobs|manifests|tags|_catalog)/ {
|
||||||
repo = $1
|
repo = $1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Defaults per line (and a tiny reset)
|
# Defaults per line (and explicit init)
|
||||||
/$/ {
|
/$/ {
|
||||||
if repo == "" { repo = "unknown" }
|
if repo == "" { repo = "unknown" }
|
||||||
if user == "" { user = "anonymous" }
|
if user == "" { user = "anonymous" }
|
||||||
if node == "" { node = "unknown" }
|
if node == "" { node = "unknown" }
|
||||||
if uploaded_bytes == 0 { uploaded_bytes = 0 } # explicit init per line
|
if uploaded_bytes == 0 { uploaded_bytes = 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
# Helper: parse upstream_range "a-b" => bytes = b+1
|
# Helper: parse upstream_range "a-b" => bytes = b+1
|
||||||
|
|||||||
Reference in New Issue
Block a user