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

Ipv6 #59

Closed
wants to merge 2 commits into from
Closed

Ipv6 #59

wants to merge 2 commits into from

Conversation

braedon
Copy link
Owner

@braedon braedon commented Feb 9, 2020

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.

Copy link

@Universal-Omega Universal-Omega left a 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

Choose a reason for hiding this comment

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

Suggested change
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

Choose a reason for hiding this comment

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

Suggested change
_ThreadingSimpleServer.address_family = socket.AF_INET6
ThreadingWSGIServer.address_family = socket.AF_INET6

Universal-Omega added a commit to miraheze/puppet that referenced this pull request Sep 8, 2022
I have applied changes (braedon/prometheus-es-exporter#59) locally to es131 in order to support this.
Universal-Omega added a commit to miraheze/puppet that referenced this pull request Sep 8, 2022
I have applied changes (braedon/prometheus-es-exporter#59) locally to
es131 in order to support this.
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.

2 participants