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

[BUG] The backend ServerMetric is not correct #294

Open
YRXING opened this issue Nov 24, 2021 · 9 comments · May be fixed by #610
Open

[BUG] The backend ServerMetric is not correct #294

YRXING opened this issue Nov 24, 2021 · 9 comments · May be fixed by #610
Assignees
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@YRXING
Copy link

YRXING commented Nov 24, 2021

As the konnectivity server may has multiple BackendManagers, the backend metric should record the total backends stored in various of BackendManager even if we can record them with a label.

However, the backend metric is recorded by DefaultBackendStorage, which is the underlying storage implementation. It will result in only some BackendManager record its number of backends.

The solution is that backend metric should be recorded by konnectivity server instead of DefaultBackendStorage.

@mainred
Copy link
Contributor

mainred commented Nov 27, 2021

I don't think it's a bug. It's not only DefaultBackendManager that can record the backend but all backend managers inherit AddBackend from DefaultBackendStorage. Please reconsider this.

@YRXING
Copy link
Author

YRXING commented Nov 29, 2021

Yes, every backend manager will inherit AddBackend method.

What I wonder is that the DefaultBackendStorage record backend metric through setting their own backends count while the backend metric is belong to proxy server. And the backend managers will overwrite each other's values.

For example, the proxy server has two backend managers. One has three backends and the other has five backends. Now the backend metric will only be one of these tow values while the actual value may be greater than three and smaller than five.

The related codes as following shows:

// SetBackendCount sets the number of backend connection.
func (a *ServerMetrics) SetBackendCount(count int) {
	a.backend.WithLabelValues().Set(float64(count))
}


func (s *DefaultBackendStorage) AddBackend(identifier string, idType pkgagent.IdentifierType, conn agent.AgentService_ConnectServer) Backend {
	// ...
	addedBackend := newBackend(conn)
	// ...
	metrics.Metrics.SetBackendCount(len(s.backends))
	// ...
	return addedBackend
}

@mainred
Copy link
Contributor

mainred commented Nov 29, 2021

Thanks for your explanation, let's go on with your fix. proxy server is designed to support multiple backend managers, though currently only one is used.

@jkh52
Copy link
Contributor

jkh52 commented Dec 6, 2021

/cc @yan-lgtm
/cc @cheftako

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 6, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 5, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jkh52 jkh52 added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Oct 6, 2023
@jkh52 jkh52 reopened this Oct 6, 2023
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue Apr 12, 2024
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue Apr 15, 2024
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue Apr 15, 2024
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue Apr 15, 2024
@jkh52 jkh52 linked a pull request Apr 15, 2024 that will close this issue
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue Apr 15, 2024
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue Apr 17, 2024
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue Apr 17, 2024
@jkh52
Copy link
Contributor

jkh52 commented Apr 23, 2024

/assign

jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue May 10, 2024
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue May 10, 2024
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue May 10, 2024
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue May 10, 2024
jkh52 added a commit to jkh52/apiserver-network-proxy that referenced this issue May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
5 participants