Skip to content

feat(extractor): add spoke-epp engine type for multi-cluster#1928

Draft
yehuditkerido wants to merge 1 commit into
llm-d:mainfrom
yehuditkerido:spoke-epp-engine
Draft

feat(extractor): add spoke-epp engine type for multi-cluster#1928
yehuditkerido wants to merge 1 commit into
llm-d:mainfrom
yehuditkerido:spoke-epp-engine

Conversation

@yehuditkerido

@yehuditkerido yehuditkerido commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:

Extends the core-metrics-extractor plugin with a new spoke-epp engine type for Hub-and-Spoke multi-cluster deployments. This enables Hub EPP to scrape pool-average metrics from Spoke EPPs and map them to the standard Metrics struct.

Key changes:

  • Add SpokeEPPEngineType constant and engine config mapping llm_d_epp_average_* metrics
  • Auto-detect cluster endpoints via PodName == "" (no labels required)
  • Add tests for cluster endpoint detection and metric extraction

Which issue(s) this PR fixes:
Fixes #1913 Related to #1907

Release note (write NONE if no user-facing change):

NONE

@yehuditkerido
yehuditkerido requested a review from a team as a code owner July 8, 2026 12:46
@yehuditkerido
yehuditkerido requested review from liu-cong and vMaroon July 8, 2026 12:46
@github-actions github-actions Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. labels Jul 8, 2026
@yehuditkerido
yehuditkerido marked this pull request as draft July 8, 2026 15:49
@github-actions github-actions Bot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Jul 14, 2026
Auto-detect cluster endpoints via empty PodName and map Spoke EPP's
pool-average metrics (llm_d_epp_average_*) to the standard Metrics struct.

Signed-off-by: Yehudit Kerido <ykerido@redhat.com>
@yehuditkerido
yehuditkerido marked this pull request as ready for review July 21, 2026 06:15
@elevran

elevran commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

@yehuditkerido zooming out for a second - does a spoke cluster endpoint need the standard metrics extractor and metrics fields or is it scraping a different format?
If the remote EPP produces differnet metrics
If a different format, consider (1) disabling the built-in metrics collection (2) configure the metrics data source with a new extractor specific to hub-spoke metrics of interest (3) store the metrics values as endpoint attributes.
The benefit of mapping to the existing metrics fields is that existing filters/scorers operate on them. If we add new filters and scorers specific to multicluster (e.g., latency, cost) anyway, then there is little value from reusing existing plugins.

}

// getEngineTypeFromEndpoint extracts the engine type from endpoint metadata labels.
// getEngineTypeFromEndpoint extracts the engine type from endpoint metadata.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can the same be achieved by defining a custom set of metrics mapping instead of a new type?


// getEngineTypeFromEndpoint extracts the engine type from endpoint metadata labels.
// getEngineTypeFromEndpoint extracts the engine type from endpoint metadata.
// Cluster endpoints (identified by empty PodName) automatically use SpokeEPPEngineType.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how are cluster endpoints named - which field is used? is the reliance on "magic" (empty PodName means its a cluster endpoint) the right long term approach or should we use an endpoint attribute instead (the file based discovery can populate the attribute)?

// Case 1: Engine = vllm (uses default)
epVllm := fwkdl.NewEndpoint(&fwkdl.EndpointMetadata{
Labels: map[string]string{DefaultEngineTypeLabelKey: "vllm"},
PodName: "vllm-pod",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the empty == cluster seems fragile. Case in point, it was not an assumption that holds for the current code base.

registry := NewMappingRegistry()

// Register spoke-epp mapping for cluster endpoints
spokeMapping, err := NewMapping(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the empty mappings indicate that EPP metrics and endpoint metrics are the same shape. I would strongly recommend a new Extractor for EPP endpoints.
It can fill in the existing metrics fields or create a new endpoint attribute with only the relevant fields.
I would suspect that Cluster endpoints have different attributes than inference server endpoints (not just metrics).

CacheBlockSizeSpec: "",
CacheNumBlocksSpec: "",
},
// "spoke-epp" defines metrics for multi-cluster Hub-and-Spoke deployments where the Hub EPP

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reconsider the overloading of the current metrics struct and mechanisms for carrying EPP information. While doable, feels hackish and there should be cleaner alterntiaves using core datalayer concepts for new plugins.

@elevran elevran self-assigned this Jul 21, 2026
@yehuditkerido
yehuditkerido marked this pull request as draft July 23, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(datalayer): Add spoke-epp engine type for cluster metrics extraction

2 participants