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

feat(metrics):add some metrics #293

Merged
merged 1 commit into from
Jul 14, 2022
Merged

Conversation

renyunkang
Copy link
Member

@renyunkang renyunkang commented Jul 7, 2022

Signed-off-by: renyunkang [email protected]

Description

EIP

Type Metrics Describe
Gauge addresses_total The eip contains the total number of ips
Gauge addresses_in_use_total The eip has been assigned the number of ips
Gauge services_allocated_total Number of services to assign IP addresses from eip

ARP/NDP

Type Metrics Describe
Counter requests_received The number of arp requests received
Counter responses_sent The number of arp responses sent
Counter gratuitous_sent The number of sent GARP

BGP

Type Metrics Describe
Gauge session_up The status of BGP Sessions. idle(0) connect(1) active(2) opensent(3) openconfirm(4) established(5)
Gauge updates_total The total number of update packets received
Gauge announced_prefixes_total The total number of announced prefixes
Gauge pending_prefixes_total The total number of deleted prefixes

Related links:

#119

@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: renyunkang

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

1 similar comment
@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: renyunkang

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

@ks-ci-bot ks-ci-bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 7, 2022
@chaunceyjiang
Copy link
Contributor

Can you paste some pictures of your test ?

@renyunkang
Copy link
Member Author

Can you paste some pictures of your test ?

This is a simple test you can refer to.

Network topology
image

bgp.yaml

---
apiVersion: network.kubesphere.io/v1alpha2
kind: Eip
metadata:
  name: bgp-eip
spec:
  address: 10.10.100.10-10.10.100.100
---
apiVersion: network.kubesphere.io/v1alpha2
kind: BgpConf
metadata:
  name: default
spec:
  as: 50000
  listenPort: 17900
  routerId: 172.31.73.10
---
apiVersion: network.kubesphere.io/v1alpha2
kind: BgpPeer
metadata:
  name: bgp-peer
spec:
  conf:
    peerAs: 50001
    neighborAddress: 172.31.73.150
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: bgp-openelb
spec:
  replicas: 2
  selector:
    matchLabels:
      app: bgp-openelb
  template:
    metadata:
      labels:
        app: bgp-openelb
    spec:
      containers:
        - image: rykren/whoami
          name: whoami
          ports:
            - containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
  name: bgp-svc
  annotations:
    lb.kubesphere.io/v1alpha1: openelb
    protocol.openelb.kubesphere.io/v1alpha1: bgp
    eip.openelb.kubesphere.io/v1alpha2: bgp-eip
spec:
  selector:
    app: bgp-openelb
  type: LoadBalancer
  ports:
    - name: http
      port: 80
      targetPort: 80
  externalTrafficPolicy: Cluster

layer2.yaml

---
apiVersion: network.kubesphere.io/v1alpha2
kind: Eip
metadata:
  name: layer2-eip
spec:
  address: 172.31.73.155-172.31.73.160
  protocol: layer2
  interface: eth0
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: layer2-openelb
spec:
  replicas: 2
  selector:
    matchLabels:
      app: layer2-openelb
  template:
    metadata:
      labels:
        app: layer2-openelb
    spec:
      containers:
        - image: rykren/whoami
          name: whoami
          ports:
            - containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
  name: layer2-svc
  annotations:
    lb.kubesphere.io/v1alpha1: openelb
    protocol.openelb.kubesphere.io/v1alpha1: layer2
    eip.openelb.kubesphere.io/v1alpha2: layer2-eip
spec:
  selector:
    app: layer2-openelb
  type: LoadBalancer
  ports:
    - name: http
      port: 80
      targetPort: 80
  externalTrafficPolicy: Cluster

addresses_in_use_total
image

addresses_total
image

services_allocated_total
image

requests_received
image

responses_sent
image

gratuitous_sent
image

session_up
image

updates_total
image

announced_prefixes_total
image

pending_prefixes_total
image

@chaunceyjiang
Copy link
Contributor

Thanks!

/lgtm

@ks-ci-bot ks-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2022
@ks-ci-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: 554b69a0cfab580868932680589a466756922ab4

@ks-ci-bot ks-ci-bot merged commit 4ab158e into openelb:master Jul 14, 2022
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. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants