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

Metrics #1199

Open
kzangeli opened this issue Jul 28, 2022 · 0 comments
Open

Metrics #1199

kzangeli opened this issue Jul 28, 2022 · 0 comments
Assignees
Labels

Comments

@kzangeli
Copy link
Collaborator

Prometheus Style Metrics

A very basic implementation is already available, using the external library prometheus-c-client.
However, the library is no good.
The idea is to replace the library for an in-house implementation.

The library is not "ideal" for a number of reasons:

  • Forces MHD to be a shared library (the broker already has it as a static library

  • The source code is no good - lots of calls to malloc and other stuff I don't want the broker to use

  • It's a "black box" and the broker doesn't know when metrics request comes in - all taken care of by the library.
    May sound like a "good thing" but, it's really not. It means the response needs to be 100% prepared always.
    If instead the broker is aware of when metrics request enters, the request can be prepared only when asked for.
    A counter, instead of being an allocated string, updated thousands of times per second, will just be an incrementing integer.
    The string is only prepared when a metrics request enters. Huge performance gains - metrics could be always ON.
    Also, windows in time, like last 5 min or last 100 of something could be implemented without huge performance losses.
    With the library, I would have to push stuff, keep their timestamps and then remove them. That's just too much ...
    All problems are solved by implementing the metrics inside the broker, and not use the prometheus-c-client library.

  • Only if started with -metrics (not needed if in-house - it can be always on, as minor affect on performance)

Counters/Gauges

  • Total number of Requests served
  • Erroneous incoming requests
  • Counters per service? Also per tenant?
  • Total number of Notifications sent
  • Total number of failed notifications
  • Total number of Database Errors
  • Start Time
  • Uptime
  • CPU Load ?
  • Memory consumption ?
  • Array of counters for responses with status code:
    • 200
    • 201
    • 204
    • 207
    • 2xx (sum of all other 200s)
    • 400
    • 404
    • 4xx (sum of all other 400s)
    • 500
    • 501
    • 5xx
@kzangeli kzangeli mentioned this issue Jul 28, 2022
@kzangeli kzangeli self-assigned this Oct 13, 2022
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

1 participant