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: add option metrics.addr for ipv6 support #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ma27
Copy link

@Ma27 Ma27 commented Feb 8, 2024

prometheus_client supports IPv6 addresses for a while now[1]. This isn't used here however because the default 0.0.0.0 is used. Added an option metrics.addr that makes this configurable.

Tested with mautrix-telegram.

[1] prometheus/client_python@39d2360

Ma27 added a commit to Ma27/mautrix-telegram that referenced this pull request Feb 8, 2024
`prometheus_client` supports IPv6 addresses for a while now[1]. This
isn't used here however because the default 0.0.0.0 is used. Added an
option `metrics.addr` that makes this configurable.

[1] prometheus/client_python@39d2360
@Ma27
Copy link
Author

Ma27 commented Feb 10, 2024

cc @tulir :)

@@ -188,6 +188,7 @@ def start_prometheus(self) -> None:
try:
enabled = self.config["metrics.enabled"]
listen_port = self.config["metrics.listen_port"]
addr = self.config.get("metrics.addr", "0.0.0.0")
Copy link
Member

Choose a reason for hiding this comment

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

Since we are using these values here, I think we need to have corresponding copys in mautrix/bridge/config.py. See https://github.com/mautrix/twitter/blob/master/mautrix_twitter/config.py#L48-L49 for an example of what it should look like.

Copy link
Author

Choose a reason for hiding this comment

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

oh right, didn't notice because I think I don't use that part.
Will update accordingly later:)

Copy link
Author

Choose a reason for hiding this comment

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

@sumnerevans OK, I confused a few things when I read your comment, apologies!
I already did that for the bridge I've been using, namely mautrix/telegram#955. In fact, I'm already using that productively, so this code is not untested :)
Do you want me to file fixup PRs for the other python bridges or is it OK for you to update when bumping mautrix/python there? If so, are all bridges to update in this org?

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Not sure what should be done here, @tulir ?

Copy link
Author

Choose a reason for hiding this comment

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

ping @tulir

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

Successfully merging this pull request may close these issues.

2 participants