Skip to content

add routing and performance columns to input table#25997

Open
AntonEbel wants to merge 24 commits into
masterfrom
input_columns
Open

add routing and performance columns to input table#25997
AntonEbel wants to merge 24 commits into
masterfrom
input_columns

Conversation

@AntonEbel
Copy link
Copy Markdown
Contributor

@AntonEbel AntonEbel commented May 13, 2026

Description

Adds a pluggable entity metrics system that serves precomputed, permission-filtered metrics for entity tables via a single API call. Enterprise plugins can register additional descriptors via Guice named multibinding, extending the same endpoint without modifying open-source code.

Endpoint

GET /system/inputs/metrics?input_ids=<id>&fields=messages_per_stream&fields=extractor_count


Columns

Message Count (Last 24H)

Badge: Total message count for the input over the last 24 hours.

  • Field: messages_per_stream
  • Data: Map<String, Long> — stream ID → message count, filtered by the user's streams:read permissions
  • Calculation: Sum all values to get the total count for the badge
  • Source: OpenSearch terms aggregation on gl2_source_input grouped by streams (24h window, cached in MongoDB with 5m TTL)

Expandable: Per-stream message breakdown.

  • Data: The keys and values of the same messages_per_stream map
  • Resolve stream names: POST /system/catalog/entities/titles with the stream IDs from the map keys
  • Display: Stream name → message count. Deleted streams show as <id> (deleted)

Example response:

{
  "metrics": {
    "66756e35f932ec1c3ab6b68a": {
      "messages_per_stream": {
        "000000000000000000000001": 76249,
        "000000000000000000000004": 7076
      }
    }
  }
}

Extractor Count

Badge: Number of extractors configured on the input.

  • Field: extractor_count
  • Data: Integer — count of embedded extractors in the input document
  • Source: MongoDB aggregation with $size on the embedded extractors array (single batch query for all requested inputs, not cached)

Expandable: List of extractors with links to detail view.

  • Fetch: GET /system/inputs/{inputId}/extractors (existing endpoint, lazy-loaded on click)

Example response:

{
  "metrics": {
    "66756e35f932ec1c3ab6b68a": {
      "extractor_count": 2
    }
  }
}

Associated Streams (Last 24H)

No separate field — derived from messages_per_stream.

Badge: Number of streams that received messages from this input.

  • Calculation: Count the keys of the messages_per_stream map

Expandable: List of associated streams with links.

  • Data: The keys of the messages_per_stream map
  • Resolve stream names: POST /system/catalog/entities/titles with the stream IDs
  • Display: Stream names as hyperlinks. Deleted streams show as <id> (deleted)

Architecture

  • EntityMetricDescriptor — base interface, EntityCachedMetricDescriptor<C, R> for cached metrics, EntityUncachedMetricDescriptor<R> for fresh-per-request metrics
  • EntityMetricsService — orchestrates cache lookup, stale field recomputation, and per-user permission filtering
  • MetricsCacheService — MongoDB-backed cache with per-field TTLs and 24h TTL index cleanup
  • Descriptors registered via Guice named multibinding in EntityMetricsModule

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

/nocl

@AntonEbel AntonEbel changed the title add routing and performance columns to input and forwarder input tables add routing and performance columns to input table May 15, 2026
@AntonEbel AntonEbel marked this pull request as ready for review May 19, 2026 07:58
@AntonEbel AntonEbel requested a review from a team May 19, 2026 09:48
@AntonEbel AntonEbel marked this pull request as draft May 19, 2026 13:11
@AntonEbel AntonEbel marked this pull request as ready for review May 21, 2026 06:57
@kodjo-anipah kodjo-anipah requested review from a team and kodjo-anipah May 21, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add routing and performance columns to Inputs and Forwarder Inputs tables

4 participants