Machine Metrics

We create apps for each of our users. Each app uses the same base image from the fly repository. Our users create machines each with a different ports. These machines represents multi tenancy withing the a user dedicated DB the machines connect to in one of 5 major clouds provider regions. Users can scale each machine up or down cpu and memory, stop(scale to zero) start and destroy.

User machines are public facing with same app endpoint but different ports. For now we are going with the fly app endpoint. The machines run our API service json over https with an api key for authentication which we are handling.

User apps/machines are all in the same org. I have looked but don’t see a away to get metrics on each machine. Basic metrics cpu memmory avg load. We could enhance our API and provide this information but if we could get the machine metrics from a fly api it’s one less think to do.

Thanks.

Also fly has been great allowing us to manage less infrastructure and focus on our core solution. When we get postgress as a backend option we can start looking at flys postgress offering currently MySQL 8

2 Likes

We expose per machine metrics, you can see them here: Sign In · Fly

More details: Metrics on Fly · Fly Docs

This is a cool use of machines, thanks for posting. :slight_smile:

1 Like

OK I see what your doing there. Need to get this into our user admin. Didn’t notice “instance” was referring to machines.

Thanks

Looks like machines are not responded to http and https request at non standard ports. HTTP and HTTPS both work at standard ports 80 and 443

Machines created at not standard ports are responding with
“Failed to connect to “appname”.fly.dev port 7048: Connection refused”

Example config below. Also tried without tls still no love.

http://“.$con->{‘FLY_API_HOSTNAME’}.”/v1/apps/“.$con->{‘app_name’}.”/machines";
$json=‘{
“name”: "’.$l[‘db_id’].‘",
“region”: "’.$region.‘",
“config”: {
“image”: "’.$con->{‘image’}.‘",
“env”: {
“SF_LICENSEKEY”: "’.$l[‘licensekey’].'"
},
“services”: [
{
“ports”: [
{
“port”: ‘.$port.’,
“handlers”: [
“tls”,
“http”
]
}
],
“protocol”: “tcp”,
“internal_port”: 8080
}
]
}
}