Skip to main content
The Custom provider allows you to bring your own instrumentation image, enabling complete control over observability implementation for specialized requirements, legacy integrations, or proprietary solutions.

Configuration

apiVersion: openlit.io/v1alpha1
kind: AutoInstrumentation
metadata:
  name: custom-instrumentation
spec:
  selector:
    matchLabels:
      custom.instrument: "true"
  python:
    instrumentation:
      provider: "custom"
      customInitImage: "my-registry.com/custom-instrumentation:v1.0.0"
  otlp:
    endpoint: "http://openlit:4318"

Provider Specific Features

The Custom provider offers maximum flexibility for specialized observability needs:

Custom Image Requirements

Your custom instrumentation image must include:
# Example custom instrumentation Dockerfile
FROM python:3.11-slim

# Install your custom instrumentation packages
COPY requirements.txt /tmp/
RUN pip install -r /tmp/requirements.txt

# Copy your custom instrumentation logic
COPY sitecustomize.py /usr/local/lib/python3.11/site-packages/
COPY setup-instrumentation.py /

# Set up the instrumentation entry point
ENTRYPOINT ["python", "/setup-instrumentation.py"]

When to Use Custom Provider

Use Cases:
  • Legacy System Integration: Integrate with existing proprietary observability tools
  • Custom Business Metrics: Collect domain-specific metrics not covered by standard providers
  • Compliance Requirements: Meet specific regulatory or security requirements
  • Research & Development: Implement experimental observability features
  • Multi-vendor Strategy: Combine multiple observability solutions

Base OpenTelemetry Support

The custom provider includes basic OpenTelemetry setup: Features:
  • Standard OTLP exporter configuration
  • Support for both HTTP and gRPC endpoints
  • Environment variable-based configuration
  • Fallback OpenTelemetry setup if custom logic fails

Environment Variables

VariableDescriptionDefault
OTEL_SERVICE_NAMEService name for tracing"custom-app"
OTEL_EXPORTER_OTLP_ENDPOINTOTLP endpoint (standard)Required
CUSTOM_PACKAGESCustom packages installed by setup scriptFrom customPackages