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

How to stop Metrics ??? #451

Closed
shuqingzai opened this issue Jan 20, 2025 · 4 comments · Fixed by #453
Closed

How to stop Metrics ??? #451

shuqingzai opened this issue Jan 20, 2025 · 4 comments · Fixed by #453

Comments

@shuqingzai
Copy link

shuqingzai commented Jan 20, 2025

Please provide as much of the question context as you can

Hello, I tried to find a way to stop Metrics initialization, but I couldn't find a way

  1. According to
    if n.config.NodeInfoMetricsAggregateInterval == 0 {
    , I set it to 0, but according to
    c.NodeInfoMetricsAggregateInterval = 60 * time.Second
    , it was set to 0 and the default was changed to 60s
  2. The reason for stopping is https://github.com/FZambia/eagle/blob/99f5d7833f0cf7ccd7ab29ffc60fe0ab35b3934a/eagle.go#L263-L264 . If it does not meet the Eagle rules, it will panic, which is not friendly to my existing program. I can only stop it

Image

@shuqingzai
Copy link
Author

Is there a way to make this format compatible?

@FZambia
Copy link
Member

FZambia commented Jan 20, 2025

Hello, I'll take a look, definitely need to be fixed on Centrifuge side. Most probably fixing Eagle is required here. As a temporary workaround maybe you can run Centrifuge with custom RegistererGatherer - see https://pkg.go.dev/github.com/centrifugal/centrifuge#MetricsConfig but it will result into all Centrifuge metrics reported to a different registry of Prometheus so may be not exported for now easily (maybe it's possible to tell Prometheus to use two different RegistererGatherer to collect metrics from in your Prometheus metrics handler).

@shuqingzai
Copy link
Author

Hello, I'll take a look, definitely need to be fixed on Centrifuge side. Most probably fixing Eagle is required here. As a temporary workaround maybe you can run Centrifuge with custom RegistererGatherer - see https://pkg.go.dev/github.com/centrifugal/centrifuge#MetricsConfig but it will result into all Centrifuge metrics reported to a different registry of Prometheus so may be not exported for now easily (maybe it's possible to tell Prometheus to use two different RegistererGatherer to collect metrics from in your Prometheus metrics handler).

@FZambia Thanks, I'm currently using prometheus.NewRegistry() to initialize an unrelated RegistererGatherer, but this is not a long-term solution

@FZambia
Copy link
Member

FZambia commented Jan 21, 2025

Should work without panic with https://github.com/centrifugal/centrifuge/releases/tag/v0.34.1

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 a pull request may close this issue.

2 participants