FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve gorouter Route Registry Message Metrics by hoffmaen · Pull Request #456 · cloudfoundry/gorouter · GitHub

This repository was archived by the owner on Apr 30, 2025. It is now read-only.
/ gorouter Public archive

Improve gorouter Route Registry Message Metrics - #456

Draft
hoffmaen wants to merge 8 commits into
cloudfoundry:mainfrom
sap-contributions:route-registry-metrics
Draft

Improve gorouter Route Registry Message Metrics#456
hoffmaen wants to merge 8 commits into
cloudfoundry:mainfrom
sap-contributions:route-registry-metrics

Conversation

hoffmaen commented Dec 12, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

Summary
Solution for cloudfoundry/routing-release#445.

Backward Compatibility

Breaking Change? Yes - metrics and log messages for route registry are renamed (needs to be fixed)

hoffmaen force-pushed the route-registry-metrics branch from efa7e82 to 8c017fb Compare December 12, 2024 13:49
hoffmaen marked this pull request as ready for review December 13, 2024 08:35
hoffmaen requested a review from a team as a code owner December 13, 2024 08:35

peanball left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

most important comment: route registration logging for any result is now Info level and will cause significant increase in logs in production. Please change it back to debug level output for "refreshes" and "no-ops".

Some other smaller suggestions are there but not vital.

Comment thread metrics/metricsreporter.go Outdated
Comment thread metrics/metricsreporter.go Outdated
m.Logger.Debug("failed-sending-metric", log.ErrAttr(err), slog.String("metric", componentName))
componentName = "unregistry_message." + action + "." + msg.Component()
}
m.Batcher.BatchIncrementCounter(componentName)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

is this equivalent to the previously used m.Sender.IncrementCounter(componentName)?

Comment thread registry/registry.go Outdated
Comment thread registry/registry.go Outdated
Comment on lines -148 to -160
func (m *MetricsReporter) CaptureUnregistryMessage(msg ComponentTagged) {
var componentName string
if msg.Component() == "" {
componentName = "unregistry_message"
} else {
componentName = "unregistry_message." + msg.Component()
}
err := m.Sender.IncrementCounter(componentName)
if err != nil {
m.Logger.Debug("failed-sending-metric", log.ErrAttr(err), slog.String("metric", componentName))
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This would change existing metrics, I don't think we should do this.

peanball Dec 16, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

just for my understanding:

Would you then want to have the "old" total metric and new breakdown metrics in addition?

Something like this?

registry_message: 100
registry_message.endpoint-registered: 5
registry_message.endpoint-updated: 94
registry_message.endpoint-unregistered: 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What I mean is that this change:

https://github.com/cloudfoundry/gorouter/pull/456/files#diff-5593a38c8a92809ab9448ee33f120e244e7fc4c0fd0689e239a9e85dc4ae0933L173-R188

will change the emitted metrics for unregister messages from unregistry_message.* to registry_message.*. This would be a breaking change which doesn't seem to provide much value and could be avoided.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You are right. We changed it back.

b1tamara force-pushed the route-registry-metrics branch from fae675a to ab6772f Compare December 18, 2024 09:44
b1tamara force-pushed the route-registry-metrics branch from ab6772f to ef4bebb Compare December 18, 2024 09:51
peanball dismissed their stale review December 18, 2024 11:30

New commits

componentName = "registry_message." + action
} else {
componentName = "registry_message." + msg.Component()
componentName = "registry_message." + action + "." + msg.Component()

maxmoehl Dec 18, 2024
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This will probably also change the metric name right? I was hoping that we could preserve the metric name but only add an additional tag to it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is what I had in mind. But it seems like the API is a bit cumbersome to use...

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL