Skip to content

Conversation

@mjungsbluth
Copy link
Collaborator

@mjungsbluth mjungsbluth commented Sep 19, 2025

This PR passes through existing Prometheus metrics from Open Policy Agent by prefixing them to fit with remainging Skipper metrics and labeling them per virtual OPA instance.

This can only be supported for the Prometheus metrics flavour and is breaking the metrics abstraction as it pulls the Prometheus Registerer to the outside but avoids maintaining and copying existing work that has happened upstream in Open Policy Agent.

Should only be merged after #3562 is merged

@mjungsbluth mjungsbluth added the major moderate risk, for example new API, small filter changes that have no risk like refactoring or logs label Sep 19, 2025
@mjungsbluth mjungsbluth marked this pull request as ready for review September 30, 2025 14:02
@szuecs
Copy link
Member

szuecs commented Oct 10, 2025

👍

@mjungsbluth
Copy link
Collaborator Author

@torwunder could you also have a look?


found := false
for _, mf := range metricsFamilies {
if mf.GetName() == "plugin_status_gauge" && len(mf.Metric) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

you could also verify the labels for the metrics as this is also part of the interface to the outside

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch


func (p *Prometheus) Close() {}

// Implements the PrometheusMetrics interface
Copy link
Member

Choose a reason for hiding this comment

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

Godoc should start by the func name

}

opaRegistry, err = openpolicyagent.NewOpenPolicyAgentRegistry(
registryOpts := []func(*openpolicyagent.OpenPolicyAgentRegistry) error{
Copy link
Member

Choose a reason for hiding this comment

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

Maybe opaRegistryOpts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major moderate risk, for example new API, small filter changes that have no risk like refactoring or logs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants