.. _management_endpoint: ******************** Management Interface ******************** App Suite Proxy comes with an additional management interface which allows administrators and third party systems to get access to runtime environment. The interface is implemented as REST API and listens on a configurable port. For convenience a commandline tool is also provided. HTTP REST Endpoint ================== :doc:`Click here to open the OpenAPI reference <../api/management_api_reference>`. Following topics are currently covered: * Prometheus Metrics * Microprofile Health Check * Configuration Reload To enable management endpoint on startup set configuration property ``proxy.admin.port.enabled`` to ``true``. For a complete reference to all possible configuration properties and their defaults see section :ref:`Settings `. .. hint:: To get an overview of all exposed endpoints open root entry at **http://:** .. _Endpoint_Settings: Endpoint Settings ----------------- .. note:: All properties can be found in ``application.properties``. If a property is missing, not set or the value is not in range the default value will be used. :proxy.admin.port.enabled: Enables Management Endpoint Default: ``false`` Reloadable: ``false`` EnvVar: ``PROXY_ADMIN_PORT_ENABLED`` :proxy.admin.port: The Management Endpoint Port. Supported port range 8081-9999 Default: ``8888`` Reloadable: ``false`` EnvVar: ``PROXY_ADMIN_PORT`` :proxy.admin.http.errorresponse.enabled: Get a detailed error message in case of any HTTP Error (4xx, 5xx). This property can be changed on runtime. Default: ``false`` Reloadable: ``true`` EnvVar: ``PROXY_ADMIN_HTTP_ERRORRESPONSE_ENABLED`` :proxy.health.default.procedures.enabled: Register default health check procedures. See :ref:`Developers Guide ` for prerequisites. Default: ``false`` Reloadable: ``false`` EnvVar: ``PROXY_HEALTH_DEFAULT_PROCEDURES_ENABLED`` :proxy.health.default.package: Classes within this package will be registered on server startup. See :ref:`Developers Guide ` for prerequisites. Default: ``io.ox.proxy.health.impl.checks`` Reloadable: ``false`` EnvVar: ``PROXY_HEALTH_DEFAULT_PACKAGE`` :proxy.health.jvm.threadcount.max: Health Check Threads- After exceeding this value the health check change to DOWN. Supported range 1 - Integer.MAX_VALUE. This property can be changed on runtime. Default: ``50`` Reloadable: ``true`` EnvVar: ``PROXY_HEALTH_JVM_THREADCOUNT_MAX`` :proxy.health.jvm.heapmemory.maxpercentage: Health Check Memory - After exceeding this value the health check change to DOWN. 0.01 -> 1%, 0.99 -> 99% of max heap. Supported range 0.01 - 0.99. This property can be changed on runtime. Default: ``0.9`` Reloadable: ``true`` EnvVar: ``PROXY_HEALTH_JVM_HEAPMEMORY_MAXPERCENTAGE`` :proxy.health.http: Health Check HTTP - If Endpoint is not available health check change to DOWN. If no value is present health check will be skipped. This property can be changed on runtime. Default: ```` Reloadable: ``true`` EnvVar: ``PROXY_HEALTH_HTTP`` :proxy.admin.openapi.enabled: Creates an additional Open API Endpoint when enabled. Endpoint is then available under ``{{baseUrl}}/openapi``, ``{{baseUrl}}/openapi.json``, ``{{baseUrl}}/openapi.yaml``. Must be set before Server Startup. Default: ``false`` Reloadable: ``false`` EnvVar: ``PROXY_ADMIN_OPENAPI_ENABLED`` :proxy.admin.properties.sanitizekeys: Property names containing one the given keys will be sanitized when exposing via HTTP API. The values of well known properties will be sanitized even if this parameter is not set. Those values are ``.password,.secret,.key.,.token,.credentials``. By setting this property keys will be added as additional keys to the list. Does not support regular expressions Default: ``false`` Reloadable: ``false`` :proxy.admin.properties.filter: Use positive filter where only property names matches the given value will be exposed via HTTP API. Leave this blank will disable the filter and lead to exposing all properties. Filter does not support regular expressions Default: `` `` Reloadable: ``true`` Sample `````` A sample configuration may look like this: .. literalinclude:: config-examples/application-admin.properties :language: properties .. note:: This configuration will start the management listener on port 8888 and register all default health checks. Empty parameters will fall back to their default. Microprofile Health Check ------------------------- App Suite Proxy comes with an implementation of `Microprofile Health API `_. Some basic health checks are available by default and will be registered when enabled (see :ref:`Settings `). According to the API specification these health checks will be exposed to ``/health`` ``/health/live`` ``/health/ready``. Payload from ``http://:/health`` looks like the following example: .. literalinclude:: config-examples/health-payload.json :language: json Prometheus Metrics ------------------ Monitoring Metrics from server runtime will be exposed under ``/metrics``. The format follows the `Prometheus Format specification `_ . Payload from ``http://:/metrics`` looks like the following example: .. literalinclude:: config-examples/metrics-payload.txt :language: text Open API -------- Management Endpoint comes with an integrated Open API documentation which can be created while server startup, see section :ref:`Settings `. Once enabled the documentation is available at ``/openapi``, ``/openapi.yaml`` and ``/openapi.json``. ``/metrics``. Use this endpoint to import the payload in a tool of your choise e.g. Postman, or use ``/application.wadl`` to help with client generation. Payload from ``/openapi`` looks like the following example: .. literalinclude:: config-examples/openapi-payload.yaml :language: yaml .. _command_line_interface: CLI === Appsuite Proxy comes with a command line tool which basically gives access to Proxy`s management API Endpoints. The command line tool can be installed as additional docker image or locally using gradle a task. For more information see project`s readme. Once you have installed command line tool run ``appsuite-proxy --help`` to get a list with possible actions :: root@2a1f20a3b3d7:/usr/local/bin# appsuite-proxy Usage: appsuite-proxy [OPTIONS] COMMAND [ARGS]... Command line tool can be used to perform management tasks from shell which basically invoke Appsuite Proxy`s REST API Endpoints. Options: --baseurl TEXT Base URL to HTTP API [default: (http://127.0.0.1:8888)] --debug Show debug output in case of any errors [default: (False)] --version The CLI version -h, --help Show this message and exit. Commands: config Actions calling Appsuite Proxy`s configuration endpoint health Actions calling Appsuite Proxy`s health endpoint metrics Actions calling Appsuite Proxy`s metrics endpoint Run 'appsuite-proxy COMMAND --help' for more information CLI Docker Image ---------------- Alternatively you can use appsuite-proxy-cli docker image which includes the clt. To use it you need just to run the image, e.g. ``docker run ImageId``. This will show you the help text and you can just add options or commands on your next docker run call, e.g. ``docker run ImageId config get``.