Skip to content

Conversation

@f33rx
Copy link
Collaborator

@f33rx f33rx commented Sep 30, 2025

Summary

  • Add multi-stage Dockerfile for containerized deployment
  • Add docker-compose.test.yml with Prometheus for local testing
  • Extract Git metadata (branch, commit, repo) from Jenkins build environment variables
  • Support 4-level folder hierarchy
  • Add jenkins_folder and jenkins_job_name labels to metrics
  • Add repo_name and build_number labels to job duration metrics

Configuration

New flags:

  • --enable-build-env-extraction: Enable Git metadata extraction from build actions
  • --build-history-limit: Number of recent builds to process (default: 10)
  • --listen-address: HTTP server listen address (default: :9506)

Metrics Changes

New labels:

  • jenkins_job_fullname: Full job path including folders (now supports up to 4-level hierarchy)
  • jenkins_folder: Folder path in Jenkins hierarchy
  • jenkins_job_name: Job name without folder path
  • repo_name: Git repository name (when available)
  • build_number: Jenkins build number
  • git_branch: Git branch name
  • git_commit: Git commit SHA

Adds multi-stage Docker build and compose configuration for testing.

Enhances metrics with Git metadata extraction from build environment variables.
Adds repo_name and build_number labels to job duration metrics.
Adds jenkins_folder, jenkins_job_name, and jenkins_job_fullname labels to metrics for granular filtering.
- Add FullName field to capture full hierarchical path from Jenkins API
- Replace hardcoded 2-level parsing with recursive processJobs function
- Extend tree query to support up to 4 levels of folder nesting
- Fallback to constructed path if Jenkins fullName unavailable
- Add Git fields to actionRawResp struct to capture remoteUrls and lastBuiltRevision
- Extract Git metadata directly from hudson.plugins.git.util.BuildData action
- Remove EnvInject API dependency and associated functions
- Add FolderPath() method to return full folder hierarchy
- Update jenkins_folder label to show complete folder path
- Update jenkins_job label to show only leaf job name
- Fix wfapi URL construction to support 4-level paths
- Suppress 404 errors for non-pipeline jobs in stage fetching
@f33rx f33rx requested a review from tjcelaya September 30, 2025 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants