Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose envoy metrics in prometheus for autoscaler and jibri #525

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nomad/jibri.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ job "[JOB_NAME]" {
port "http" {
to = 2222
}
port "metrics_envoy" {
to = 9102
}
}

service {
Expand All @@ -109,13 +112,18 @@ job "[JOB_NAME]" {
nomad_allocation = "${NOMAD_ALLOC_ID}"
group = "${NOMAD_META_group}"
release_number = "${var.release_number}"
metrics_port_envoy = "${NOMAD_HOST_PORT_metrics_envoy}"
}

port = "http"

connect {
sidecar_service {
proxy {
config {
# Expose metrics for prometheus (envoy)
envoy_prometheus_bind_addr = "0.0.0.0:9102"
}
upstreams {
destination_name = "autoscaler"
local_bind_port = 2223
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ job [[ template "job_name" . ]] {
}
port "expose2" {
}
port "metrics_envoy" {
to = 9102
}
}

[[ if var "register_service" . ]]
Expand All @@ -53,6 +56,10 @@ job [[ template "job_name" . ]] {
sidecar_service {
tags = ["ip-${attr.unique.network.ip-address}"]
proxy {
config {
# Expose metrics for prometheus (envoy)
envoy_prometheus_bind_addr = "0.0.0.0:9102"
}
local_service_port = 8080
expose {
path {
Expand Down Expand Up @@ -82,6 +89,7 @@ job [[ template "job_name" . ]] {
}
meta {
metrics_port = "${NOMAD_HOST_PORT_expose2}"
metrics_port_envoy = "${NOMAD_HOST_PORT_metrics_envoy}"
}
}
[[ end ]]
Expand Down
19 changes: 19 additions & 0 deletions nomad/telegraf.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ EOF
host = "{{"{{"}}.Node}}"
shard-role = "autoscaler"
role = "autoscaler"
# uncomment for consul connect envoy sidecar metrics (~1700 per sidecar)
# [[inputs.prometheus.consul.query]]
# name = "autoscaler-sidecar-proxy"
# tag = "ip-{{ env "attr.unique.network.ip-address" }}"
# url = 'http://{{"{{"}}if ne .ServiceAddress ""}}{{"{{"}}.ServiceAddress}}{{"{{"}}else}}{{"{{"}}.Address}}{{"{{"}}end}}:{{"{{"}}with .ServiceMeta.metrics_port_envoy}}{{"{{"}}.}}{{"{{"}}else}}{{"{{"}}.ServicePort}}{{"{{"}}end}}/metrics'
# [inputs.prometheus.consul.query.tags]
# host = "{{"{{"}}.Node}}"
# shard-role = "autoscaler-envoy"
# role = "autoscaler-envoy"
[[inputs.prometheus.consul.query]]
name = "skynet"
tag = "ip-{{ env "attr.unique.network.ip-address" }}"
Expand Down Expand Up @@ -304,6 +313,16 @@ EOF
jibri_release_number = "{{"{{"}}with .ServiceMeta.release_number}}{{"{{"}}.}}{{"{{"}}else}}0{{"{{"}}end}}"
shard-role = "java-jibri"
role = "java-jibri"
# uncomment for consul connect envoy sidecar metrics (~1700 per sidecar)
# [[inputs.prometheus.consul.query]]
# name = "jibri-sidecar-proxy"
# tag = "ip-{{ env "attr.unique.network.ip-address" }}"
# url = 'http://{{"{{"}}if ne .ServiceAddress ""}}{{"{{"}}.ServiceAddress}}{{"{{"}}else}}{{"{{"}}.Address}}{{"{{"}}end}}:{{"{{"}}with .ServiceMeta.metrics_port_envoy}}{{"{{"}}.}}{{"{{"}}else}}{{"{{"}}.ServicePort}}{{"{{"}}end}}/metrics'
# [inputs.prometheus.consul.query.tags]
# host = "{{"{{"}}.Node}}"
# shard-role = "jibri-envoy"
# role = "jibri-envoy"

[[inputs.prometheus.consul.query]]
name = "vo-credentials-store"
tag = "ip-{{ env "attr.unique.network.ip-address" }}"
Expand Down