Skip to content

Conversation

@elevran
Copy link
Contributor

@elevran elevran commented Nov 27, 2025

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR adds the needed foundation for integrating datalayer with the configuration file. It builds on initial plugin support in #1901.

  • Define and register factory functions for datalayer.metrics.
  • Minor cleanup nits requested in Implement EPP Plugins by datalayer objects  #1901 (e.g., use typedName and backendmetrics.AllPodsPredicate)
  • Define the parameters section to be used in the configuration file's params section.

Note that the parameters are currently provided via CLI flags. The code uses the flags to set default configuration values before attempting to parse the configuration section. The change is not as clean as I'd like as it duplicates the flag names.
A better solution could have to concentrate all flag names and default values in a new epp/cli package (currently flags names are in cmd/epp/runner and their defaults are in pkg/epp/server). I can open an issue/PR if that sounds reasonable to do.

A follow up PR will add deprecation notice to the flags being replaced by configuration parameters. This will be done once config loading is ready. For additional context, see comments in datalayer/metrics/factories.go L100-110 of this PR.

Which issue(s) this PR fixes:
Refs #1408
Refs #1883
Refs #1910

Does this PR introduce a user-facing change?:
Not yet. A follow up PR would tie this into the configuration loading and deprecate CLI flags, both of which are user facing.

NONE

- Factories for metrics DataSource and Extracor.
- Configuration parameters (with defaults set from command line flags).
- Consistently use typedName instead of `tn`.

Signed-off-by: Etai Lev Ran <[email protected]>
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 27, 2025
@netlify
Copy link

netlify bot commented Nov 27, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit 0970745
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/692d863544f6ab00084b00f1
😎 Deploy Preview https://deploy-preview-1911--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 27, 2025
Signed-off-by: Etai Lev Ran <[email protected]>
Comment on lines 46 to 57
extractorParams struct {
// QueueRequestsSpec defines the metric specification string for retrieving queued request count.
QueueRequestsSpec string // `json:"queuedRequestsSpec"`
// RunningRequestsSpec defines the metric specification string for retrieving running requests count.
RunningRequestsSpec string // `json:"runningRequestsSpec"`
// KVUsage defines the metric specification string for retrieving KV cache usage.
KVUsageSpec string // `json:"kvUsageSpec"`
// LoRASpec defines the metric specification string for retrieving LoRA availability.
LoRASpec string // `json:"loraSpec"`
// CacheInfoSpec defines the metrics specification string for retrieving KV cache configuration.
CacheInfoSpec string // `json:"cacheInfoSpec"`
}
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make this as general key value pairs?
Ideally I think we don't want to change code and rebuild every time we update the metrics we're collecting.
(e.g., different orgs may have different plugins that require different metrics).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are configuration items for the specific Extractor we have today and is not meant for a generic metrics collection plugin. There are no plans for a generic metrics extractor that accepts a set of arbitrary metric names and extracts them.

Each metric spec is later interpreted differently (e.g., to get the latest, LORA and queue sizes are handled differently).
Also, making it generic KV-pairs implies we need to define and validate the keys, where the current params makes it explicit and matches the specific metrics collected.

If an aorganization needs new metrics they should code and register a new extractor attached to the existing metrics data source. That extractor would have its own configuration section, if needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think for the long term it might be good to investigate if we can make this a generic key/value pairs (maybe to include also the type of the metric, e.g., int, float?)
anyway, this is not a blocker for now for sure.

@elevran
Copy link
Contributor Author

elevran commented Dec 1, 2025

@shmuelk changed names to add specificity (e.g., MetricsDataSource, ModelServerExtractor).
PTAL

@shmuelk
Copy link
Contributor

shmuelk commented Dec 1, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 1, 2025
@nirrozenbaum
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: elevran, nirrozenbaum, shmuelk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 1, 2025
@k8s-ci-robot k8s-ci-robot merged commit 25cfb90 into kubernetes-sigs:main Dec 1, 2025
12 checks passed
@elevran elevran deleted the dl_config_factory branch December 2, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

4 participants