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

Monitoring bug fixes and enhancements #239

Merged
merged 6 commits into from
Dec 26, 2024

Conversation

refflinghaus
Copy link
Contributor

Bugfix: Remove TaskSchedulingAutoConfiguration.class from the exclude list to ensure that the scheduler for writing metrics is also started.
Introduce a new property: metrics.write.interval. This allows you to configure the invocation interval for writing metrics.
Update the documentation accordingly:
image
image

New metrics added:

# TYPE application counter
# HELP application Information about the current project version and name
application_total{name="nvd",version="7.1.0"} 1.0
application_created{name="nvd",version="7.1.0"} 1734819109.346
# TYPE cve_counter gauge
# HELP cve_counter Total number of cached cve's
cve_counter 243324.0
# TYPE cve_load_counter gauge
# HELP cve_load_counter Total number of loaded cve's
cve_load_counter 1.0

Introduced Prometheus counters for tracking application version and CVE counts. Made metrics write interval configurable via application properties. Applied minor refactorings to enhance maintainability and flexibility.
Updated metrics to include application name and version. Enhanced documentation with memory optimization tips and added a new environment variable for metrics configuration. Upgraded Prometheus library to version 1.3.5, and removed redundant code in `CveCommand`.
This change removes the unnecessary import of TaskSchedulingAutoConfiguration, simplifying the configuration and potentially reducing overhead. The scheduling functionality remains intact due to the @EnableScheduling annotation.
Updated the `METRICS_WRITE_INTERVAL` description to specify that the update interval is measured in milliseconds. This improves the clarity of the documentation and avoids potential confusion for users.
Renamed the existing CVE counter to `CVE_LOAD_COUNTER` and introduced a new `CVE_COUNTER` to differentiate between loaded and cached CVE counts. Updated logic to set the new `CVE_COUNTER` value based on cached CVEs.
Consolidate and reformat metric builder initialization to improve code readability and maintain consistency across the Application and CveCommand classes. This change does not modify functionality but simplifies line breaking for better clarity.
@jeremylong jeremylong merged commit 7e207f5 into jeremylong:main Dec 26, 2024
1 check passed
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