jenkinsci / opentelemetry-agent-metrics-plugin

Monitor Jenkins build agents using Opentelemetry Collector and Node exporter
https://plugins.jenkins.io/opentelemetry-agent-metrics/
MIT License
2 stars 0 forks source link

Global defaults for additional options to the processes launched by onMonit #28

Closed christophe-kamphaus-jemmic closed 9 months ago

christophe-kamphaus-jemmic commented 9 months ago

This PR adds two parameters to the global config of the plugin.

image

With these parameters it's possible to set additional options added to the processes started in the onMonit step. These are global defaults and can be overridden by setting the corresponding parameters in the step.

This fixes #22.

What is not covered of #22 in this PR are the overriding of the otel config template per onMonit step and overriding some parts of this config file. That would require a yaml object merge and is too complex for this PR.

Testing done

I manually installed the plugin in a local test Jenkins instance and verified that a pipeline execution of the onMonit step used the correct process arguments using the following test cases:

I did this once for node_exporter and once for otel-contrib to also verify the parameters correspond to the correct process.

### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [x] Link to relevant issues in GitHub or Jira
- [x] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue