Skip to content

Commit

Permalink
Update metrics endpoint for NIMs to be /v1/metrics as per latest API …
Browse files Browse the repository at this point in the history
…spec (#265) (#267)

Signed-off-by: Shiva Krishna, Merla <[email protected]>
  • Loading branch information
shivamerla authored Dec 20, 2024
1 parent ed2e8a5 commit cd736fe
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions api/apps/v1alpha1/nimservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,22 @@ func (n *NIMService) GetServiceMonitorParams() *rendertypes.ServiceMonitorParams

// Set Service Monitor spec
smSpec := monitoringv1.ServiceMonitorSpec{
NamespaceSelector: monitoringv1.NamespaceSelector{MatchNames: []string{n.Namespace}},
Selector: metav1.LabelSelector{MatchLabels: n.GetServiceLabels()},
Endpoints: []monitoringv1.Endpoint{{Port: "service-port", ScrapeTimeout: serviceMonitor.ScrapeTimeout, Interval: serviceMonitor.Interval}},
NamespaceSelector: monitoringv1.NamespaceSelector{
MatchNames: []string{n.Namespace},
},
Selector: metav1.LabelSelector{
MatchLabels: n.GetServiceLabels(),
},
Endpoints: []monitoringv1.Endpoint{
{
Port: "service-port",
Path: "/v1/metrics",
ScrapeTimeout: serviceMonitor.ScrapeTimeout,
Interval: serviceMonitor.Interval,
},
},
}

params.SMSpec = smSpec
return params
}
Expand Down

0 comments on commit cd736fe

Please sign in to comment.