Glimpse Server

Warning

This site documents Glimpse 2.0.0. It is a work in progress, and still has a long way to go.

For Glimpse v1 documentation, please visit getglimpse.com/Docs.

The primary purpose of the Glimpse server is to store messages generated by Glimpse agents, to be queried for by Glimpse clients.

Agent ---+                                +--- Client
         |                                |
         +--(Store)--> Server <--(Query)--+
         |                                |
Agent ---+                                +--- Client

Contexts

A “context” represents a related set of messages. Each context has a unique ID and a type. While the Glimpse server can store arbitrary contexts, it specifically tracks a type of context called a request (i.e. an individual HTTP request).

Requests

The Glimpse server tracks a specific set of “indices” for each request to enable efficient filtration by a Glimpse client through the request-history resource.

Index Type Behavior Description
request-duration number Overwritten The total length of time taken by the request (in milliseconds)
request-url string Overwritten The URL of the request
request-method string Overwritten The HTTP method of the request (e.g. GET, POST, etc.)
request-userId string Overwritten The ID of the user associated with the request
request-statuscode number Overwritten The HTTP status code returned by the request (e.g. 200, 401, etc.)
request-datetime string Overwritten The time at which the request began
request-tags array Aggregated A set of tags associated with the request (case-sensitive)

The Behavior column indicates how the store handles multiple messages of a given context containing values for the same index. Overwritten means that later messages overwrite the indices of earlier messages. Aggregated means that the indices of all messages for a given context are aggregated.

Note

The index names are case-sensitive.

Message Store

The Glimpse server groups stored messages by their context. That is, messages with the same context ID are grouped together.

In-memory Store

By default, the Glimpse server will use an in-memory message store. Accumulated messages will be lost if/when the server is shut down. To limit the amount of memory used by the store, the store will retain, at most, 500 individual contexts.

Note

Currently, there is no limit on the number of messages associated with any given context.

When that limit is reached, contexts will be disarded in “least-recently-used” fashion. That is, each time a message is stored by the Glimpse server, its associated context is moved to the beginning of the context list. The context at the end of that list will be the first to be discarded.

Message Query

The Glimpse server allows clients to query the message store in one of two ways: by context ID or by a combination of request indices (for contexts of type request). In both cases, messages can be futher filtered by type.

Query Messages

The entire message store can be queried by context ID and/or type:

Query Parameter Type Description
Context ID string If specified, only messages related to this context will be returned.
Type array If specified, only messages matching any of these types will be returned.

Query Requests

Request contexts can be queried by a combination of request indices and/or type:

Query Parameter Type Description
Duration Minimum number If specified, messages of requests of a shorter duration will not be returned.
Duration Maximum number If specified, messages of requests of a longer duration will not be returned.
URL Contains string If specified, only messages of requests with URLs matching this fragment will be returned (case-sensitive).
Method List array If specified, only messages of requests with one of these method types will be returned (case-sensitive).
Status Code Minimum number If specified, messages of requests with smaller status codes will not be returned.
Status Code Maximum number If specified, messages of requests with larger status codes will not be returned.
Tag List array If specified, only messages of requests with one of these tags will be returned (case-sensitive).
Request Time Before string If specified, only messages of requests starting before this time will be returned.
User ID string If specified, only messages of requests associated with this user will be returned (case-sensitive).