- 수집서버에 아래 옵션을 설정하면 수집서버와 같이 실행된다.(재기동 필요)
net_http_server_enabled
: settrue
net_http_api_enabled
: settrue
net_http_port
: default value6180
net_http_api_allow_ips
: default valuelocalhost,127.0.0.1,0:0:0:0:0:0:0:1,::1
;
- Web API는 Servlet을 통해 서비스 되면 HTTP 프로토콜이나 JSON 파싱 등 부가적인 작업이 필요하기 때문에 기본 수집서버에 비해 자원 사용량이 높다. 따라서 모니터링하는 시스템의 규모가 크다면 API 서버를 분리하여 실행할 필요가 있다.
- standAlone webapp 실행 (Scouter Full 패키지에 포함되어 있음)
cd scouter.webapp ./startup.sh
- scouter web app 설정 (실행전에 설정 필요)
net_collector_ip_port_id_pws
: default value127.0.0.1:6100:admin:admin
- format :
{host}:{port}:{id}:{pw},{host}:{port}:{id}:{pw}
- format :
net_http_port
: default value6188
net_http_api_allow_ips
: default valuelocalhost,127.0.0.1,0:0:0:0:0:0:0:1,::1
;
- access the url : http://{http-server-ip}:{port}/scouter/v1/info/server
- expected response
{ "status": 200, "requestId": "#xxxx", "resultCode": 0, "message": "success", "result": [ { "id": -1234512345, "name": "MyCollectorName", "connected": true, "serverTime": 1507878605943 } ] }
- SWAGGER uri : /swagger/index.html
net_http_api_swagger_enabled
옵션을 true로 지정시 사용 가능
- demo
Provides a widget that simply charts the performance counter API's response. Passing the (url encoded) url of the counter api to be looked up in this widget, the result is charted. If you include this widget path when setting up a custom alarm, you can use it more easily.
-
URL :
/widget/simple/counter.html
- parameters
- source : url encoded counter(or counter stat) api
- if the source value doesn't start with
slash(/)
, then append/scouter/v1/counter/
ahead of it by defaults.
- if the source value doesn't start with
- source : url encoded counter(or counter stat) api
- parameters
-
usage example
- belows are equivalent. (counter api :
/scouter/v1/counter/HeapUsed/latest/300/ofType/tomcat
)http://127.0.0.1:6180/widget/simple/counter.html?source=%2Fscouter%2Fv1%2Fcounter%2FHeapUsed%2Flatest%2F300%2FofType%2Ftomcat
http://127.0.0.1:6180/widget/simple/counter.html?source=HeapUsed%2Flatest%2F300%2FofType%2Ftomcat
- belows are equivalent. (counter api :
//Network
@ConfigDesc("Collector connection infos - eg) host:6100:id:pw,host2:6100:id2:pw2")
@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
public String net_collector_ip_port_id_pws = "127.0.0.1:6100:admin:admin";
@ConfigDesc("size of webapp connection pool to collector")
public int net_webapp_tcp_client_pool_size = 12;
@ConfigDesc("timeout of web app connection pool to collector(It depends on net_tcp_client_so_timeout_ms)")
public int net_webapp_tcp_client_pool_timeout = 15000;
@ConfigDesc("Enable api access control by client ip")
public boolean net_http_api_auth_ip_enabled = false;
@ConfigDesc("If get api caller's ip from http header.")
public String net_http_api_auth_ip_header_key;
@ConfigDesc("Enable api access control by JSESSIONID of Cookie - get session from /user/login.")
public boolean net_http_api_auth_session_enabled = false;
@ConfigDesc("api http session timeout(sec)")
public int net_http_api_session_timeout = 1*3600*24;
@ConfigDesc("Enable api access control by Bearer token(of Authorization http header) - get access token from /user/loginGetToken.")
public boolean net_http_api_auth_bearer_token_enabled = false;
@ConfigDesc("Enable gzip response on api call")
public boolean net_http_api_gzip_enabled = true;
@ConfigDesc("api access allow ip addresses")
@ConfigValueType(ValueType.COMMA_SEPARATED_VALUE)
public String net_http_api_allow_ips = "localhost,127.0.0.1,0:0:0:0:0:0:0:1,::1";
@ConfigDesc("HTTP service port")
public int net_http_port = NetConstants.WEBAPP_HTTP_PORT;
@ConfigDesc("user extension web root")
public String net_http_extweb_dir = "./extweb";
@ConfigDesc("HTTP API swagger enable option")
public boolean net_http_api_swagger_enabled = false;
@ConfigDesc("Swagger option of host's ip or domain to call APIs.")
public String net_http_api_swagger_host_ip = "";
@ConfigDesc("API CORS support for Access-Control-Allow-Origin")
public String net_http_api_cors_allow_origin = "*";
@ConfigDesc("Access-Control-Allow-Credentials")
public String net_http_api_cors_allow_credentials = "true";
@ConfigDesc("Log directory")
public String log_dir = "./logs";
@ConfigDesc("Keeping period of log")
public int log_keep_days = 30;
-
Context root : /scouter
- if the api url is
/v1/info/server
then/scouter/v1/info/server
- if the api url is
-
SWAGGER uri : /swagger/index.html
- if set the option
net_http_api_swagger_enabled
true
- if set the option
- get connected collector server info.
- Auth : None
- get monitoring object list
- Auth : required - register api client's ip to
net_http_api_allow_ips
configuration. - Query params
serverId
: If the webapp connect to single collector then it's optional.(optional if single server)
- get real time counter value by object type
- Auth : required
- Path params
counters
: counter names comma separated (required)- refer to counter names
- eg) Cpu,Mem,PageIn
objType
: object type (required)
- Query params
serverId
: If the webapp connect to single collector then it's optional.(optional if single server)
- get real time counter value by object
- Auth : required
- Path params
counters
: (required)objHash
: object id (required)
- Query params
serverId
: (optional if single server)
- get real time counter value by objects
- Auth : required
- Path params
counters
: counter names comma separated (required)
- Query params
serverId
: If the webapp connect to single collector then it's optional.(optional if single server)objHashes
: object hashes by comma separator also allowed with bracket. eg) 10011,10012 or [10011,10012]
- get counter values of specific time range by object type
- uri pattern : /counter/{counter}/ofType/{objType}?startTimeMillis={startTimeMillis}&endTimeMillis={endTimeMillis}&serverId={serverId}
- uri pattern : /counter/{counter}/ofType/{objType}?startYmdHms={startYmdHms}&endYmdHms={endYmdHms}&serverId={serverId}
- Auth : required
- Path params
counter
: (required)objType
: object type (required)
- Query params
serverId
: (optional if single server)startYmdHms
: yyyymmddhhmiss (exclusive required with startTimeMillis)endYmdHms
: yyyymmddhhmiss (exclusive required with endTimeMillis)startTimeMillis
: timestamp(long) - yyyymmddhhmi (exclusive required with startYmdHms)endTimeMillis
: timestamp(long) - yyyymmddhhmi (exclusive required with endYmdHms)
- get counter values of specific time range by objects
- uri pattern : /counter/{counter}?startTimeMillis={startTimeMillis}&endTimeMillis={endTimeMillis}&objHashes=100,200&serverId={serverId}
- uri pattern : /counter/{counter}?startYmdHms={startYmdHms}&endYmdHms={endYmdHms}&objHashes=100,200&serverId={serverId}
- Auth : required
- Path params
counter
: (required)
- Query params
serverId
: (optional if single server)objHashes
: object hashes by comma separator also allowed with bracket. eg) 10011,10012 or [10011,10012]startYmdHms
: yyyymmddhhmiss (exclusive required with startTimeMillis)endYmdHms
: yyyymmddhhmiss (exclusive required with endTimeMillis)startTimeMillis
: timestamp(long) - yyyymmddhhmi (exclusive required with startYmdHms)endTimeMillis
: timestamp(long) - yyyymmddhhmi (exclusive required with endYmdHms)
- get latest counter values by object type
- uri pattern : /counter/{counter}/latest/{latestSec}/ofType/{objType}?serverId={serverId}
- Auth : required
- Path params
counter
: (required)latestSec
: (required) seconds to retrieve counter values from now.objType
: (required)
- Query params
serverId
: (optional if single server)
- get latest counter values by objects
- uri pattern : /counter/{counter}/latest/{latestSec}?serverId={serverId}&objHashes=100,200
- Auth : required
- Path params
counter
: (required)latestSec
: (required) seconds to retrieve counter values from now.
- Query params
serverId
: (optional if single server)objHashes
: object hashes by comma separator also allowed with bracket. eg) 10011,10012 or [10011,10012]
- get 5min counter statistics by object type
- Auth : required
- Path params
counters
: (required)objType
: (required)
- Query params
startYmd
: yyyymmdd (required)endYmd
: yyyymmdd (required)serverId
: (optional if single server)
- get 5min counter statistics by object type
- Auth : required
- Path params
counters
: (required)
- Query params
startYmd
: yyyymmdd (required)endYmd
: yyyymmdd (required)objHashes
: object hashes by comma separator also allowed with bracket. eg) 10011,10012 or [10011,10012]serverId
: (optional if single server)
- get summary of given category
- Auth : required
- Path params
summaryCategory
: service, sql, apiCall, ip, userAgent, error, alert (required)objType
: (required)
- Query params
startYmdHm
: yyyymmddhhmi (exclusive required with startTimeMillis)endYmdHm
: yyyymmddhhmi (exclusive required with endTimeMillis)startTimeMillis
: timestamp(long) - yyyymmddhhmi (exclusive required with startYmdHm)endTimeMillis
: timestamp(long) - yyyymmddhhmi (exclusive required with endYmdHm)serverId
: (optional if single server)
-
get summary of given category
-
Auth : required
-
Path params
summaryCategory
: service, sql, apiCall, ip, userAgent, error, alert (required)objHash
: object id (required)
-
Query params
startYmdHm
: yyyymmddhhmi (exclusive required with startTimeMillis)endYmdHm
: yyyymmddhhmi (exclusive required with endTimeMillis)startTimeMillis
: timestamp(long) - yyyymmddhhmi (exclusive required with startYmdHm)endTimeMillis
: timestamp(long) - yyyymmddhhmi (exclusive required with endYmdHm)serverId
: (optional if single server)
-
get xlog data within the time range
-
Auth : required
-
Path params
yyyymmdd
: date to search xlogs
-
Query params
startTimeMillis
: (required) start time as milliseconds(long)endTimeMillis
: (required) end time as milliseconds(long)startHms
: (required-exclusive with starTimeMillis) start time as hhmmssendHms
: (required-exclusive with endTimeMillis) end time as hhmmssobjHashes
: object hashes by comma separator also allowed with bracket. eg) 10011,10012 or [10011,10012]pageCount
: count to retrieve in one time. (max limit is 30,000, default 10,000)lastTxid
: available from previous response for paging support.lastXLogTime
: available from previous response for paging support.serverId
: (optional if single server)
- get xlog data by txid
- Auth : required
- Path params
yyyymmdd
: date to search xlogstxid
: XLog's txid (long)
- Query params
serverId
: (optional if single server)
- get xlog datas by gxid
- Auth : required
- Path params
yyyymmdd
: date to search xlogsgxid
: XLog's gxid (long)
- Query params
serverId
: (optional if single server)
- search xlog data list with various conditions
- Auth : required
- Path params
yyyymmdd
: date to search xlogs
- Query params
serverId
: (optional if single server)startTimeMillis
: (required) start time as milliseconds(long)endTimeMillis
: (required) end time as milliseconds(long)startHms
: (required-exclusive with starTimeMillis) start time as hhmmssendHms
: (required-exclusive with endTimeMillis) end time as hhmmssobjHash
: object hashservice
: service(pattern)ip
: ip(pattern)login
: login(pattern)desc
: desc(pattern)text1
: text1(pattern)text2
: text2(pattern)text3
: text3(pattern)text4
: text4(pattern)text5
: text5(pattern)
- get current xlog data created after the last searched.
- Auth : required
- Path params
offset1
: the last xlog (loop) offset previously retrieved (initial value is 0)offset2
: the last xlog offset previously retrieved (initial value is 0)
- Query params
objHashes
: object hashes by comma separator also allowed with bracket. eg) 10011,10012 or [10011,10012]serverId
: (optional if single server)
- request xlogs by txids
- Auth : required
- Path params
yyyymmdd
: date to search xlogstxidList
: xlog txid list(by comma separator)
- Query params
serverId
: (optional if single server)
- get profile data(decoded) from txid
- Auth : required
- Path params
yyyymmdd
: date to search xlogstxid
: XLog's txid (long)
- Query params
serverId
: (optional if single server)
- current active service count 3-stepped by response time.
- Auth : required
- Path params
objType
: (required)
- Query params
serverId
: (optional if single server)
- get active service list of given objType
- Auth : required
- Path params
objType
: (required)
- Query params
serverId
: (optional if single server)
- get active service list of given objHash
- Auth : required
- Path params
objHash
: (required)
- Query params
serverId
: (optional if single server)
- get thread detail of the object's threadId
- Auth : required
- Path params
objHash
: (required)threadId
: thread id gotten from active service list (required)
- Query params
txidName
: This value is for valuable service related information. (like service name & a sql that currently running)txid
: This value has higher priority than txidName.(txidName is String type from Hexa32.toString32(txid) / txid is long type)serverId
: (optional if single server)
- retrieve current alerts unread that is produced newly after the last offsets.
- Auth : required
- Path params
offset1
: (required)offset2
: (required)
- Query params
objType
: (required)serverId
: (optional if single server)
- get text values from dictionary keys requested
- Auth : required
- Path params
yyyymmdd
: (required)
- Query params
texts
: group of text types & text hashes (required)- eg) texts=[service:10001,service:10002,obj:20001,sql:55555] (bracket is optional)
- retrieve today visitor count by objType
- Auth : required
- Path params
objType
: (required)
- Query params
serverId
: (optional if single server)
- retrieve today visitor count by objects
- Auth : required
- Query params
objHashes
: object hashes by comma separator also allowed with bracket. eg) 10011,10012 or [10011,10012]serverId
: (optional if single server)
- retrieve all OS processes cpu, memory usage of the given object
- Auth : required
- Path params
objHash
: (required)
- Query params
serverId
: (optional if single server)
- get value of given key from the scouter server's key-value store. (in user-scope private key space for logon user)
- Auth : required
- Path params
key
: (required)
- Query params
serverId
: (optional if single server)
- store it to the scouter server's key-value store. (in user-scope private key space for logon user)
- Auth : required
- Request body (type : application/json)
key
: (required)value
: (required)ttl
: (optional) time to live as secondsserverId
: (required)
- store it to the scouter server's key-value store. (in user-scope private key space for logon user)
- Auth : required
- Path params
key
: (required)
- Request body (type : application/json)
ttl
: (required) time to live as secondsserverId
: (required)
- get values of given keys from the scouter server's key-value store. (in user-scope private key space for logon user)
- Auth : required
- Path params
keys
: (required) keys by comma separator. also allowed with bracket. eg) mykey-1,mykey2 or [mykey-1,mykey2]
- Query params
serverId
: (optional if single server)
- store key&values to the scouter server's key-value store. (in user-scope private key space for logon user)
- Auth : required
- Request body (type : application/json)
ttl
: (optional) time to live as secondskvList
: (required) array of key & valuekey
: (required)value
: (required)
serverId
: (required)
- get value of given key from the scouter server's key-value store. (in the global key space)
- Auth : required
- Path params
key
: (required)
- Query params
serverId
: (optional if single server)
- store it to the scouter server's key-value store. (in the global key space)
- Auth : required
- Request body (type : application/json)
key
: (required)value
: (required)ttl
: (optional) time to live as secondsserverId
: (required)
- store it to the scouter server's key-value store. (in the global key space)
- Auth : required
- Path params
key
: (required)
- Request body (type : application/json)
ttl
: (required) time to live as secondsserverId
: (required)
- get values of given keys from the scouter server's key-value store. (in the global key space)
- Auth : required
- Path params
keys
: (required) keys by comma separator. also allowed with bracket. eg) mykey-1,mykey2 or [mykey-1,mykey2]
- Query params
serverId
: (optional if single server)
- store key&values to the scouter server's key-value store. (in the global key space)
- Auth : required
- Request body (type : application/json)
ttl
: (optional) time to live as secondskvList
: (required) array of key & valuekey
: (required)value
: (required)
serverId
: (required)
- get value of given key from the key space of scouter server's key-value store.
- Auth : required
- Path params
keySpace
: (required)key
: (required)
- Query params
serverId
: (optional if single server)
- store it to the key space of scouter server's key-value store
- Auth : required
- Path params
keySpace
: (required)
- Request body (type : application/json)
key
: (required)value
: (required)ttl
: (optional) time to live as secondsserverId
: (required)
- get values of given keys from the key space of scouter server's key-value store
- Auth : required
- Path params
keySpace
: (required)keys
: (required) keys by comma separator. also allowed with bracket. eg) mykey-1,mykey2 or [mykey-1,mykey2]
- Query params
serverId
: (optional if single server)
- store key&values to the key space of scouter server's key-value store
- Auth : required
- Path params
keySpace
: (required)
- Request body (type : application/json)
ttl
: (optional) time to live as secondskvList
: (required) array of key & valuekey
: (required)value
: (required)
serverId
: (required)
- login with id & password, and get bearer token.
- this token required on Authorization header for authorized request.
- auth header example :
Authorization: Bearer V1.B3R4FSGEF3POJ.me
- auth header example :
- this token required on Authorization header for authorized request.
- Auth : none
- Request body (type : application/json)
user
: (required)id
: (required)password
: (required)
serverId
: (required)
- login with id & password for traditional web application.
- this api is answered including with SET-COOKIE response header.
- Auth : none
- Request body (type : application/json)
user
: (required)id
: (required)password
: (required)
serverId
: (required)
- make shorten url.
- You can make the url with a lot of parameters shorten in scouter web api.
- Auth : required
- Query params
url
: url to shortenserverId
: (optional if single server)
- get interaction counter values.
- 여러 jvm과 db, redis, 외부 호출등 연관된 시스템간의 성능 정보를 가져올 수 있다.
- 예를 들면 각 구성 요소간 단위 시간당 호출 건수, 응답시간의 합, 에러의 총합 등의 정보를 제공해준다.
- this counter is activated when the option
counter_interaction_enabled
is settrue
from java agent.
- Auth : required
- Query params
objHashes
: object hashes by comma separator also allowed with bracket. eg) 10011,10012 or [10011,10012]serverId
: (optional if single server)
- Same as above
- Auth : required
- Path params
objType
: (required)
- Query params
serverId
: (optional if single server)