Create a simple Ruby on Rails application that exposes an API for retrieving weather data for a given city. The application should also include integration with OpenTelemetry for monitoring purposes. Additionally, write a brief documentation that explains how the API works and potential use cases for this API.
- Design and implement a Ruby on Rails application with the following features:
- An endpoint to retrieve weather data for a given city (e.g., temperature, humidity, wind speed)
- Utilize a public weather API, such as OpenWeatherMap, to fetch the weather data
- Ensure that your code follows the Single Responsibility Principle.
Please keep in mind, although this app itself is simple, write it as if it will grow in complexity in the future.
-
Integrate OpenTelemetry for monitoring-in-code:
- Set up OpenTelemetry to collect metrics and traces from the application
- Implement custom metrics and traces for key performance indicators (e.g., weather data requests per minute, average response time)
-
Write clear and concise documentation that includes:
- An overview of the application, its purpose, and potential use cases
- API endpoint, request/response formats, and examples of usage
- A simple guide on how to set up and run the application locally
Make code comments which clearly explain your design decisions.
- Demonstrate strong ability to learn, document, and articulate customer organization's needs by providing recommendations on how the API could be improved or extended to cater to a broader audience.
The candidate's take-home project will be evaluated based on the following criteria:
- Functionality: The application should work as intended, with the API endpoint functional and correctly returning weather data.
- Code quality: The code should be clean, well-organized, and follow best practices for Ruby on Rails development.
- Monitoring integration: The application should successfully integrate OpenTelemetry for monitoring-in-code, with custom metrics and traces as required.
- Documentation: The documentation should be clear, concise, and informative, demonstrating the candidate's ability to communicate effectively with both internal and external stakeholders.
- Suggestions for improvement: The candidate should provide thoughtful recommendations for how the API could be improved or extended to cater to a broader audience.