Skip to content

Conversation

@simonswine
Copy link
Contributor

@simonswine simonswine commented Oct 29, 2025

Add shell-based implementation for static-exporter using busybox as a lightweight alternative to the Apache web server implementation.

The new implementation addresses dependency management concerns by providing a distroless container option that runs as non-root and includes built-in health checks.

Changes

  • Added shell-based exporter option: New shell_exporter=true parameter enables busybox implementation
  • Automatic image selection: Uses gcr.io/distroless/static-debian12:debug for shell mode vs httpd:2.4-alpine for Apache
  • Embedded HTTP server: Pure bash implementation that serves /metrics and /health endpoints using netcat
  • Security improvements: Non-root execution (uid/gid 65532) with proper security context
  • Health checks: Added readiness probe for the shell implementation
  • Updated documentation: README now explains both implementations and their use cases

 Add shell-based implementation for static-exporter using busybox as a lightweight alternative to the Apache web server implementation.

  The new implementation addresses dependency management concerns by providing a distroless container option that runs as non-root and includes built-in health checks.

  Changes

  - Added shell-based exporter option: New shell_exporter=true parameter enables busybox implementation
  - Automatic image selection: Uses gcr.io/distroless/static-debian12:debug for shell mode vs httpd:2.4-alpine for Apache
  - Embedded HTTP server: Pure bash implementation that serves /metrics and /health endpoints using netcat
  - Security improvements: Non-root execution (uid/gid 65532) with proper security context
  - Health checks: Added readiness probe for the shell implementation
  - Updated documentation: README now explains both implementations and their use cases
@simonswine simonswine requested a review from Copilot October 29, 2025 14:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds an alternative shell-based implementation for the static-exporter using a distroless image and netcat-based HTTP server instead of Apache httpd. This provides a lighter, more secure option with fewer dependencies.

  • Added shell_exporter parameter to enable a busybox/shell-based HTTP server implementation
  • Implemented custom HTTP request handler in shell script to serve metrics and health check endpoints
  • Updated deployment configuration to support both Apache and shell-based variants with appropriate security contexts and health checks

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
static-exporter/main.libsonnet Added shell_exporter parameter and conditional logic to support both Apache httpd and shell-based implementations with appropriate configurations
static-exporter/README.md Added documentation for the new shell-based implementation option and fixed trailing whitespace

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

simonswine and others added 2 commits October 30, 2025 08:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

1 participant