Skip to main content

airline

Lightweight wide event logging to bring more observability to lambda functions.

This is very strongly inspired by honeycomb and their beeline library.

How?

Use the decorators!

import airline

airline.init(dataset='your_app_name')


@airline.evented()
def some_function(a, b)
    # do things

or

import airline
from airline.awslambda import airline_wrapper


airline.init(dataset='function_or_app_name')


@airline_wrapper
def handler(event, context):
    # do things

Wide event logging?

The idea is to build up the full context of a function/script into one wide event that gets emitted at the end. This puts all the context in one log message, making it very easy to run analytics on, find like errors, and a lot of other things. A full blown observability platform like honeycomb would be more informative, and allows for the notion of spans and distributed tracing (i.e. across different (micro) services and the like).

But this is a start.

Take this:

import time
import random

import airline

airline.init(dataset='example')



@airline.evented()
def main(a, b):
    airline.add_context_field("a", a)
    airline.add_context_field("b", b)

    with airline.timer('processing_a'):
        subfunction1(a)

    with airline.timer('processing_b'):
        subfunction1(b)


def subfunction1(input):
    time.sleep(random.uniform(0, len(input)))


main("foo", "example_long_thing")

And emit this at the end

{
  "time": "2020-03-09T09:49:43.376126Z",
  "dataset": "example",
  "client": "airline/0.1.0",
  "data": {
    "a": "foo",
    "b": "example_long_thing",
    "duration_ms": 9438.041,
    "timers": {
      "processing_a_ms": 255.11,
      "processing_b_ms": 9182.859
    }
  }
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airline-0.2.3.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airline-0.2.3-py2.py3-none-any.whl (10.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file airline-0.2.3.tar.gz.

File metadata

  • Download URL: airline-0.2.3.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.23.0

File hashes

Hashes for airline-0.2.3.tar.gz
Algorithm Hash digest
SHA256 94a5925aa109cac2e7ad695731a2ce3dcc7aff152efe089c212b0a1e4c04d7e9
MD5 0dae56f3469c378700bad11b643c43e0
BLAKE2b-256 b267d976f6ca2f25d40f8bb23d46beb898b7e0031f64aa4271fb1aefa05b756d

See more details on using hashes here.

File details

Details for the file airline-0.2.3-py2.py3-none-any.whl.

File metadata

  • Download URL: airline-0.2.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.23.0

File hashes

Hashes for airline-0.2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f0e3a237865b14eda1acd6e49910d245a59e431631eaef7cc38f6243bd1b8bdb
MD5 c00f23ca2567d8f5b9bac7d4faa126cb
BLAKE2b-256 b57d6ff58513a283c8c14af8bc8583e58dd9806f580862f84c1879f581ff1826

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page