Skip to content

Conversation

@Kurloc
Copy link
Contributor

@Kurloc Kurloc commented Mar 23, 2025

Features Added:

  • Added the ability to specify report size per report if desired (if not provided defaults to chrome window env var values)
  • Added the ability to send PNGs (great for simple tables -- default report will still be PDF)
  • Added the ability to inline attachments in emails (default is a standard email attachment)
  • Ran rustfmt on the files I touched
  • Addressed simple warnings

This will need a PR in the main O2 repo to address the following items before it use usable by most users:

  • UI update to configure the report
  • DB migration to hold new report configuration options (this may not be needed, I can't remember if the column here is JSON or individual columns)

Kurloc added 2 commits March 23, 2025 14:17
… not provided defaults to chrome window env var values)

 * Added the ability to send PNGs (great for simple tables -- default report will still be PDF)
 * Added the ability to inline attachments in emails (default is a standard email attachment)
 * Ran rustfmt on the files I touched
 * Addressed simple warnings
@Kurloc Kurloc changed the title feat/more-robust-attachements-and-report-options feat/#16/more-robust-attachements-and-report-options Mar 23, 2025
@Kurloc
Copy link
Contributor Author

Kurloc commented Apr 6, 2025

Next week/weekend I will try and setup some testing for this and upload the results.

Been busy at work with releases and at home doing spring cleaning.

@Kurloc Kurloc marked this pull request as draft April 6, 2025 16:35
@hengfeiyang hengfeiyang requested a review from Subhra264 April 7, 2025 09:03
@Kurloc
Copy link
Contributor Author

Kurloc commented Apr 17, 2025

Did some manual QA testing and merged main into my branch, let me know if you're looking for any other testing here

I anticipate a mild amount of churn on meeting your teams code standards, I'm familiar with rest services but this is my first time working with them in Rust.

PDF Attachment (original happy path)
image
image

Inline PNG
image
image

@Kurloc Kurloc marked this pull request as ready for review April 17, 2025 03:07
src/router.rs Outdated
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use actix_web::web::Query;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove this

src/lib.rs Outdated
pub mod config;
pub mod router;

use actix_web::cookie::time::format_description::well_known::iso8601::Config;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this

src/lib.rs Outdated
message::{header::ContentType, MultiPart, SinglePart},
AsyncSmtpTransport, AsyncTransport, Message, Tokio1Executor,
};
use log::Log;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also not used looks like

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catches, I addressed all the warnings I saw with cargo run and cargo build -r which included these unused imports.

I also added some validation on the send report endpoint to raise some helpful errors

Error for inline PDFs (maybe possible on some email servers, but is not possible in gmail today):
image

Error for 0 dashboards in the request:
image

Kurloc added 2 commits April 17, 2025 05:44
- [enhancement] add error handling for inline PDFs
- [enhancement] add error handling for when no dashboards are sent in request for send_report
@Kurloc Kurloc requested a review from Subhra264 April 17, 2025 10:51
@Subhra264
Copy link
Collaborator

Thanks @Kurloc for the pr 🚀. I will raise a feature request in the main openobserve repo for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants