dns_exporter.entrypoint

dns_exporter.entrypoint contains argparse stuff and dns_exporter script entrypoint.

This module is mostly boilerplate code for command-line argument handling and logging.

dns_exporter.entrypoint.configure_logging(args: Namespace) None

Configure the log format and level.

dns_exporter.entrypoint.get_parser() ArgumentParser

Create and return the argparse object.

dns_exporter.entrypoint.initialise_socket_cache(args: Namespace) tuple[SocketCache, Thread | None]

Initialise socket cache and socket cache housekeeping thread.

dns_exporter.entrypoint.main(mockargs: list[str] | None = None) None

Read config and start exporter.

dns_exporter.entrypoint.parse_args(mockargs: list[str] | None = None) tuple[ArgumentParser, Namespace]

Create an argparse monster and parse mockargs or sys.argv[1:].

dns_exporter.entrypoint.signal_handler(sig: int, frame: FrameType | None) None

This signal handler raises KeyboardInterrupt to allow cleanup before exit.