Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@huikang
Copy link
Contributor

@huikang huikang commented Jul 29, 2022

  • Based off branch metrics-label-backport

  • Add labels to ping metrics

  • Pass metrics label to memberlist

  • some sample output

consul_serf_msgs_sent_count{instance="127.0.0.1:8500", job="server", quantile="0.5", segment="alpha"}
consul_serf_msgs_received_count{instance="127.0.0.1:8500", job="client", segment="alpha"}



consul_serf_snapshot_appendLine_count{instance="127.0.0.1:8500", job="server", segment="alpha"} | 5
-- | --
consul_serf_snapshot_appendLine_count{instance="127.0.0.1:8500", job="server, segment="beta"} | 3
consul_serf_snapshot_appendLine_count{instance="127.0.0.1:8500", job="server", segment="default"} | 4


@huikang huikang requested a review from rboyer July 29, 2022 15:06
@huikang huikang changed the title Add lable for ping msg Add lable for ping msg; config memberlist metrics label Jul 29, 2022
@rboyer rboyer changed the title Add lable for ping msg; config memberlist metrics label Add label for ping msg; config memberlist metrics label Aug 1, 2022
@rboyer
Copy link
Member

rboyer commented Aug 1, 2022

Might want to rebase this on the other PR so the tests run.

@huikang huikang force-pushed the metrics-labels-backport-hui branch from 9123e0f to d392b06 Compare August 1, 2022 20:54
@huikang huikang force-pushed the metrics-labels-backport-hui branch from 308bdcd to 650720c Compare August 1, 2022 21:06
Copy link
Member

@rboyer rboyer left a comment

Choose a reason for hiding this comment

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

Some comments on API backwards compatibility

// basic testing of the algorithm, but not tuned to any particular type of cluster.
func DefaultConfig() *Config {
func DefaultConfig(metricLabels []metrics.Label) *Config {
return &Config{
Copy link
Member

Choose a reason for hiding this comment

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

This would break backwards compatibility. Either add a new function or elect to post-creation edit the returned value to set the metrics field

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

serf/snapshot.go Outdated
clock *LamportClock,
outCh chan<- Event,
shutdownCh <-chan struct{}) (chan<- Event, *Snapshotter, error) {
shutdownCh <-chan struct{}, metricLabels []metrics.Label) (chan<- Event, *Snapshotter, error) {
Copy link
Member

Choose a reason for hiding this comment

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

This breaks compatibility for the library function. We'll need a new function to pass the labels

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@huikang huikang force-pushed the metrics-labels-backport-hui branch from 3c52791 to 109a283 Compare August 2, 2022 02:41
@huikang huikang merged commit 14da154 into metrics-labels-backport Aug 2, 2022
@huikang huikang deleted the metrics-labels-backport-hui branch August 2, 2022 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants