Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 30, 2025. It is now read-only.

Improve gorouter Route Registry Message Metrics#456

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

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

Conversation

@hoffmaen

@hoffmaen 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 hoffmaen marked this pull request as ready for review December 13, 2024 08:35
@hoffmaen hoffmaen requested a review from a team as a code owner December 13, 2024 08:35

@peanball 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.

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.

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.

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

@peanball 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.

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.

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.

You are right. We changed it back.

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

@maxmoehl 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.

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.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@peanball peanball Awaiting requested review from peanball
2 more reviewers
@b1tamara b1tamara b1tamara left review comments
@maxmoehl maxmoehl maxmoehl left review comments
Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /