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:

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 🙂"
            }
        }
    }