8000 🚀 [Feature]: Add option to disable metrics in otelfiber · Issue #1290 · gofiber/contrib · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🚀 [Feature]: Add option to disable metrics in otelfiber #1290

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

Open
3 tasks done
fathilarham opened this issue May 5, 2025 · 1 comment
Open
3 tasks done

🚀 [Feature]: Add option to disable metrics in otelfiber #1290

fathilarham opened this issue May 5, 2025 · 1 comment
Labels

Comments

@fathilarham
Copy link
Contributor
fathilarham commented May 5, 2025

Feature Description

Currently, the only way to disable metrics in otelfiber is to avoid setting a global metrics provider. This method removes all metrics collection for the entire service, not just the metrics from otelfiber. While this works, it’s not an ideal solution for users who want to selectively disable only the otelfiber metrics while keeping other metrics providers active for the service.

Proposed Solution

  • Introduce a new configuration option (e.g., WithoutMetrics/WithDisableMetrics: true/false) in otelfiber.Config that will control whether the middleware collects and exposes metrics.
  • If WithoutMetrics is set to true, otelfiber will not expose any metrics while still allowing other metrics providers to function as expected.

Additional Context (optional)

No response

Code Snippet (optional)

package main

import "github.com/gofiber/contrib/%package%"

func main() {
  app := fiber.New()
  app.Use(
      otelfiber.Middleware(
	    otelfiber.WithoutMetrics(true),
      ),
  )
}

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.
@fathilarham
Copy link
Contributor Author

@gaby,
I've created the pull request #1293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0