The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Otel agent host metrics monitoring

onMonit: Start node_exporter + otel-contrib before the build, and shut them down after.

Gather agent host metrics and forward them to an OpenTelemetry agent. It uses node_exporter to gather host metrics and otel-contrib to forward them to an OpenTelemetry agent. Node_exporter listens on a tcp port and returns the metrics when queried. Otel-contrib queries the metrics and forwards them to an OpenTelemetry agent.

onMonit depends on the OpenTelemetry plugin being configured and the Export OpenTelemetry configuration as environment variables option being checked. This determines to which OpenTelemetry endpoint the agent metrics are being sent to.

Fields:
  • Node_exporter listen on port (optional, default: 9100): Node exporter will try to listen on this port to expose the host metrics. If another process is already listening, then we try port after port incrementally (so first 9100, 9101, 9102, …) until binding to a port succeeds.
  • Log output (optional, default: false): A boolean flag. When true, any process output from node_exporter and otel-contrib is forwarded to the Job console logs. Useful for troubleshooting node_exporter + otel-contrib.
  • Node_exporter additional options (optional): Any additional options to pass to the node_exporter process execution. This can be used to enable/disable specific collectors. See the node_exporter --help for more information.
  • Otel-contrib additional options (optional): Any additional options to pass to the otel-contrib process execution. This can be used to enable feature-flag gates or override specific values of the configuration. See the otel-contrib --help for more information.

Examples:
The whole pipeline can be monitored using node_exporter + otel-contrib agents by using onMonit as a pipeline option:

pipeline {
    options {
        onMonit()
    }
}
        
If some stages run on other nodes these need to declare the onMonit option as well in order to be monitored:
    stage {
        agent { label "other-node" }
        options {
            onMonit()
        }
    }
        
It's also possible to just monitor a specific block of steps:
    stage {
        steps {
            onMonit() {
                echo "Monitored 🙂"
            }
        }
    }
        

  • debug : boolean (optional)
    A boolean flag (default: false). When true, any process output from node_exporter and otel-contrib is forwarded to the Job console logs. Useful for troubleshooting node_exporter + otel-contrib.
  • neAdditionalOptions : String (optional)
    Additional options to be added to the node_exporter process execution. This can be used to enable/disable specific collectors. See the node_exporter --help for more information.
  • ocAdditionalOptions : String (optional)
    Additional options to be added to the otel-contrib process execution. This can be used to enable feature-flag gates or override specific values of the configuration. See the otel-contrib --help for more information.
  • port : int (optional)
    Ordinal of the port node_exporter will be listening on, if left empty (default) port 9100 is used. If another process is already listening, then we try port after port incrementally (so first 9100, 9101, 9102, …) until binding to a port succeeds.

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.