Using dnspython to override the socket resolver
I’ve recently been working on a simple domain monitoring tool that includes a module for retrieving TLS certificate data. Part of the tools functionality is that the user can specify the DNS server(s) handling resolution of the domains to be monitored. Using the dnspython library, the tool can set the desired resolvers, make queries, and avoid falling through to the system resolver. However, the module for querying TLS certificates makes use of the ssl std lib which uses the socket library. socket lib relies on the getaddrinfo or gethostbyname methods which are dependent on the system hosts file and resolver configuration. There is no native method in socket to override the resolver which would invalidate the intended function of my tool. ...
OpenTelemetry - Painlessly Ship Docker Container Logs to OpenObserve
Using the contrib release of the OpenTelemetry Collector (GitHub) container, you can ship the standard JSON Lines logs generated by the Docker engine to OpenObserve using a container in the self-same stack. This approach is not ideal for a serious production or enterprise deployment but will be sufficient if you have a simple self-hosting use case like mine. The Docker engine writes the stdout and stderr logs from containers (i.e. the output of docker logs <container_id/container_name>) to /var/lib/docker/containers. This directory will contain a directory per container, named for the 64-char hexadecimal container ID, and a log file in each subdirectory named <container_id>-json.log. OTEL Collector contrib is needed to get access to the filelog receiver with support for the docker format. ...