Skip to content

Plex webhook listener and forwarder to New Relic

Notifications You must be signed in to change notification settings

aelindeman/plex-webhook-newrelic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plex-webhook-newrelic

Reports Plex events to New Relic

Setup

  1. Create an insert key on New Relic (Account → API Keys → Create a key → Key type: "Ingest - License")

  2. Run it where Plex can see it

    docker run \
      -d
      -e NEW_RELIC_INSERT_KEY
      -p 8080:8080 \
      ghcr.io/aelindeman/plex-webhook-newrelic:latest
    
  3. Open Plex webhook settings, and add the webhook http://localhost:8080/webhook

Usage & example queries

Play a couple items in Plex, and query in New Relic

  • All events:

    FROM PlexWebhookEvent SELECT *
    
  • Play counts per media type:

    FROM PlexWebhookEvent SELECT count(*) WHERE event IN ('media.play') FACET metadata_section
    
  • Most popular items:

    FROM PlexWebhookEvent SELECT count(*) WHERE event IN ('media.play') FACET metadata_grandparent_name, metadata_parent_name
    
  • Heatmap of plays by day of the week and time:

    FROM PlexWebhookEvent SELECT histogram(numeric(capture(hourOf(timestamp), '^(?P<hour>[0-9]{2}):.+$')), 24, 12) FACET weekdayOf(timestamp) WHERE event IN ('media.play')
    

Development

License

Creative Commons BY-SA 4.0