Metadata-Version: 2.4
Name: secureapp-python-agent
Version: 26.5.0rc5
Summary: Splunk SecureApp OpenTelemetry Extension for Python applications
Author-email: Splunk <support@splunk.com>
License-Expression: LicenseRef-Proprietary
Keywords: observability,opentelemetry,security,monitoring,splunk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opentelemetry-api<1.40,>=1.27.0
Requires-Dist: opentelemetry-sdk<1.40,>=1.27.0
Requires-Dist: opentelemetry-exporter-otlp<1.40,>=1.27.0
Requires-Dist: protobuf>=5.0; python_version >= "3.14"
Provides-Extra: dev
Requires-Dist: pytest>=8.4.1; extra == "dev"
Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
Requires-Dist: pytest-testmon>=2.1.3; extra == "dev"
Requires-Dist: mypy>=1.16.1; extra == "dev"
Requires-Dist: ruff>=0.12.1; extra == "dev"
Requires-Dist: coverage[toml]>=7.0.0; extra == "dev"
Requires-Dist: tox>=4.27.0; extra == "dev"
Requires-Dist: build>=1.2.2.post1; extra == "dev"
Requires-Dist: pip-tools>=7.4.1; extra == "dev"
Requires-Dist: setuptools-scm[toml]>=8.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Provides-Extra: benchmark
Requires-Dist: pytest-benchmark>=4.0.0; extra == "benchmark"
Requires-Dist: memory-profiler>=0.61.0; extra == "benchmark"
Requires-Dist: psutil>=5.9.0; extra == "benchmark"
Requires-Dist: memray>=1.10.0; extra == "benchmark"
Provides-Extra: all
Requires-Dist: secureapp-python-agent[benchmark,dev]; extra == "all"
Dynamic: license-file

# Splunk SecureApp OpenTelemetry Extension

OpenTelemetry Python extension for integrating Splunk SecureApp with OpenTelemetry.
This extension monitors runtime dependencies and reports them via OpenTelemetry logs.


## Installation

```bash
# Install from PyPI
pip install secureapp-python-agent

# Install with OpenTelemetry instrumentation
pip install secureapp-python-agent opentelemetry-distro[otlp]

# Run your application with automatic instrumentation
opentelemetry-instrument python your_app.py

## Configuration

The extension can be configured using environment variables:

| Environment Variable                        | Default | Description                                               |
|---------------------------------------------|---------|-----------------------------------------------------------|
| `SPLUNK_SECUREAPP_AGENT_ENABLED`            | `true`  | Enable or disable the agent completely                    |
| `OTEL_LOGS_EXPORTER`                        | `otlp`  | Log exporter type: `otlp`, `console`, or `none`           |
| `SPLUNK_SECUREAPP_DEPENDENCY_INITIAL_DELAY` | `60.0`  | Initial delay (seconds) before dependency tracking starts |
| `SPLUNK_SECUREAPP_DEPENDENCY_SCAN_INTERVAL` | `86400` | Interval (seconds) between dependency scans (24 hours)    |
| `SPLUNK_SECUREAPP_LOG_LEVEL_INFO            |  NOTSET | Standard Python Log Levels                                |

## Features

### Runtime Dependency Monitoring

The extension monitors third-party Python packages loaded at runtime and reports
them through OpenTelemetry logs with:
- Package name and version
- Import timestamp
- Standard library exclusion for performance optimization
- Low overhead (<10MB memory, <100ms startup impact)

### OpenTelemetry Integration

- Sends dependency data as structured logs via configurable exporters
- Compatible with the OpenTelemetry Collector and Splunk Observability backends
- Lightweight implementation with optimized performance

## Compatibility

### OpenTelemetry Versions

The extension is compatible with OpenTelemetry versions 1.39.x plus

### Python Versions

Supported Python versions:
- Python 3.10
- Python 3.11
- Python 3.12
- Python 3.13
- Python 3.14

## Performance Considerations

The SecureApp agent is designed with minimal performance impact:
- Startup overhead: <100ms
- Memory overhead: <10MB
- Optimizations:
  - Lazy imports for better startup performance
  - Standard library detection to avoid unnecessary scanning
  - Configurable scan intervals
  - Efficient batch processing for telemetry data

