Python Forum
Dynamic modules and execution
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic modules and execution
#1
Hello, first post, and sorry if the subject is a little vague!

Am new to coding in Python and probably running before I can walk.

I have written a script that parses NGINX log files and outputs certain metrics via the Prometheus library. This script runs as a daemon process and uses the threading and start_http_server modules.

All is working great but now I have been asked to extend the functionality to gather additional metrics and expose them. The problem is that we do not want to create additional network ports but have all metrics delivered by a single one tcp/8080. Plus we want to keep the generation of the different metrics within their own module with all changes being managed through pull requests in GIT.

So the question is this where one would use a package structure and create the modules underneath that; and then import the complete package? How would one then call each of the modules and execute them once they have been imported?

Many thanks in advance.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pythone module for dynamic rule execution hemal07yc 1 8,930 Sep-13-2019, 11:25 AM
Last Post: luoheng
  Modules issue, pip3 download modules only to pyhton3.5.2 not the latest 3.6.1 bmohanraj91 6 8,351 May-25-2017, 08:15 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020