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 an embedded HTTP server to monitor the service #385

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

abompard
Copy link
Member

@abompard abompard commented Jul 11, 2024

This changeset adds an embedded HTTP server to monitor consumers and producers, and get statistics about activity.

Fixes: #380

Copy link
Member

@jeremycline jeremycline left a comment

Choose a reason for hiding this comment

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

I like the feature - a couple notes on the docs and defaults, nothing major though.

monitor its state. You can configure the port in the configuration file under
the ``[monitoring]`` section, with ``address`` and ``port``.
The default address is empty, which means that the monitoring server will
listen on all interfaces. The default port is ``0``, which means that the
Copy link
Member

Choose a reason for hiding this comment

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

This is a slightly surprising behavior since 0 usually means "bind to a free port" (try, for example, nc -l ::1 0 and then see the port with ss -plnt).

Maybe just have the feature off if the section doesn't exist in the configuration and require both values to be set (or pick static defaults) if the section does exit.

docs/user-guide/consuming.rst Show resolved Hide resolved

{
'address': '', # listen on all interfaces
'port': 8070,
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't line up with the documentation elsewhere and the code

)

# Don't check the reject action or the message will be put back in the queue and loop forever
# Don't check a generic processing failure because it stops the consumer instantly and we can't look
Copy link
Member

Choose a reason for hiding this comment

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

I guess it could log the final stats on exit, if available, and then you could inspect the log, but whether you bother with all that is totally up to you.

See the "Monitoring" section in :
https://fedora-messaging.readthedocs.io/en/develop/user-guide/consuming.html

Fixes: fedora-infra#380

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
@mergify mergify bot merged commit eea8092 into fedora-infra:develop Jul 24, 2024
17 checks passed
@abompard abompard deleted the http-monitoring branch July 24, 2024 21:11
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.

Add a way to be probed/monitored by Openshift
3 participants