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 k8s object labels to tcp metrics #134

Merged
merged 5 commits into from
Nov 25, 2020
Merged

Conversation

LorcanMcVeigh
Copy link
Contributor

Proposed changes

Add k8s object labels to tcp metrics

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING guide
  • I have proven my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have ensured the README is up to date
  • I have rebased my branch onto master
  • I will ensure my PR is targeting the master branch and pulling from my branch on my own fork

@@ -59,6 +66,24 @@ func (c *NginxPlusCollector) DeleteUpstreamServerPeerLabels(peers []string) {
c.variableLabelsMutex.Unlock()
}

// UpdateStreamUpstreamServerPeerLabels updates the Upstream Server Peer Labels
func (c *NginxPlusCollector) UpdateStreamUpstreamServerPeerLabels(streamUpstreamServerPeerLabels map[string][]string) {
c.variableLabelsMutex.Lock()

Choose a reason for hiding this comment

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

Why use a mutex here? Can this be called from multiple goroutines?

collector/nginx_plus.go Outdated Show resolved Hide resolved
collector/nginx_plus.go Outdated Show resolved Hide resolved
collector/nginx_plus.go Outdated Show resolved Hide resolved
collector/nginx_plus.go Outdated Show resolved Hide resolved
collector/nginx_plus.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Dean-Coakley Dean-Coakley left a comment

Choose a reason for hiding this comment

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

Left several comments about separating stream and http metric labels.
I think these cannot be mixed up.

For example, consider the differing data:

And

collector/nginx_plus.go Outdated Show resolved Hide resolved
collector/nginx_plus.go Outdated Show resolved Hide resolved
collector/nginx_plus.go Outdated Show resolved Hide resolved
collector/nginx_plus.go Outdated Show resolved Hide resolved
collector/nginx_plus.go Outdated Show resolved Hide resolved
Co-authored-by: Dean Coakley <dean.s.coakley@gmail.com>
@LorcanMcVeigh LorcanMcVeigh merged commit 1ffb988 into master Nov 25, 2020
@LorcanMcVeigh LorcanMcVeigh deleted the annotate-tcp-metrics branch November 26, 2020 13:52
@lucacome lucacome added enhancement Pull requests for new features/feature enhancements minor labels Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants