Logs & Analytics

Opensolr Logs & Analytics — find answers to your questions

API Usage Dashboard — Monitor Your API Requests and Rate L...

The API Usage page shows how your account uses the Opensolr API: how many calls, to which endpoints, and how close you are to your limits.

WhereAccount › API Usage, in the Control Panel.
Limits120 calls per minute and 1,200 per hour by default: Rate limits.

01 · What the page shows

API This Month

Every call of your account in the month you pick.

API Quota This Month

AI requests used against your monthly allowance: API Quota.

Last Minute, Last Hour

Your calls right now, next to your limits.

Requests by Endpoint

Calls per endpoint, most used first.

Monthly History

Your calls in each of the last six months.

02 · How the limits count

Every call counts once, in the minute and in the hour it is made. The counters start again at each new minute and each new hour of the clock.

The per-minute limit counts your account and, separately, the address the calls come from.

Over a limit, the API answers 429 Too Many Requests with Retry-After: 60 (ERROR_RATE_LIMIT_PER_MINUTE) or Retry-After: 3600 (ERROR_RATE_LIMIT_PER_HOUR).

Reading your own Data Ingestion queue is never limited.

03 · Related

Every error code of the API: API errors. Keys and scoped keys: Authentication.

Read Full Answer

API - Get error log

Gives you the latest errors Solr logged for your Opensolr Index, already parsed: time, level, message, stack trace and root cause.

Endpointhttps://opensolr.com/solr_manager/api/get_error_log
MethodGET
Authemail and api_key of your account, as GET or POST parameters: Authentication.
In the panelError log

01 · Parameters

core_nameRequired

The name of your index (index_name works too).

02 · Example

curl -s "https://opensolr.com/solr_manager/api/get_error_log?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_index"

03 · Answer

status is true and msg is a string that holds JSON: decode it a second time. It has errors, the last 50 errors found in the latest lines of the server log, and summary.

{
    "errors": [
        {
            "timestamp": "...",
            "level": "ERROR",
            "message": "undefined field: price_x",
            "stack_trace": [
                "..."
            ],
            "caused_by_chain": [],
            "root_cause": null,
            "severity": "..."
        }
    ],
    "summary": {
        "total": 1
    }
}

With no error, errors is empty and summary.message says No errors found for this core.

04 · Errors

ERROR_NOT_CORE_OWNERHTTP 200

The index is not yours.

ERROR_AUTHENTICATION_FAILEDHTTP 403

The email and API key do not match.

ERROR_RATE_LIMIT_PER_MINUTEHTTP 429

Too many calls. Wait for the Retry-After seconds: Rate limits.

05 · Related

Every request the index received: request_log.

Every error code and HTTP status of the API: API errors. Calls per minute and per hour: Rate limits.

Read Full Answer

API - Get Index Request Log

Searches the log of every request your Opensolr Index received, with the Solr parameters you already know. Each request is one document.

Endpointhttps://opensolr.com/solr_manager/api/request_log
MethodGET (all parameters in the query string)
Authemail and api_key of your account, as GET or POST parameters: Authentication.
In the panelQuery analytics

01 · Parameters

core_nameRequired

The name of your index. A cluster master includes its replicas.

qOptional

A Solr query on the log. Default *:*, every request.

fq[]Optional

Filters, as many as you need, for example fq[]=date:[NOW-1DAY TO NOW].

sortOptional

For example date desc.

startOptional

Offset, for paging.

rowsOptional

Requests per page. Default 100, at most 1000.

flOptional

The fields to return.

facet, facet.field[]Optional

facet=true and one or more fields to count, such as ip, path, q, http_status.

02 · Fields of a request

date

When it came in.

q

The search text, when there was one.

path

The request handler, such as /select or /update.

ip

The address it came from.

http_status

The HTTP status of the answer.

qtime, hits, size

Milliseconds Solr took, results found, size of the answer.

core_name

The index, useful on a cluster.

03 · Examples

Use curl -g so the square brackets go through as they are.

# Requests that did not answer 200, last 7 days, newest first
curl -gs "https://opensolr.com/solr_manager/api/request_log?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_index&sort=date%20desc&fq[]=date:[NOW-7DAY%20TO%20NOW]&fq[]=-http_status:200"

# The 10 most searched texts and the busiest addresses of the last day, no documents
curl -gs "https://opensolr.com/solr_manager/api/request_log?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_index&rows=0&fq[]=date:[NOW-1DAY%20TO%20NOW]&facet=true&facet.field[]=q&facet.field[]=ip&facet.limit=10"

# Searches slower than one second
curl -gs "https://opensolr.com/solr_manager/api/request_log?email=YOUR_EMAIL&api_key=YOUR_API_KEY&core_name=my_index&sort=qtime%20desc&fq[]=qtime:[1000%20TO%20*]"

04 · Answer

The answer of Solr, always JSON: response.numFound, response.docs and, with facets, facet_counts.facet_fields. Page through more than 1000 requests with start.

05 · Errors

ERROR_INVALID_CORE_NAMEHTTP 200

No index name.

ERROR_NOT_CORE_OWNERHTTP 200

The index is not yours.

ERROR_AUTHENTICATION_FAILEDHTTP 403

The email and API key do not match.

ERROR_RATE_LIMIT_PER_MINUTEHTTP 429

Too many calls. Wait for the Retry-After seconds: Rate limits.

06 · Related

The latest lines of the logs, without a query: tail_access_log, tail_apache_log.

Every error code and HTTP status of the API: API errors. Calls per minute and per hour: Rate limits.

Read Full Answer

Loading more articles...