Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Add convenience method for sending events #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions signalfx_lambda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def send_metric(counters=[], gauges=[]):
if ingest:
ingest.send(counters=map_datapoints(counters), gauges=map_datapoints(gauges))

# convenience method
def send_event(event_type, dimensions={}, properties={})
if ingest:
ingest.send_event(event_type=event_type, dimensions=dimensions, properties=properties)

# convenience method
def send_counter(metric_name, metric_value=1, dimensions={}):
Expand Down
1 change: 1 addition & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ def handler(event, context):
print(context.function_version)
print(event["abc"])
signalfx_lambda.send_gauge('application_performance', 100)
signalfx_lambda.send_event('some_event')
return "result"