Skip to content

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 :)

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

@Ma27 Ma27 closed this May 10, 2025
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