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 feature that can disable traffic generator metrics. #807

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

cody-littley
Copy link
Contributor

@cody-littley cody-littley commented Oct 15, 2024

Why are these changes needed?

We may not want all metrics to be enabled for the traffic generator.

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • hand tests
    • Unit tests
    • Integration tests
    • This PR is not tested :(

Signed-off-by: Cody Littley <[email protected]>
@cody-littley cody-littley marked this pull request as ready for review October 15, 2024 16:23
Copy link
Contributor

@ian-shim ian-shim left a comment

Choose a reason for hiding this comment

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

lgtm, few comments

Comment on lines +52 to +57
if metricsBlacklist == nil {
metricsBlacklist = []string{}
}
if metricsFuzzyBlacklist == nil {
metricsFuzzyBlacklist = []string{}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I don't think these are needed

@@ -106,6 +106,9 @@ func NewConfig(ctx *cli.Context) (*Config, error) {
EigenDAServiceManager: retrieverConfig.EigenDAServiceManagerAddr,
SignerPrivateKey: ctx.String(SignerPrivateKeyFlag.Name),
CustomQuorums: customQuorumsUint8,

MetricsBlacklist: ctx.StringSlice(MetricsBlacklistFlag.Name),
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need both flags?
could we just use MetricsFuzzyBlacklist? not sure what use cases there are where we want exact matching vs. fuzzy matching (fuzzy matching can cover all use cases we need for exact matching)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fuzzy matching is needed to handle metric labels that contain DA node IDs. Exact matching is needed to disable metrics where one metric is a substring of another. For example, there are two metrics labeled read and read_success. Without exact matching, we couldn't disable the read metric without also disabling the read_success metric.

The only straight forward way to avoid having two lists would be to interpret each entry as a regex. In your opinion, would you prefer to have a single list of regex blacklist arguments, or the current pattern?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. That makes sense. I think the current pattern is simpler in that case

@@ -14,14 +14,19 @@ type CountMetric interface {
type countMetric struct {
metrics *metrics
description string
// If true, the metric is disabled and should behave as a no-op.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: disabled specifies whether the metrics should behave as a no-op or something like that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wording updated

Signed-off-by: Cody Littley <[email protected]>
@cody-littley cody-littley merged commit 5b54e7d into Layr-Labs:master Oct 16, 2024
7 checks passed
@cody-littley cody-littley deleted the metrics-blacklist branch October 16, 2024 19:12
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