A Python package for monitoring and observability in Apache Spark applications
Project description
ScholarSparkObservability
A Python package for monitoring and observability in Apache Spark applications.
Installation
You can install the package using pip:
pip install scholarSparkObservability
Or using Poetry:
poetry add scholarSparkObservability
Usage
Here's a simple example of how to use the package:
from scholarSparkObservability import ScholarSparkObservability
client = ScholarSparkObservability()
result = client.example_method()
print(result)
Features
Features
OpenTelemetry Integration
- Full OpenTelemetry support for distributed tracing and metrics collection
- Configurable exporters for different observability backends (e.g., Jaeger, Zipkin)
- Automatic context propagation across Spark jobs and stages
Comprehensive Monitoring
- Real-time metrics collection for Spark executors and tasks
- Custom span creation for detailed performance tracking
- Exception tracking and error reporting with detailed attributes
- Resource utilization metrics (CPU, memory, I/O)
Flexible Configuration
- Singleton pattern for consistent telemetry setup across your application
- Environment-aware configuration (production, staging, development)
- Customizable export intervals and batch processing
- Debug mode for detailed logging and troubleshooting
Enterprise-Ready
- Low-overhead implementation suitable for production workloads
- Batch span processing for efficient telemetry data export
- Support for multiple exporters and monitoring backends
- Robust error handling and logging capabilities
Easy Integration
- Simple API for creating spans and recording metrics
- Automatic service name and version tracking
- Built-in support for custom attributes and tags
- Seamless integration with existing Spark applications
Development
To contribute to this project:
- Clone the repository:
git clone https://github.com/pouyaardehkhani/ScholarSparkObservability.git
cd ScholarSparkObservability
- Install dependencies:
# Using poetry (recommended)
poetry install
# Using pip
pip install -r requirements.txt
- Run tests:
# Using poetry
poetry run pytest
# Using pytest directly
pytest tests/
- Set up pre-commit hooks:
pre-commit install
- Create a new branch for your feature:
git checkout -b feature/your-feature-name
Development Guidelines
- Follow PEP 8 style guidelines
- Write tests for new features
- Update documentation as needed
- Add type hints to all new functions
- Ensure all tests pass before submitting PR
Building Documentation
# Generate documentation
poetry run sphinx-build -b html docs/source docs/build
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Authors
Pouya Ataei- Initial work
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scholar_spark_observability-0.7.1.tar.gz.
File metadata
- Download URL: scholar_spark_observability-0.7.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4539d6d69d5a8174eb60bd00eb981a7535c57abd2f8d7696db6fccd097a036a1
|
|
| MD5 |
14b8f21b545a061fd93dba9699e56041
|
|
| BLAKE2b-256 |
90096010a53ce2fafd8831c005d0b834ee592904be85fbff4265263684f2ac5a
|
File details
Details for the file scholar_spark_observability-0.7.1-py3-none-any.whl.
File metadata
- Download URL: scholar_spark_observability-0.7.1-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
155a1e408f46876a200ac3293c7157549e50a92bbe84b48d8a5419b12899737a
|
|
| MD5 |
25365498a237d6c0c450d6962b37dfd1
|
|
| BLAKE2b-256 |
ef5af669fa202161d0089f58fcd2897b8eda40dc64ea3c97946880dd45bcc884
|