Contributing to OpenTelemetry SDK for Flutter
May 27, 2025 ยท View on GitHub
Thank you for your interest in contributing to the OpenTelemetry SDK for Flutter! This document provides guidelines and instructions for contributing to this project.
Code of Conduct
This project follows the CNCF Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
Ways to Contribute
There are many ways to contribute to this project:
- Code contributions: Implement new features or fix bugs
- Documentation: Improve or extend documentation
- Bug reports: Submit detailed bug reports
- Feature requests: Suggest new features or improvements
- Reviews: Review pull requests from other contributors
- Discussions: Participate in discussions and help shape the project
Getting Started
Setting Up Development Environment
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/flutterrific_opentelemetry.git cd flutterrific_opentelemetry - Add the upstream repository:
git remote add upstream https://github.com/MindfulSoftwareLLC/flutterrific_opentelemetry.git - Install dependencies:
flutter pub get
Development Workflow
- Create a new branch for your work:
git checkout -b feature/your-feature-name - Make your changes
- Run tests to ensure everything works:
flutter test - Run the analyzer:
flutter analyze - Format your code:
dart format . - Commit your changes with a descriptive commit message:
git commit -m "Add feature: description of your changes" - Push your branch to your fork:
git push origin feature/your-feature-name - Create a pull request to the main repository
Pull Request Process
- Update the README.md or other documentation with details of changes if appropriate
- Update the CHANGELOG.md with a description of your changes
- The PR should work with the latest version of Flutter and be compatible with all supported platforms (Android, iOS, Web)
- The PR will be merged once it receives approval from project maintainers
Coding Standards
Code Style
This project follows the official Dart style guide and uses the standard Dart formatting tool (dart format).
Linting Rules
We use the recommended Flutter linting rules. Always run flutter analyze before submitting a PR to ensure your code follows these rules.
Testing
All new code should be covered by tests. We use the flutter_test package for writing and running tests.
- All tests should be in the
testdirectory - Test files should end with
_test.dart - Run tests with
flutter test - Widget tests should use
flutter_testtesting utilities - Unit tests for non-Flutter code should use the
testpackage
Documentation
- All public APIs must have dartdoc comments
- Comments should explain "why" not just "what"
- Example usage is encouraged for complex functionality
- Flutter-specific documentation should include widget usage examples
Flutter-Specific Considerations
Platform Support
When contributing to this Flutter SDK:
- Consider all supported platforms: Android, iOS, Web, Desktop
- Test on multiple platforms when possible
- Handle platform-specific limitations gracefully
- Use conditional imports when necessary for platform-specific code
Widget Integration
- Follow Flutter's widget composition patterns
- Use Flutter's lifecycle methods appropriately
- Consider performance implications for widget rebuilds
- Provide easy-to-use widget extensions when appropriate
Navigation Integration
- Support multiple navigation patterns (Navigator 1.0, Navigator 2.0, third-party routers)
- Make navigation integration optional and configurable
- Document integration patterns for popular routing packages
Specification Compliance
Since this project implements the OpenTelemetry specification for Flutter:
- All implementations must strictly follow the OpenTelemetry specification
- Any deviations from the specification must be clearly documented and justified
- Follow the semantic conventions defined by OpenTelemetry
- Ensure compatibility with the OpenTelemetry Collector
- Support standard OTLP exporters
Commit Messages
Write clear, concise commit messages that explain the changes you've made. Follow these guidelines:
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
Issue Process
Reporting Bugs
When reporting bugs, please include:
- A clear, descriptive title
- A detailed description of the issue
- Steps to reproduce the problem
- Expected behavior and actual behavior
- Your environment (Flutter version, Dart version, platform, device info, etc.)
- If possible, a minimal code example that demonstrates the issue
- Console logs or error messages
Feature Requests
Feature requests are welcome. Please provide:
- A clear, descriptive title
- A detailed description of the proposed feature
- An explanation of why this feature would be useful for Flutter developers
- Example use cases
- If possible, outline how the feature might be implemented
- Consider how the feature would work across different Flutter platforms
Release Process
The release process is handled by project maintainers. If you're a maintainer, follow these steps:
- Update version in
pubspec.yaml - Update CHANGELOG.md with all changes since the last release
- Create a release commit
- Tag the release commit with the version number (e.g.,
v0.3.0) - Push the commit and tag to the repository
- Publish to pub.dev:
flutter pub publish
Communication
- GitHub Issues: For bug reports, feature requests, and general discussions
- Pull Requests: For code contributions and reviews
Dependencies and Compatibility
- Keep dependencies minimal and well-justified
- Ensure compatibility with supported Flutter versions
- Test with the latest stable and beta Flutter releases
- Consider the impact of dependency updates on users
License
By contributing to this project, you agree that your contributions will be licensed under the project's Apache 2.0 License.
Questions?
If you have any questions about contributing, please open an issue or contact the project maintainers directly.
Thank you for contributing to the OpenTelemetry SDK for Flutter!