Skip to content

Commit

Permalink
Enbale metrics with ipv6 (#2923)
Browse files Browse the repository at this point in the history
  • Loading branch information
lavanya-f5 authored Jun 12, 2023
1 parent a32d991 commit 7877b9b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/RELEASE-NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Bug Fixes
* `Issue 2632 <https://github.com/F5Networks/k8s-bigip-ctlr/issues/2632>`_: Fix hubmode support with NodePortLocal
* `Issue 2821 <https://github.com/F5Networks/k8s-bigip-ctlr/issues/2821>`_: Fix for additionalVirtualAddresses with serviceAddress config
* `Issue 2550 <https://github.com/F5Networks/k8s-bigip-ctlr/issues/2550>`_: Ability to specify monitors for TransportServer CR
* `Issue 2912 <https://github.com/F5Networks/k8s-bigip-ctlr/issues/2912>`_: Enable metrics with ipv6 mode
* Fix for recreating the LTM objects when CIS restarts in IPAM mode.
* Improved error handling for GTM objects with cccl-gtm-agent.
* Fix crash issue with liveness probe in NextGen routes
Expand Down
3 changes: 3 additions & 0 deletions pkg/controller/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ func NewAgent(params AgentParams) *Agent {
gtm,
params.PythonBaseDir,
)
} else {
// we only enable metrics as pythondriver is not initialized for ipv6
go agent.enableMetrics()
}
// Set the AS3 version for the agent
err = agent.IsBigIPAppServicesAvailable()
Expand Down
7 changes: 7 additions & 0 deletions pkg/controller/pythonDriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,10 @@ func (agent *Agent) healthCheckPythonDriver() {
bigIPPrometheus.RegisterMetrics(agent.PostManager.HTTPClientMetrics)
log.Fatal(http.ListenAndServe(agent.HttpAddress, nil).Error())
}

func (agent *Agent) enableMetrics() {
// Expose Prometheus metrics
http.Handle("/metrics", promhttp.Handler())
bigIPPrometheus.RegisterMetrics(agent.PostManager.HTTPClientMetrics)
log.Fatal(http.ListenAndServe(agent.HttpAddress, nil).Error())
}

0 comments on commit 7877b9b

Please sign in to comment.