Skip to content

albertstill/stats-gopher

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stats Gopher

Circle CI

A web stats endpoint for relaying stats to NewRelic Insights from the browser.

Environment variables:

  • PORT defaults to 80
  • NEW_RELIC_INSIGHTS_KEY
  • NEW_RELIC_INSIGHTS_ENDPOINT
  • STDOUT_LISTENER=1 prints all events received to STDOUT

NEW_RELIC_INSIGHTS_* values come from Insights (See "Manage Data" / "API Keys" within Insights)

Events

http://wherever.its.hosted.net/gopher/

POST Any data here to have it relayed to insights

Stats Gopher does no processing of the data; events are relayed unchanged

Presence

http://wherever.its.hosted.net/presence/

This allows a browser to send heartbeat and user-activity notifications. The stats gopher is currently (statically) configured to monitor for only these two types of presence. Other notifications would be ignored.

Expected usage scenario:

Browsers sends a regular (~10s) heartbeat notification:

{
  key: "<session-id>@my-site",
  code: "heartbeat"
}

and sends useractivity notifications whenever a window mouse event is triggered:

{
  key: "<session-id>@my-site",
  code: "user-activity"
}

The stats gopher is configured with a heartbeat timeout of 45s and a user activity timeout of 45min. If either timeout occurs the session is condisered dead and an event is sent to new relic with the session duration

Note the key. The key could be used to monitor a session, sitewide as above, or a single page: <session-id>@my-site/my-page or even all users on a page: my-site/my-page

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%