Event
Represents an individual event to send to Honeycomb.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
The hostname for the Honeycomb API server to which to send this event. |
|
public |
data: * |
|
public |
The name of the Honeycomb dataset to which to send this event. |
|
public |
metadata: * |
|
public |
The rate at which to sample this event. |
|
public |
If set, specifies the timestamp associated with this event. |
|
public |
The Honeycomb authentication token for this event. |
Private Members | ||
private |
_libhoney: * |
Method Summary
Public Methods | ||
public |
adds a group of field->values to this event. |
|
public |
adds a single field->value mapping to this event. |
|
public |
addMetadata(md: any): Event attaches data to an event that is not transmitted to honeycomb, but instead is available when checking the send responses. |
|
public |
send() Sends this event to honeycomb, sampling if necessary. |
|
public |
Dispatch an event to be sent to Honeycomb. |
Public Constructors
public constructor() source
Public Members
public apiHost: string source
The hostname for the Honeycomb API server to which to send this event. default: https://api.honeycomb.io/
public data: * source
public metadata: * source
public timestamp: Date source
If set, specifies the timestamp associated with this event. If unset, defaults to Date.now();
public writeKey: string source
The Honeycomb authentication token for this event. Find your team write key at https://ui.honeycomb.io/account
Private Members
private _libhoney: * source
Public Methods
public add(data: Object | Map): Event source
adds a group of field->values to this event.
Example:
builder.newEvent()
.add ({
responseTime_ms: 100,
httpStatusCode: 200
})
.send();
let map = new Map();
map.set("responseTime_ms", 100);
map.set("httpStatusCode", 200);
let event = honey.newEvent();
event.add (map);
event.send();
public addField(name: string, val: any): Event source
adds a single field->value mapping to this event.
Params:
Name | Type | Attribute | Description |
name | string | ||
val | any |
Example:
builder.newEvent()
.addField("responseTime_ms", 100)
.send();
public addMetadata(md: any): Event source
attaches data to an event that is not transmitted to honeycomb, but instead is available when checking the send responses.
Params:
Name | Type | Attribute | Description |
md | any |
public sendPresampled() source
Dispatch an event to be sent to Honeycomb. Assumes sampling has already happened, and will send every event handed to it.