Skip to content

feat: restore pagination, add health timeout & metrics config#50

Open
GabrielTenma wants to merge 6 commits into
masterfrom
enhancements/nightly-tasks
Open

feat: restore pagination, add health timeout & metrics config#50
GabrielTenma wants to merge 6 commits into
masterfrom
enhancements/nightly-tasks

Conversation

@GabrielTenma

Copy link
Copy Markdown
Member

Summary

Restores pagination functionality, adds configurable health check timeout and metrics config to stackyrd.

1. Pagination Restored (pkg/pagination/cursor.go)

  • Full cursor-based pagination from master restored
  • Added OffsetPagination helper (page/per_page based)
  • Added CursorPageBuilder for building paginated responses
  • Added ParsePaginationFromQuery for echo request parsing

2. Config Enhancements (config/config.go)

  • PaginationConfigType (offset/cursor), MaxPerPage
  • InfrastructureConfigInitTimeout (seconds, per-component health check timeout)
  • MetricsConfig.SampleRate — fractional rate for sampled metrics recording

3. Health Check Timeout (pkg/infrastructure/async_init.go)

  • Per-component timeout now configurable via infrastructure.init_timeout (default 10s)
  • Was hardcoded 10s, now uses config value

4. Health Endpoint (internal/server/server.go)

  • /health now returns init_timeout_seconds

Config Example

pagination:
  type: offset
  max_per_page: 100

infrastructure:
  init_timeout: 30

metrics:
  enabled: true
  sample_rate: "0.1"

…buffer

Add ResetTerminal function in pkg/utils/system.go to emit the escape sequence
restoring the main screen buffer, cursor, and text attributes. Update ClearScreen
in both pkg/utils/system.go and scripts/build/build.go to call ResetTerminal
before performing platform-specific clears, and adjust the defer cleanup in
runTUIBuild to also restore the main buffer. Apply similar startup clearing in
scripts/docker/docker_build.go and scripts/plugin/pkg.go for consistent
terminal state handling across all tools.
Records request count, duration, and sizes using the route template
(c.Path()) for bounded label cardinality.
- Restore cursor-based pagination from master (pkg/pagination/cursor.go) with added offset pagination helpers
- Add PaginationConfig (type, max_per_page) to config
- Add InfrastructureConfig (init_timeout) to config for per-component timeout
- Add MetricsConfig.SampleRate for sampled metrics recording
- Use config-driven init timeout in async health checks (was hardcoded 10s)
- Expose init_timeout_seconds in /health response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant