Reports Plex events to New Relic
-
Create an insert key on New Relic (Account → API Keys → Create a key → Key type: "Ingest - License")
-
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
-
Open Plex webhook settings, and add the webhook
http://localhost:8080/webhook
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')
Creative Commons BY-SA 4.0