-
Notifications
You must be signed in to change notification settings - Fork 90
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
Ipv6 #59
Ipv6 #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this, and it seems to make this work, with one exception (worked after the suggested changes were made).
import sys | ||
|
||
from collections import OrderedDict | ||
from prometheus_client import REGISTRY, start_http_server as orig_start_http_server | ||
from prometheus_client.exposition import _ThreadingSimpleServer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from prometheus_client.exposition import _ThreadingSimpleServer | |
from prometheus_client.exposition import ThreadingWSGIServer |
def start_http_server(port, addr='', registry=REGISTRY, ipv6=False): | ||
# Monkeypatch the server class address family to support IPv6 if needed. | ||
if ipv6: | ||
_ThreadingSimpleServer.address_family = socket.AF_INET6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ThreadingSimpleServer.address_family = socket.AF_INET6 | |
ThreadingWSGIServer.address_family = socket.AF_INET6 |
I have applied changes (braedon/prometheus-es-exporter#59) locally to es131 in order to support this.
I have applied changes (braedon/prometheus-es-exporter#59) locally to es131 in order to support this.
Add support for serving metrics on IPv6 via the
--ipv6
CLI flag.This branch is available as version
0.8.0a1
on pypi and dockerhub for testing purposes.