0.4.1 • Published 4 years ago

meetup-event-logger v0.4.1

Weekly downloads
1,251
License
ISC
Repository
-
Last release
4 years ago

Event Logging Library for Avro Records

To build:

npm run build

build files on save

npm run watch

To run tests:

npm test

To release new version:

update version in package.json

This will publish a new version to npm registry upon build.

To configure for use in lambda

Set the environment variable ANALYTICS_EVENT_ENVELOPE to the value chapin.

We log a field called 'source' to track the origin of the data. As the default, 'source' is set to the value of AWS_LAMBDA_FUNCTION_NAME. However, if you would like to specify a different string as the 'source', set the ANALYTICS_SOURCE environment variable.

An Example

const eventLogger = require('meetup-event-logger');

const sampleSchema = {
    namespace: 'com.meetup.base.avro',
    type: 'record',
    name: 'Request',
    doc: 'v1',
    fields: [
        { name: 'timestamp', type: 'string' },
        { name: 'data', type: 'string' },
    ]
};

const sampleSchemaSeralizer = eventLogger.avroSerializer(sampleSchema);

eventLogger.log({
    'timestamp':moment(new Date().toISOString()).tz('America/New_York').format()
    'data':'some data',
}, sampleSchemaSeralizer);

eventLogger.log({
    'timestamp':moment(new Date().toISOString()).tz('America/New_York').format()
    'data':'some other data',
}, sampleSchemaSeralizer);

Sending test data

You can send test data in the same way using the logTestData function like the following (assuming we're using the same sampleSchema and sampleSchemaSerializer defined above):

eventLogger.logTestData({
    'timestamp':moment(new Date().toISOString()).tz('America/New_York').format()
    'data':'some other data',
}, sampleSchemaSeralizer);
0.4.1

4 years ago

0.3.0

4 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago