> ## Documentation Index
> Fetch the complete documentation index at: https://docs.honeycomb.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Event Metadata Functions in Calculated Fields

> Event metadata functions available for calculated field formulas in Honeycomb, including SAMPLE_RATE, EVENT_TIMESTAMP, and INGEST_TIMESTAMP.

Event metadata functions return information that Honeycomb records about the current event, rather than a value from one of its fields.

## `SAMPLE_RATE`

Returns the sample rate of the current event as an integer.
If your data is sampled at `1/N`, the sample rate of each event is `N`.
Learn more in [Sampled Data in Honeycomb](https://docs.honeycomb.io/manage-data-volume/sample/sampled-data-in-honeycomb.md).
If the event has no sample rate, the function returns `1`.
This function takes no arguments.

```ruby theme={}
# Usage: SAMPLE_RATE()
# Examples
SAMPLE_RATE()
# Flag events that represent at least 100 original events.
GTE(SAMPLE_RATE(),100)
```

## `EVENT_TIMESTAMP`

Returns the Unix timestamp, also known as the Epoch timestamp, of the current event as a float (`1500549764.888`, for example).
This is useful for comparing two timestamps in an event; for example, to calculate a duration from a start and an end timestamp.
This function takes no arguments.

```ruby theme={}
# Usage: EVENT_TIMESTAMP()
# Examples
EVENT_TIMESTAMP()
```

## `INGEST_TIMESTAMP`

Returns the Unix timestamp, also known as the Epoch timestamp, indicating when Honeycomb's servers received the current event, as a float (`1500549764.888`, for example).
This is useful for debugging event latency by comparing the event timestamp to the ingestion time.
This function takes no arguments.

```ruby theme={}
# Usage: INGEST_TIMESTAMP()
# Examples
# Event latency, in seconds. May be negative for future-dated events.
SUB(INGEST_TIMESTAMP(),EVENT_TIMESTAMP())
# Event latency, in minutes. May be negative for future-dated events.
DIV(SUB(INGEST_TIMESTAMP(),EVENT_TIMESTAMP()),60)
# Event latency, accounting for span duration. Assumes `duration_ms` is in milliseconds.
SUB(INGEST_TIMESTAMP(),SUM(EVENT_TIMESTAMP(),DIV($duration_ms,1000)))
```
