Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gateway monitor metrics and event #2345

Merged
merged 9 commits into from
Feb 22, 2023

Conversation

changluyi
Copy link
Collaborator

What type of this PR

Examples of user facing changes:

  • Features
    1. add gateway packet count metrics
    2. add event for subnet gatewayType or gatewayNode change
    3. add event for subnet gateway ping failed
  • Bug fixes
  • Docs
  • Tests

Which issue(s) this PR fixes:

Fixes #2233

@changluyi changluyi added the feature New network feature label Feb 16, 2023
@changluyi changluyi force-pushed the add_gateway_monitor_metrics_and_event branch 2 times, most recently from 92acc7c to 866a34d Compare February 16, 2023 07:31

if oldSubnet.Spec.GatewayType != newSubnet.Spec.GatewayType {
c.recorder.Eventf(newSubnet, v1.EventTypeNormal, "SubnetGatewayTypeChanged",
"subnet gateway type change from %s to %s ", oldSubnet.Spec.GatewayType, newSubnet.Spec.GatewayType)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"subnet gateway type change from %s to %s ", oldSubnet.Spec.GatewayType, newSubnet.Spec.GatewayType)
"subnet gateway type changes from %s to %s ", oldSubnet.Spec.GatewayType, newSubnet.Spec.GatewayType)


if oldSubnet.Spec.GatewayNode != newSubnet.Spec.GatewayNode {
c.recorder.Eventf(newSubnet, v1.EventTypeNormal, "SubnetGatewayNodeChanged",
"gateway node change from %s to %s ", oldSubnet.Spec.GatewayNode, newSubnet.Spec.GatewayNode)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"gateway node change from %s to %s ", oldSubnet.Spec.GatewayNode, newSubnet.Spec.GatewayNode)
"gateway node changes from %s to %s ", oldSubnet.Spec.GatewayNode, newSubnet.Spec.GatewayNode)

c.recorder.Eventf(newSubnet, v1.EventTypeNormal, "SubnetGatewayNodeChanged",
"gateway node change from %s to %s ", oldSubnet.Spec.GatewayNode, newSubnet.Spec.GatewayNode)
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should also care about the ActivateGateway and status changes between ready and not ready

@@ -66,6 +66,28 @@ var (
[]string{"code", "method", "host"},
)

metricOvnSubnetGatewayPacketBytes = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should use counter type as the number keeps increase

@@ -531,6 +531,11 @@ func (c *Controller) loopEncapIpCheck() {
}
}

func (c *Controller) ovnMetricsUpdate() {
resetOvnSubnetGatewayMetrics()
Copy link
Collaborator

Choose a reason for hiding this comment

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

why reset is needed

@changluyi changluyi force-pushed the add_gateway_monitor_metrics_and_event branch from eab8242 to f2cbcf1 Compare February 17, 2023 05:53
@changluyi changluyi force-pushed the add_gateway_monitor_metrics_and_event branch from a032854 to 7cf5bf3 Compare February 20, 2023 05:10
pkg/daemon/gateway_linux.go Show resolved Hide resolved
pkg/daemon/gateway_linux.go Show resolved Hide resolved
@changluyi changluyi force-pushed the add_gateway_monitor_metrics_and_event branch from f5b5431 to e787ce3 Compare February 22, 2023 08:30
@changluyi changluyi merged commit ee53dfe into master Feb 22, 2023
@changluyi changluyi deleted the add_gateway_monitor_metrics_and_event branch February 22, 2023 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New network feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More metrics and events about gateway status
2 participants