-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
📢 New MegaLinter v8 release, with Grafana ! #3913
Comments
When running Megalinter GitHub workflow, should there be output from the API_REPORTER reporter showing a message that logs were sent to Grafana? I have followed the API Reporter(Grafana) guide but Grafana is not showing any log or metric information received when run as a GitHub action. I get "No data" in the Grafana dashboards provided by Megalinter. The Grafana dashboard home pages reports 0 (zero) for Metrics and Logs. Am I unsure where this is failing as I do not see logs in the Megalinter output, even with I had created Repository secrets as I want to use Grafana dashboards for multiple repositories. I will check if that is the cause of the fail (but I dont see errors in the log) Example project created from the MegaLinter docs (public GitHub repo):
|
@practicalli-johnny it seems that nothing is sent to Grafana :( But... I think your API_REPORTER is not active, otherwise you would see such logs (source: https://github.com/oxsecurity/megalinter/actions/runs/10949911462/job/30404111491 ) After checking your config & logs... it looks good, so I must be missing something... I investigate :) |
* Add debug traces to investigate reporters activation Related to #3913 * Fix * fix * [MegaLinter] Apply linters fixes --------- Co-authored-by: nvuillam <[email protected]>
I added some debug outputs to help investigate @practicalli-johnny please could you try with beta version and |
Added LOG_LEVEL: DEBUG to the megalinter.yaml file and updated the Megalinter GitHub workflow to use @beta uses: oxsecurity/megalinter/flavors/java@beta GitHub actions workflow output: no data in Grafana dashboard. I will try the main megalinter image rather than the java flavour. |
It should work the same with any flavor :'( |
@practicalli-johnny I don't understand why I can't find any [Reporters] in the log :'( Please can you try to add the LOG_LEVEL: true directly in the Github workflow variables and not the .mega-linter.yml ? |
Updated LOG_LEVEL to be only in the GitHub Workflow yaml file. There is a log entry now about API REPORTER, but no data in Grafana :( - Edit: I only looked at the Grafana home page (which reports zero logs) and not the dashboards which were probably working - the dashboards do now work.
|
@practicalli-johnny according to the logs, the data is sent to Grafana :) Please can you check is Explore -> Logs for events with source "MegaLinter" ? |
Megalinter sent logs to Grafana at 9:50 this morning, so when I added The dashboards are now working too: The home page of Grafana suggests the logs arent working, perhaps its because the number of logs is too low and being rounded down (or they are not looking at the right log source). Later today I will change back to the java flavour of megalinter and confirm if logs are still being sent. Thanks for all your help with diagnosing this issue. I will configure all the other Practicalli open source GitHub projects and experiment with the Grafana dashboards. I'll write up how I am using this all in a blog post later in the month. Thanks again. |
@practicalli-johnny great feedback, many thanks :) |
@practicalli-johnny Seing this one I wonder if you didn't select the wrong datasource when matching dashboards & sources at the import Maybe selected prometheus instead of loki, or the contrary ? |
Hi, Tell me if you'd prefer a new specific issue. My findings so far: using The grafana log, with the only try without flavors sending data: The
I really don't understand why it is not working when using a flavor and why the solution you found doesn't work for me. I'm available if you have questions or need to test more things. |
@nabondance (coucou Nathan je t'ai reconnu 😄 ) > Please can you try with beta version of a flavor ? |
(Bravo ! 😁) Tried with the step:
The log with as much debug as possible: I understand the goal and how to use the flavors, sadly I don't understand how they are generated, I can't help to find if it is related to the flavors themselves Edit. |
I recreated both dashboards and they seem correct now. It seems there is an issue with the api reporter when using a megalinter flavor (java and documentation tested) Using megalinter without a flavor publishes data to Grafana for both v8.0.0 and beta versions. Using the Java flavor of megalinter, v8.0.0 or beta, the megalinter log does not include messages about the API reporter connecting. The "Latest run" value in the DASH - ML Errors & Elapse dashboard does not show a date timestamp corresponding to a GitHub workflow run when the java flavour is used. I also get Annotation warnings with the java flavour, which I do not get with the megalinter standard image The documentation flavor (v8.0.0 or beta) seems to have the same issues as java flavor - no api message, no updated latest run and annotation warnings. I havent tried any of these images via Docker as yet, only via a GitHub workflow. |
One thing that seems easy to get tripped up on is that some linters will show "No Data" in the dashboard even if logs were pushed to Grafana. Looking at the first few sections of the "Errors & Elapse" dashboard can easily lead people to thinking that no logs have been pushed, if they dont scroll down many pages to a linter that does have data. When only running a very small amount of linters it is easy to believe that no logs are being passed. If the linters that have no data are collapsed then it is easier to see that new logs have been published on the "Errors & Elapse" dashboard. I typically remove the "All" filter from the dashboard and add the few specific linter names I want to see. This makes it very easy to see new logs have been published, along with the time stamp. Would a new dashboard be needed for each flavor? Or does the dashboard parse and display only the linters available from the last published logs? So if a specific flavor of megalinter is used, will it only show the linters on the "Errors & Elipse" dashboard? It would be useful to share how the dashboards have currently been put together, as at first glance it not obvious what all the config means (I can make a few rough guesses). Ideally I'd like to define a dashboard that only has the linters I am most interested in, to avoid having to update filters or do lots of scrolling each time. I have only been able to make API_REPORTER work with the default Megalinter version (flavor) which means disabling more specific linter in the config, e.g. Repository has more linters in the default Megalinter version) |
Dashboard update: Now the Grafana trial has expired and logs are only retained for 14 days, the dashboard is only showing the specific linters that have been run (and all have data to show). This makes the provided megalinter Errors & Elapsed dashboard much simpler to understand, especially as I have only been pushing an API_REPORT from the one repository. I wonder if there is additional configuration on the Megalinter dashboards to be scoped within a specific Git repository? |
FYI i'm still struggling to find why flavors do not call ApiReporter 😨 |
I was checking the Changelog to check the version of the various linters, and while the Changelog says that
|
@nabondance @practicalli-johnny > now Grafana stats should be ok with latest v8.1.0, please can you confirm ? :) @vihangm > should be ok now too for golanci-lint version :) |
@nvuillam it is working with the javascript flavor in v8.1.0 |
Yes, I can confirm the API_REPORTER is working with the Megalinter v8.1.0 Documentation flavor. I will try with the Java flavor later, but I'm confident it will work okay. Thanks for all the effort in bringing the API_REPORTER to Megalinter. I'll spend some time this month wiring up my repositories and experimenting with the Grafana dashboards. Thanks again. |
Thank you all for your feedback :) Can't wait to read your new Grafana dashboards suggestions 😇 |
Run
npx mega-linter-runner@latest --upgrade
to upgrade to MegaLinter v8 :)You can see release notes
If you are a Grafana expert and would like to help by configuring some great Dashboards using MegaLinter Prometheus Metrics and Loki logs, please contact me :)
If you are not a Grafana expert but have ideas about some relevant Dashboards we could create, please post an issue :)
If you see any problem with MegaLinter v8, please post here so it will be processed in priority :)
Video presentation:
LinkedIn post to like & share :)
The text was updated successfully, but these errors were encountered: