-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #518: Enable job duration through metricshub configuration
* Add enableSelfMonitoring in AgentConfig, ResourceConfiguration and ResourceGroupConfiguration * Transfer the new flag to HostConfiguration in Agent configuration helper * Add the flag to HostConfiguration * Update agent and engine tests * Refactor the method setJobDurationMetricInHostMonitor to include the new flag value check
- Loading branch information
Showing
13 changed files
with
580 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
metricshub-agent/src/test/resources/config/metricshub-enable-self-monitoring-no-config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Enables the debug mode of the core engine (Default: error). Possible values are: all, trace, debug, info, warn, error, or fatal. | ||
loggerLevel: error | ||
|
||
# Sets the number of jobs that MetricsHub can run simultaneously (Default: 20). | ||
jobPoolSize: 20 | ||
|
||
# Sets the debug output directory for all the monitored resources. | ||
outputDirectory: /opt/metricshub/logs | ||
|
||
# Sets the collect period that MetricsHub uses to collects metrics from the monitored resources (Default: 2m). | ||
collectPeriod: 1m | ||
|
||
# Sets the cycle that MetricsHub uses to perform discoveries and detect new components in your monitored environment. By default, MetricsHub runs a discovery after 30 collects. | ||
discoveryCycle: 30 | ||
|
||
# Configures MetricsHub internal alerting system | ||
alertingSystem: | ||
|
||
# Disables MetricsHub's alerts for all the monitored resources (Default: false). | ||
disable: false | ||
|
||
# Overrides the default problem template used to build the alert body for all the monitored resources. | ||
problemTemplate: Problem on ${FQDN} with ${MONITOR_NAME}.${NEWLINE}${NEWLINE}${ALERT_DETAILS}${NEWLINE}${NEWLINE}${FULLREPORT} | ||
|
||
# Forces all the network calls to be executed in sequential order for all the monitored resources - NOT RECOMMENDED (Default: false). | ||
sequential: false | ||
|
||
# Displays the configured host.name attribute in the Host Resource `host.name` attribute instead of the resolved FQDN (Default: false). | ||
resolveHostnameToFqdn: false | ||
|
||
# Resource Groups configuration | ||
resourceGroups: | ||
# Resource Group identifier | ||
sentry-paris: | ||
# Adds additional static attributes to all the resources in the group. | ||
attributes: | ||
site: Sentry-Paris | ||
|
||
# Adds additional static metrics to all the resources in the group. | ||
metrics: | ||
hw.site.carbon_intensity: 230 # in g/kWh | ||
hw.site.electricity_cost: 0.12 # in $/kWh | ||
hw.site.pue: 1.8 # Power Usage Effectiveness. The ideal ratio is 1 | ||
resources: | ||
# Resource configuration | ||
server-1: | ||
# Adds additional static attributes to the resource. | ||
attributes: | ||
host.name: server-1 | ||
host.type: storage | ||
metrics: | ||
hw.host.configured: 1 | ||
protocols: | ||
http: | ||
https: true | ||
port: 443 | ||
username: username | ||
password: password | ||
# Resource configuration | ||
snmp-resources: | ||
# Adds additional static attributes to the resource. | ||
attributes: | ||
host.names: [ server-2, server-3 ] # Deprecated, change to host.name in the future | ||
host.type: storage | ||
metrics: | ||
hw.host.configured: 1 | ||
protocols: | ||
snmp: | ||
timeout: 30s | ||
community: public | ||
version: v2c | ||
# Resource configuration | ||
grafana-service: | ||
attributes: | ||
service.name: Grafana | ||
metrics: | ||
metrics.grafana.configured: 1 | ||
monitors: | ||
grafana: | ||
simple: # simple job. Creates monitors and collects assicated metrics. | ||
sources: | ||
grafanaHealth: | ||
type: http | ||
url: https://hws-demo.sentrysoftware.com/api/health | ||
method: GET | ||
header: "Accept: application/json" | ||
resultContent: body | ||
mapping: | ||
source: ${source::monitors.grafana.simple.sources.grafanaHealth} | ||
attributes: | ||
id: $1 | ||
service.version: $3 | ||
metrics: | ||
grafana.db.state: $2 |
98 changes: 98 additions & 0 deletions
98
metricshub-agent/src/test/resources/config/metricshub-enable-self-monitoring-override.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Enables the debug mode of the core engine (Default: error). Possible values are: all, trace, debug, info, warn, error, or fatal. | ||
loggerLevel: error | ||
|
||
# Sets the number of jobs that MetricsHub can run simultaneously (Default: 20). | ||
jobPoolSize: 20 | ||
|
||
# Sets the debug output directory for all the monitored resources. | ||
outputDirectory: /opt/metricshub/logs | ||
|
||
# Sets the collect period that MetricsHub uses to collects metrics from the monitored resources (Default: 2m). | ||
collectPeriod: 1m | ||
|
||
# Sets the cycle that MetricsHub uses to perform discoveries and detect new components in your monitored environment. By default, MetricsHub runs a discovery after 30 collects. | ||
discoveryCycle: 30 | ||
|
||
# Configures MetricsHub internal alerting system | ||
alertingSystem: | ||
|
||
# Disables MetricsHub's alerts for all the monitored resources (Default: false). | ||
disable: false | ||
|
||
# Overrides the default problem template used to build the alert body for all the monitored resources. | ||
problemTemplate: Problem on ${FQDN} with ${MONITOR_NAME}.${NEWLINE}${NEWLINE}${ALERT_DETAILS}${NEWLINE}${NEWLINE}${FULLREPORT} | ||
|
||
# Forces all the network calls to be executed in sequential order for all the monitored resources - NOT RECOMMENDED (Default: false). | ||
sequential: false | ||
|
||
# Enables or disables the self monitoring (e.g: job duration metrics reporting) | ||
enableSelfMonitoring: true | ||
|
||
# Displays the configured host.name attribute in the Host Resource `host.name` attribute instead of the resolved FQDN (Default: false). | ||
resolveHostnameToFqdn: false | ||
|
||
# Resource Groups configuration | ||
resourceGroups: | ||
# Resource Group identifier | ||
sentry-paris: | ||
enableSelfMonitoring: false | ||
# Adds additional static attributes to all the resources in the group. | ||
attributes: | ||
site: Sentry-Paris | ||
|
||
# Adds additional static metrics to all the resources in the group. | ||
metrics: | ||
hw.site.carbon_intensity: 230 # in g/kWh | ||
hw.site.electricity_cost: 0.12 # in $/kWh | ||
hw.site.pue: 1.8 # Power Usage Effectiveness. The ideal ratio is 1 | ||
resources: | ||
# Resource configuration | ||
server-1: | ||
# Adds additional static attributes to the resource. | ||
attributes: | ||
host.name: server-1 | ||
host.type: storage | ||
metrics: | ||
hw.host.configured: 1 | ||
protocols: | ||
http: | ||
https: true | ||
port: 443 | ||
username: username | ||
password: password | ||
# Resource configuration | ||
snmp-resources: | ||
# Adds additional static attributes to the resource. | ||
attributes: | ||
host.names: [ server-2, server-3 ] # Deprecated, change to host.name in the future | ||
host.type: storage | ||
metrics: | ||
hw.host.configured: 1 | ||
protocols: | ||
snmp: | ||
timeout: 30s | ||
community: public | ||
version: v2c | ||
# Resource configuration | ||
grafana-service: | ||
attributes: | ||
service.name: Grafana | ||
metrics: | ||
metrics.grafana.configured: 1 | ||
monitors: | ||
grafana: | ||
simple: # simple job. Creates monitors and collects assicated metrics. | ||
sources: | ||
grafanaHealth: | ||
type: http | ||
url: https://hws-demo.sentrysoftware.com/api/health | ||
method: GET | ||
header: "Accept: application/json" | ||
resultContent: body | ||
mapping: | ||
source: ${source::monitors.grafana.simple.sources.grafanaHealth} | ||
attributes: | ||
id: $1 | ||
service.version: $3 | ||
metrics: | ||
grafana.db.state: $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.