view scripts/metrics.sh @ 590:80f3564f2553 production v2.20.0

flow: Merged <release> '2.20.0' to <master> ('production').
author Marc Davis <marc.davis@mcoecn.org>
date Thu, 05 Sep 2024 15:01:40 -0400
parents 9afc8cb478f6
children
line wrap: on
line source
#!/bin/bash
# Dump application metrics and thread stacks to console.
#

source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh"

container=$(composeGetContainer ${1?"Must specify the app service to connect to"} )

project=$(composeGetProject ${1} )
ip=$(docker inspect -f "{{with  .NetworkSettings.Networks}}{{.${project}_default.IPAddress}}{{end}}" $container)

echo "connecting to ${container} in ${project} at ${ip}:8080"
docker run  --network ${project}_default --rm docker.ssdt-ohio.org/ssdt-utils curl -s http://${ip}:8080/metrics/admin/metrics?pretty=true
docker run  --network ${project}_default --rm docker.ssdt-ohio.org/ssdt-utils curl -s http://${ip}:8080/metrics/admin/threads