Important
This feature is in LABS and is subject to change.
Usage tracking provides metrics on all Rosette server calls. Call counts are provided by app-id, profileId, endpoint, and language.
Application ids (app-id
) are an optional way to identify the application or group making the call. The app-id
is the value of X-RosetteAPI-App-ID
in the call header. If no application id is provided in the call header, the calls are allocated to the no-app-id
group.
Profile ids (profileId
) are an optional way of identifying a custom profile. Each profile can have its own data domain, parameter, and configuration settings. If no profile id is provided in the call, the calls are allocated to the no-profile-id
group.
Language is identified by the 3-letter ISO 639-3 language code. xxx
indicates the language was unknown.
Calls made to the endpoints /rest/v1/info
, /rest/v1/ping
, and /rest/v1/custom
are not included in the statistics.
Call statistics are kept in the file launcher/config/rosette-usage.yaml
. The statistics are cumulative from the file creation date. The file is created when the server is started. If the file already exists when the server is started, new statistics are added to the existing file. The file is not deleted when the server is stopped.
Usage
To access the statistics, call the usage
endpoint:
curl http://localhost:8181/rest/usage
where localhost:8181
is the location of the Rosette installation.
Sample Response
{"no-app-id": {
"no-profile-id": {
"/rest/v1/tokens": {
"eng": {
"calls": 1
},
"zho": {
"calls": 1
}
},
"/rest/v1/categories": {
"eng": {
"calls": 1
}
},
"/rest/v1/language": {
"xxx": {
"calls": 1
}
}
}
}
}
You can also aggregate usage data by having Prometheus pull metrics from multiple instances using the usage/metrics
endpoint. A single call returns all endpoints.
curl http://localhost:8181/rest/usage/metrics
where localhost:8181
is the location of the Rosette installation.
Sample Response
# HELP rosette_http_requests_total Total number of Rosette Enterprise requests processed.
# TYPE rosette_http_requests_total counter
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/tokens",lang="zho",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/semantics/vector",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/morphology/compound-components",lang="deu",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/syntax/dependencies",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/morphology/lemmas",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/topics",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/transliteration",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/sentences",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/address-similarity",lang="xxx",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/name-deduplication",lang="xxx",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/morphology/complete",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/entities",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/name-translation",lang="xxx",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/morphology/parts-of-speech",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/semantics/similar",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/language",lang="xxx",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/sentiment",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/categories",lang="eng",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/name-similarity",lang="xxx",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/morphology/han-readings",lang="zho",} 1.0
rosette_http_requests_total{app_id="no-app-id",profile_id="no-profile-id",
endpoint="/rest/v1/relationships",lang="eng",} 1.0
The configuration parameters for usage tracking is in the file launcher/config/com.basistech.ws.local.usage.tracker.cfg
.
-
Disable Tracking By default, usage tracking is turned on. To disable tracking, uncomment the enabled
parameter and change the value to false:
enabled: false
-
Report interval To set the reporting interval in minutes, change the reportInterval
parameter. The default is 1 minute.
reportInterval: 2
-
File Location To set the location for the rosette-usage.yaml
file set the usage-tracker-root
parameter. The default location is <rosette>/server/launch/config
. Uncomment the line and change it to your preferred location. This example changes it to the /var/log
directory:
usage-tracker-root: /var/log
To reset the counter:
Stop the server
-
Remove the following files:
Restart the server
Identifying an Application
No authorization is required when using an on-premise installation of Rosette. You may, however, want to track Rosette calls by groups within your organization. To do this, include an application id (app-id
) in the request header of all Rosette calls. This allows Rosette to track usage by app-id
.
An application id is:
A user-defined string.
It is defined in the call.
There is no validation or authorization on the value.
Used for usage tracking only.
If no app-id
is included in the header, calls are allocated to the no-app-id
group.
Example:
curl -s -X POST \
-H "X-RosetteAPI-App-Id: usergroup1" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Cache-Control: no-cache" \
-d '{"content": "Por favor Señorita, says the man." }' \
"https://localhost:8181/rest/v1/language"