Skip to content
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

Enhancement in plugin configuration and bug fixes #61

Merged
merged 6 commits into from
Aug 8, 2024

Conversation

mahendrapaipuri
Copy link
Owner

@mahendrapaipuri mahendrapaipuri commented Aug 8, 2024

Features:

  • Now the plugin app can be configured using either file based provisioning or env vars or mix of both. Env vars will always overwrite the options set in the file. All env vars start with prefix GF_REPORTER_PLUGIN_* to avoid clashing with env vars from Grafana and other plugins.
  • theme config option has been added to control the theme of the panels in the report.

Bugfix:

Seems like there is a bug in the worker pool implementation. Upon finishing an API request to report endpoint, the context channel is being closed and thus the loop goes into busy loop due to continue statement. This is hogging up the CPU a lot. To reproduce, spin up docker compose developement env, make a API request to report end point and once the report has been generated, watch the CPU usage of plugin process.

Not sure why the context is being closed here. So the fix was to return upon the closure of context channel and use background context for the workers. When plugin app instance is being disposed, we cancel the context in dispose receiver safely releasing the resources owned by worker pool.

@jkroepke Was it a typo to have continue statement there?

CI:

e2e test matrix has been updated to add more tests with and without remote chrome and service accounts

Docs:

README has been updated

Closes #56

* Plugin can be configured from provisioning file and/or env vars

* Env vars will always have higher precedence and overwrite existing values from file

* New config option theme has been added for report generation

Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com>
* Seems upon finishing API request for report, worker pool is entering into busy loop hogging up CPU. This has been fixed using background context for worker pool and stopping pool once context channel is closed

* We dispose the pool in dispose method safely to ensure that there are no leaks

* Files have been renamed to `pool.go`

Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com>
* Add doc strings and remove unused files

Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com>
Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com>
Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com>
@mahendrapaipuri mahendrapaipuri added documentation Improvements or additions to documentation enhancement New feature or request bugfix labels Aug 8, 2024
@jkroepke
Copy link
Contributor

jkroepke commented Aug 8, 2024

Was it a typo to have continue statement there?

Seems like that. Good catch!

* Overriding chrome entrypoint in e2e TLS tests. Add --ignore-certificate-errors=1 to chromium instance launch command

* Remove test case 10.4.3 from matrix. Currently we are not using cookies to make requests in playwright tests. So this case is of no value

* Generate pdf diff file and add it to artifacts for better debugging experience

* Reports generated by local and remote chrome instances have small pixel offset. So we use separate reports for comparison depending on which type of chrome instance we are using in e2e test

Signed-off-by: Mahendra Paipuri <mahendra.paipuri@gmail.com>
@mahendrapaipuri mahendrapaipuri merged commit befb056 into main Aug 8, 2024
5 checks passed
@mahendrapaipuri mahendrapaipuri deleted the config_enhancements branch August 8, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make rendered panel theme configurable
2 participants