One of main features of the Styx server available for users is an admin interface available "out of the box". It provides an HTTP interface with functionality that ease quick adaptation of the library. Note that this endpoint must be externally secured.
-
POST interface with set of predefined admin commands (see section below).
-
Dashboard
- visual dashboard that shows the health of the server and origins. -
Plugins
- list of plugin extensions and the admin endpoints they expose (if applicable). -
Metrics
- Styx performance metrics as a JSON document. -
JVM
- a subset of metrics specifically related to the underlying JVM usage statistics. -
Configuration
- Styx server configuration settings. -
Origins Configuration
- origin services configuration as a JSON document. -
Origins Status
- origins status as a JSON document. -
Log Configuration
- logging configuration. -
Ping
- simple health-check for the server - returns "pong" if Styx is running. -
Health Check
,Status
- health-checks based on HTTP 500 rate from origins. -
Threads
- a stack trace dump from all threads. -
Current Request
- shows the state of proxied HTTP requests inside Styx. A stack trace is shown if the request is being processed in the interceptor pipeline. This feature must be activated byrequestTracking
flag in the Styx configuration.
All endpoints are available from the admin menu:
http://<STYX_SERVER_URL>/admin/
Endpoints that return JSON
documents are compressed by default. To display documents prettified, the
?pretty
option as an additional query parameter should be used:
http://<STYX_SERVER_URL>/admin/metrics?pretty
The following commands can be sent to the Styx admin interface with HTTP POST requests.
This command will cause Styx to reload the origins if the file has meaningfully changed. If the file has not changed,or the changes are purely cosmetic (such as adding comments), no action will be taken.
http://<STYX_SERVER_URL>/admin/tasks/origins/reload
STYX_SERVER_URL
: The host and port of the Styx Admin Interface
curl -X POST http://<STYX_SERVER_URL>/admin/tasks/origins/reload
So if Styx was on port 8080 on localhost:
curl -X POST http://localhost:8080/admin/tasks/origins/reload
The enable_origin
command will enable a disabled origin. If health checks are enabled, the origin will initially be
inactive and will be activated upon a successful health check. If health checks are disabled, the origin will be
active immediately.
http://<STYX_SERVER_URL>/admin/tasks/origins?cmd=enable_origin&appId=<APP_ID>&originId=<ORIGIN_ID>
STYX_SERVER_URL
: The host and port of the Styx Admin InterfaceAPP_ID
: The backend service the origin belongs toORIGIN_ID
: An origin to enable
curl -X POST http://<STYX_SERVER_URL>/admin/tasks/origins?cmd=enable_origin&appId=<APP_ID>&originId=<ORIGIN_ID>
So if Styx was on port 8080 on localhost and you wanted to enable an origin called "hwa1" for a backend service called "hwa":
curl -X POST http://localhost:8080/admin/tasks/origins?cmd=enable_origin&appId=hwa&originId=hwa1
The disable_origin
command will disable an enabled origin.
http://<STYX_SERVER_URL>/admin/tasks/origins?cmd=disable_origin&appId=<APP_ID>&originId=<ORIGIN_ID>
STYX_SERVER_URL
: The host and port of the Styx Admin InterfaceAPP_ID
: The backend service the origin belongs toORIGIN_ID
: An origin to disable
curl -X POST http://<STYX_SERVER_URL>/admin/tasks/origins?cmd=disable_origin&appId=<APP_ID>&originId=<ORIGIN_ID>
So if Styx was on port 8080 on localhost and you wanted to disable an origin called "hwa1" for a backend service called "hwa":
curl -X POST http://localhost:8080/admin/tasks/origins?cmd=disable_origin&appId=hwa&originId=hwa1
Plugins can be enabled and disabled using POST commands.
http://<STYX_SERVER_URL>/admin/tasks/plugin/<PLUGIN_NAME>/enabled
PLUGIN_NAME
: The host and port of the Styx Admin Interface- The requested state should be sent in a request body with value:
true
/false
If Styx was on port 8080 on localhost and you wanted to disable a plugin called "rewrite":
curl -X POST --data "false" http://localhost:8080/admin/tasks/plugin/rewrite/enabled
http://<STYX_SERVER_URL>/admin/plugins
This endpoint displays all plugins available in Styx with their library versions. Each plugin can register additional, custom admin extensions which will be visible here. For more details, please refer to Plugins
http://<STYX_SERVER_URL>/admin/dashboard/index.html
Dashboard provides a visual representation of the origins health. It lists all configured origins providing information about the status of the underlying connection to each origin. Using this dashboard you can quickly observe whether the origin is reachable, what is the quality of a connection, etc.
It also provides summarized information about error codes in current server uptime, both for the response from origins and from Styx.
http://<STYX_SERVER_URL>/admin/metrics
Returns JSON document with server metrics (from Dropwizard Metrics) gathered in-memory by server instance. For more information on the concrete metrics, please refer to Metrics and Metrics Reference documents.
http://<STYX_SERVER_URL>/admin/jvm
Subset of metrics exposed by JVM that is running the Styx server instance.
http://<STYX_SERVER_URL>/admin/configuration
This endpoint returns a textual representation of the settings configured in the running server instance. For more details about the content of this document please refer to Configure overview.
http://<STYX_SERVER_URL>/admin/configuration/origins
http://<STYX_SERVER_URL>/admin/origins/status
This endpoint provides similar information to the GUI dashboard but in document form. It contains a list of configured backend services and the status of their underlying servers, stating which one are inactive and which ones are disabled.
http://<STYX_SERVER_URL>/admin/logging
The document returned by this endpoint presents the configuration used to setup the logging framework.
http://<STYX_SERVER_URL>/admin/ping
This endpoint returns pong
when the server is running, without performing any checks regarding the status.
http://<STYX_SERVER_URL>/admin/threads
This endpoint reports threads and their statuses running on the server.