0

How to Configure the Read Web API Log (version 23)

  • 6 mths ago

The following article explains how to configure the Canary system to create an API log that records all of the requests and responses for the Web Read API. This may be useful when troubleshooting API requests that are hitting the Views service and offer insight as to how frequently API requests are coming in. It does NOT include the .NET API or Sender API queries.

Setting Up

  1. Create a 'Profiling' folder within C:\ProgramData\Canary\Diagnostics.
  2. Place the attached ViewsWebAPICallLog.config file within C:\ProgramData\Canary\Diagnostics\Profiling.
  3. Restart the Views service.

As soon as an API request is made, a ViewsWebAPICallLog.sqlite file will be created in the same directory. An application is needed to view this sqlite database (such as DB Browser). If such application is not available, Canary offers a portable version of DB Browser which is automatically installed with its software (C:\ProgramData\Canary\Shared\Utilities\SQLiteDatabaseBrowserPortable\SQLiteDatabaseBrowserPortable.exe). Run this application, select 'Open Database', and browse for the above sqlite file.

The API log presents the following columns:

  • StartTime - unix time milliseconds
  • UserName - client's username making the request. A username is not required if connecting anonymously (http).
  • UserToken - the userToken used to make the request
  • Application - the name of the application making the request. This is an optional parameter which is generated when creating the userToken.
  • Function - the Canary API method being used. See readapi.canarylabs.com for all of the available function.
  • RequestPreview - a preview of the request being made. If wishing to lengthen the preview, open the ViewsWebAPICallLog.config file and increase the 'MaxRequestPreviewLength' value. Value is number of characters.

  • RequestSizeBytes - the size of the request in bytes
  • Duration - the amount of time (milliseconds) it took to process the request
  • ResponsePreview - a preview of the response returned to the client. If wishing to lengthen the preview, open the ViewsWebAPICallLog.config file and increase the 'MaxResponsePreviewLength' value. Value is number of characters.

  • ResponseSizeBytes - the size of the response in bytes

The API log will hold up to 2 million requests. Once exceeded, the log will be trimmed down to 1.5 million. If wishing to disable the API log, edit the config file and set 'enabled = false'.

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular