GithubHelp home page GithubHelp logo

podcasts-analytics-lambda's Introduction

podcasts-analytics-lambda

This lambda is responsible for sending podcasts metrics to Ophan, our real time analytics system.

It does so by mining our CDN logs (stored in an S3 bucket), collecting information about every single file hit and constructing a model out of every log line. If a log line is parsed correctly into the model, an event is sent to Ophan mimicking a pageview. Ophan has some ad-hoc logic and knows how to handle these special requests.

This lambda currently pulls audio data from logs provided by Fastly and Acast.

Architecture overview

+---------------+      +------------+                 +--------+                       +-------+
| Fastly/Acast  | ---> | S3 bucket* | -- triggers --> | Lambda | -- send events to --> | Ophan |
+---------------+      +------------+                 +--------+                       +-------+
  • The fastly and acast logs arrive in separate buckets, and another lambda copies them into a single bucket. Any log files above a certain size will be split into several files to ensure this lambda does not run out of time.

Run & Tests

To run locally you need to export a valid PROD CAPI key as a local variable:

export CAPI_KEY='your-PROD-key'
sbt test

Monitoring

The lambda logs warnings and errors to cloudwatch. E.g. a failed capi request is ERROR level, and failure to parse a single line is WARN level.

Cloudwatch alarms are triggered if:

  • the lambda invocation rate drops below 200/hour
  • the lambda fails with an error (e.g. out of memory, timeout)
  • the lambda logs any errors or warnings.

podcasts-analytics-lambda's People

Contributors

mchv avatar tomrf1 avatar fredex42 avatar oilnam avatar paulmr avatar fweddi avatar codingwithrach avatar emdash-ie avatar mullefa avatar scripttease avatar justinpinner avatar novembertang avatar tonytw1 avatar

Stargazers

 avatar  avatar Angel Ortega (he/they) avatar Akash Askoolum avatar

Watchers

Grant Klopper avatar Stephen Wells avatar Francis Rhys-Jones avatar theguardian.com continuous integration avatar  avatar Odhrán McConnell avatar James Cloos avatar  avatar Sam Morris avatar Gideon Goldberg avatar  avatar Natalia Baltazar avatar Colin King avatar Luke Taylor avatar Divya Bhatt avatar  avatar

podcasts-analytics-lambda's Issues

Update other build configuration

The master branch of this repository has been migrated to main using the master-to-main tool.

Please check any build related configuration and update as required:

  • TeamCity - See the required steps in the migrating.md document
  • Change snyk github integration(s) - it uses the default branch, but you will need to delete and reimport the project+file as this is the only way to refresh the default branch at present.
  • Any other externally configured analysis tooling your team is using e.g. travis CI

It's probably a good idea to merge test PR to main once this is complete, to make sure that everything is working as expected. 🙂

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.