Code Monkey home page Code Monkey logo

Comments (2)

loicmathieu avatar loicmathieu commented on June 12, 2024 1

You can already access the thread pool size, for ex using the JDBC runner you will have these information:

# HELP executor_active_threads The approximate number of threads that are actively executing tasks
# TYPE executor_active_threads gauge
executor_active_threads{name="jdbc-queue-LogEntry",} 0.0
executor_active_threads{name="io",} 0.0
executor_active_threads{name="scheduled",} 0.0
executor_active_threads{name="jdbc-queue-WorkerTriggerResult",} 1.0
executor_active_threads{name="jdbc-queue-ExecutionKilled",} 2.0
executor_active_threads{name="jdbc-queue-Trigger",} 0.0
executor_active_threads{name="jdbc-queue-Execution",} 2.0
executor_active_threads{name="jdbc-queue-WorkerJob",} 1.0
executor_active_threads{name="jdbc-queue-WorkerTaskResult",} 1.0
executor_active_threads{name="blocking",} 0.0
executor_active_threads{name="jdbc-queue-MetricEntry",} 0.0
executor_active_threads{name="jdbc-queue-Flow",} 2.0
executor_active_threads{name="jdbc-queue-SubflowExecutionResult",} 1.0
executor_active_threads{name="standalone-runner",} 0.0
executor_active_threads{name="worker",} 0.0
# HELP executor_pool_max_threads The maximum allowed number of threads in the pool
# TYPE executor_pool_max_threads gauge
executor_pool_max_threads{name="jdbc-queue-LogEntry",} 2.147483647E9
executor_pool_max_threads{name="io",} 2.147483647E9
executor_pool_max_threads{name="scheduled",} 2.147483647E9
executor_pool_max_threads{name="jdbc-queue-WorkerTriggerResult",} 2.147483647E9
executor_pool_max_threads{name="jdbc-queue-ExecutionKilled",} 2.147483647E9
executor_pool_max_threads{name="jdbc-queue-Trigger",} 2.147483647E9
executor_pool_max_threads{name="jdbc-queue-Execution",} 2.147483647E9
executor_pool_max_threads{name="jdbc-queue-WorkerJob",} 2.147483647E9
executor_pool_max_threads{name="jdbc-queue-WorkerTaskResult",} 2.147483647E9
executor_pool_max_threads{name="blocking",} 2.147483647E9
executor_pool_max_threads{name="jdbc-queue-MetricEntry",} 2.147483647E9
executor_pool_max_threads{name="jdbc-queue-Flow",} 2.147483647E9
executor_pool_max_threads{name="jdbc-queue-SubflowExecutionResult",} 2.147483647E9
executor_pool_max_threads{name="standalone-runner",} 2.147483647E9
executor_pool_max_threads{name="worker",} 128.0
# HELP executor_pool_core_threads The core number of threads for the pool
# TYPE executor_pool_core_threads gauge
executor_pool_core_threads{name="jdbc-queue-LogEntry",} 0.0
executor_pool_core_threads{name="io",} 0.0
executor_pool_core_threads{name="scheduled",} 1.0
executor_pool_core_threads{name="jdbc-queue-WorkerTriggerResult",} 0.0
executor_pool_core_threads{name="jdbc-queue-ExecutionKilled",} 0.0
executor_pool_core_threads{name="jdbc-queue-Trigger",} 0.0
executor_pool_core_threads{name="jdbc-queue-Execution",} 0.0
executor_pool_core_threads{name="jdbc-queue-WorkerJob",} 0.0
executor_pool_core_threads{name="jdbc-queue-WorkerTaskResult",} 0.0
executor_pool_core_threads{name="blocking",} 0.0
executor_pool_core_threads{name="jdbc-queue-MetricEntry",} 0.0
executor_pool_core_threads{name="jdbc-queue-Flow",} 0.0
executor_pool_core_threads{name="jdbc-queue-SubflowExecutionResult",} 0.0
executor_pool_core_threads{name="standalone-runner",} 0.0
executor_pool_core_threads{name="worker",} 128.0
# HELP executor_pool_size_threads The current number of threads in the pool
# TYPE executor_pool_size_threads gauge
executor_pool_size_threads{name="jdbc-queue-LogEntry",} 0.0
executor_pool_size_threads{name="io",} 0.0
executor_pool_size_threads{name="scheduled",} 1.0
executor_pool_size_threads{name="jdbc-queue-WorkerTriggerResult",} 1.0
executor_pool_size_threads{name="jdbc-queue-ExecutionKilled",} 2.0
executor_pool_size_threads{name="jdbc-queue-Trigger",} 0.0
executor_pool_size_threads{name="jdbc-queue-Execution",} 2.0
executor_pool_size_threads{name="jdbc-queue-WorkerJob",} 1.0
executor_pool_size_threads{name="jdbc-queue-WorkerTaskResult",} 1.0
executor_pool_size_threads{name="blocking",} 0.0
executor_pool_size_threads{name="jdbc-queue-MetricEntry",} 0.0
executor_pool_size_threads{name="jdbc-queue-Flow",} 2.0
executor_pool_size_threads{name="jdbc-queue-SubflowExecutionResult",} 1.0
executor_pool_size_threads{name="standalone-runner",} 2.0
executor_pool_size_threads{name="worker",} 0.0

So to monitor the worker usage an decided to scale up or down you can use the following metrics (and configure a Kubernetes horizontal pod autoscaling for ex):

executor_active_threads{name="worker",} 0.0
executor_pool_max_threads{name="worker",} 128.0

from kestra.

loicmathieu avatar loicmathieu commented on June 12, 2024

To provide metrics for RUNNING/CREATED executions we would need to query the database each time the metrics endpoint is called by the external metric system. Depending on the metric system configuration and the database load it can be costly.

I'm not against providing it but in this case I would disable it by default.

from kestra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.