remove old prometheus listener
This commit is contained in:
parent
3cfde5860d
commit
cb0734145d
2 changed files with 1 additions and 26 deletions
|
|
@ -281,10 +281,6 @@ func (c *Composer) Start() error {
|
||||||
// handler functions don't.
|
// handler functions don't.
|
||||||
mux.Handle(apiRouteV2+"/", c.api.V2(apiRouteV2))
|
mux.Handle(apiRouteV2+"/", c.api.V2(apiRouteV2))
|
||||||
|
|
||||||
// Metrics handler attached to api mux to avoid a
|
|
||||||
// separate listener/socket
|
|
||||||
mux.Handle("/metrics", promhttp.Handler().(http.HandlerFunc))
|
|
||||||
|
|
||||||
handler := http.Handler(mux)
|
handler := http.Handler(mux)
|
||||||
var err error
|
var err error
|
||||||
if c.config.Koji.EnableJWT {
|
if c.config.Koji.EnableJWT {
|
||||||
|
|
@ -296,7 +292,6 @@ func (c *Composer) Start() error {
|
||||||
[]string{
|
[]string{
|
||||||
"/api/image-builder-composer/v2/openapi/?$",
|
"/api/image-builder-composer/v2/openapi/?$",
|
||||||
"/api/image-builder-composer/v2/errors/?$",
|
"/api/image-builder-composer/v2/errors/?$",
|
||||||
"/metrics/?$",
|
|
||||||
}, mux)
|
}, mux)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
|
||||||
|
|
@ -407,29 +407,11 @@ createReqFile
|
||||||
#
|
#
|
||||||
|
|
||||||
function collectMetrics(){
|
function collectMetrics(){
|
||||||
METRICS_OUTPUT=$(curl \
|
METRICS_OUTPUT=$(curl http://localhost:8008/metrics)
|
||||||
--cacert /etc/osbuild-composer/ca-crt.pem \
|
|
||||||
--key /etc/osbuild-composer/client-key.pem \
|
|
||||||
--cert /etc/osbuild-composer/client-crt.pem \
|
|
||||||
https://localhost/metrics)
|
|
||||||
|
|
||||||
echo "$METRICS_OUTPUT" | grep "^image_builder_composer_request_count.*path=\"/api/image-builder-composer/v2/compose\"" | cut -f2 -d' '
|
echo "$METRICS_OUTPUT" | grep "^image_builder_composer_request_count.*path=\"/api/image-builder-composer/v2/compose\"" | cut -f2 -d' '
|
||||||
}
|
}
|
||||||
|
|
||||||
function testNewMetricsPort(){
|
|
||||||
METRICS_OUTPUT1=$(curl \
|
|
||||||
--cacert /etc/osbuild-composer/ca-crt.pem \
|
|
||||||
--key /etc/osbuild-composer/client-key.pem \
|
|
||||||
--cert /etc/osbuild-composer/client-crt.pem \
|
|
||||||
https://localhost/metrics)
|
|
||||||
METRICS_OUTPUT2=$(curl http://localhost:8008/metrics)
|
|
||||||
|
|
||||||
COMPOSES1=$(echo "$METRICS_OUTPUT1" | grep "^image_builder_composer_request_count.*path=\"/api/image-builder-composer/v2/compose\"" | cut -f2 -d' ')
|
|
||||||
COMPOSES2=$(echo "$METRICS_OUTPUT2" | grep "^image_builder_composer_request_count.*path=\"/api/image-builder-composer/v2/compose\"" | cut -f2 -d' ')
|
|
||||||
|
|
||||||
test "$COMPOSES1" = "$COMPOSES2"
|
|
||||||
}
|
|
||||||
|
|
||||||
function sendCompose() {
|
function sendCompose() {
|
||||||
OUTPUT=$(mktemp)
|
OUTPUT=$(mktemp)
|
||||||
HTTPSTATUS=$(curl \
|
HTTPSTATUS=$(curl \
|
||||||
|
|
@ -584,8 +566,6 @@ sudo "${CONTAINER_RUNTIME}" exec "${DB_CONTAINER_NAME}" psql -U postgres -d osbu
|
||||||
"DELETE FROM jobs WHERE id = '$COMPOSE_ID'"
|
"DELETE FROM jobs WHERE id = '$COMPOSE_ID'"
|
||||||
sudo systemctl start "osbuild-remote-worker@localhost:8700.service"
|
sudo systemctl start "osbuild-remote-worker@localhost:8700.service"
|
||||||
|
|
||||||
testNewMetricsPort
|
|
||||||
|
|
||||||
# full integration case
|
# full integration case
|
||||||
INIT_COMPOSES="$(collectMetrics)"
|
INIT_COMPOSES="$(collectMetrics)"
|
||||||
sendCompose "$REQUEST_FILE"
|
sendCompose "$REQUEST_FILE"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue