Get SpatialOS

Sites

Menu
These are the docs for 12.1, an old version of SpatialOS. The docs for this version are frozen: we do not correct, update or republish them. 13.3 is the newest →

Accessing metrics through code

The monitoring proxy is currently only available to select users for testing. Contact support if you’d like access.

There are situations where you’d want to access metrics about a deployment programmatically. For example, you might want to have a continuous integration script that checks the health of a deployment.

To access the metrics through code:

  1. Ask Improbable customer support to set up a metrics service account for you.

    They’ll send you a username and password.

  2. Craft a Prometheus query. To do this:

  3. Run your query in code. Exactly how this looks will depend on your environment, but to get you started, see the example in curl below.

user="" # Contact support for credentials
pass="" # 
project="your_project"
deployment="your_project_name_here"
cluster="your_cluster"

query="spatialos_worker_connected::sum{project=\"$project\", dpl=\"$deployment\", dpl_tag=\"prod\", worker_type=\"UnityFSim\"}"

curl -G "https://monitoring.service.improbable.io/@proxyhost/$cluster.monitoring.spatial.improbable.io/api/v1/query" \
    --user "$user:$pass" \
    --data-urlencode "query=$query"

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums