hashicorp / hashicorp/nomad

Allow connecting to event stream at current index

Open
#9,418 0 comments 7 reactions 0 assignees View on GitHub
theme/events type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
1.0.0-beta3

### Issue
The event stream allows specifying an `index` query parameter, indicating the [desired start](https://www.nomadproject.io/api-docs/events#index). The default value is `0`, which plays back all available events.

It would be nice to have the ability to start at the current index. This can be done now by making an API call (e.e., `/v1/namespaces`) and checking the `X-Nomad-Index` response header, then using that on the subsequent call to the event stream. Supporting this use case in the `/v1/event/stream` endpoint (for example, using `?index=-1`) would avoid making two calls.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the /v1/event/stream endpoint and trace its index parameter handling and existing event-stream tests. Verify how the current index is obtained and define the sentinel behavior, then add coverage showing that a connection starts at the current index without a separate API request.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, distributed-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.