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

# Events

> Track application milestones and state changes using event logging. Create events to mark specific points in time during your application execution and capture additional metadata such as intermediate states and system milestones.

## How to Track Events?

Create events to mark specific points in time during your application execution. Capture additional metadata such as intermediate states and system milestones through events.

<div className="w-full flex justify-end -mb-11">
  <LanguageSwitcher />
</div>

## Attach an Event to Your Trace

<CodeGroup>
  ```typescript JS/TS theme={null}
  await trace.event({
      id: "event-id",
      name: "travel-plan-emailed",
      tags: { "email": "JetSetJoe@travelo.com" },
  });
  ```

  ```python Python theme={null}
  await trace.event(
      id="event-id",
      name="travel-plan-emailed",
      tags={"email": "JetSetJoe@travelo.com"}
  )
  ```

  ```go Go theme={null}
  trace.AddEvent(
      "event-id",
      "travel-plan-emailed",
      map[string]string{"email": "JetSetJoe@travelo.com"}
  )
  ```

  ```java Java theme={null}
  Event event = trace.addEvent(
      "event-id",
      "travel-plan-emailed",
      Map.of("email", "JetSetJoe@travelo.com")
  );
  ```
</CodeGroup>

<Note>
  Replace 'trace.event' with 'span.event' when you are creating events within a span
</Note>

<img src="https://mintcdn.com/maximai/fHnWe0mnvuD5228y/images/docs/tracing/via-sdk/event.png?fit=max&auto=format&n=fHnWe0mnvuD5228y&q=85&s=f7a7b6dff630894b5c26d11a83b786ca" alt="Events" width="2394" height="1704" data-path="images/docs/tracing/via-sdk/event.png" />
