-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HTML reporter #19
base: master
Are you sure you want to change the base?
Conversation
Hi Martijn, But I have some concerns with this pull request.
See also postmanlabs/newman-reporter-html#255 I could force newman-reporter-html to use newman 5, but I really don't want to. It also looks very stale. Last release is 3 years old. May be, newman-reporter-htmlextra is a better alternative to use? It seems to be better maintained but I did not have a closer look to it.
/htmlreport/:probe internally writes to a file with a static name. Concurrent requests may return the wrong response.
|
Hi Sebastian, thank you for replying to my PR. Please find answers below:
Thanks for the hint, I will take a look at that. I failed to notice the dependency is that old, I will take a look at the one you mentioned. It did work for me for some reason, but that might have been because I tested using the Dockerfile only.
If I understand correctly, that file is written to (overwritten) every time the metrics for that probe are generated and as such will always reflect the last known state from the last scrape from Prometheus. I thought this would be useful, to have that in sync for debugging / reporting purposes. The call to /htmlreport/:probe does not actually generate the report so a concurrency issue should not be a thing, unless of course one would incorrectly configure it and have two probes/collections use the same filename.
Thank you. I thought of it as an auxiliary function to the Prometheus metrics, therefore also my answer to 2. I will have a look at alternatives for the reporter dependency. |
I updated |
Sorry for the delay. I've looked at it again and have a few comments and questions. From my point of view it doesn't work as expected. My expectation would be that /htmlreport/:probe would run a collection and return the associated HTML report instead of the Prometheus metrics. In fact, no collection is executed at all, but the HTML report of the last execution of /probe/ is returned. /htmlreport/:probe doesn't even has a relation to :probe. What is the behavior you actually want? b) would be somewhat analogous to the history in Prometheus Blackbox Exporter. Postman Exporter currently doesn't even has a history. a) would have to be implemented differently. Instead of a fixed file name, a temporary id should be used for each call that generates a report, returns it, and then deletes the file again. |
Thank you for your reply and guidance. Please find my comments/answers below: From my understanding there is a relation between /htmlreport/:probe and :probe, owing to the dedicated link that needs to be set per collection. As an example:
As such, there are two collections, each using their own identifiers (collection1 & collection 2), collection files, environment files and paths for the html report. In that way One optimization there could be to take away that control from the user and instead generate a filename that is based on the collection name without allowing the user to configure it. If you think that could fix the issue, I can take a look at that.
I tend more towards option b, for two reasons:
In my opinion this would not need to be extended to outputting Prometheus metrics for a previously executed collection, as these would be available in Prometheus anyway, having been scraped before. I would love to hear your thoughts on this. |
There is an official HTML reporter for Newman that creates reports in HTML (https://github.com/postmanlabs/newman-reporter-html).
This PR adds newman-reporter-html as a dependency and serves up the generated HTML report(s) at
/htmlreport/<probe>
. Links to the HTML report are also shown on the root page (only if they are enabled in the probeConfiguration).To enable HTML report for a collection,
options.reporter.html.export
andoptions.reporters: 'html'
must be set.Example: