Prometheus exporter for AWS CloudWatch - Discovers services through AWS tags, gets CloudWatch metrics data and provides them as Prometheus metrics with AWS tags as labels
Apache License 2.0
981
stars
334
forks
source link
[BUG] Yaml config error log is not logged when debug mode is enabled #1377
Hi, I'm not completely certain if this is an actual bug, or if it's really the intended behavior, if so then please consider this issue as a question, thanks.
The job configuration attached above has a problem, it defines "dimensions", while the job type is "discovery" not "static", which leads to yace logging an error about the misconfiguration but only when debug mode is disabled, and therefore metrics not getting scraped. If debug mode is enabled, it doesn't log that error, and yace works ok.
More details:
When debug mode is enabled:
extraArgs:
debug: true
It doesn't log any error regarding the job's configuration, it works ok and scrapes the metrics.
When debug mode is disabled:
extraArgs:
debug: false
then yace logs:
{
"caller": "main.go:240",
"level": "info",
"msg": "Parsing config",
"ts": "2024-04-09T09:07:14.573455285Z",
"version": "v0.57.1"
}
{
"caller": "config.go:515",
"err": "line 115: field dimensions not found in type config.Job",
"level": "warn",
"msg": "config file syntax error",
"ts": "2024-04-09T09:07:14.580801808Z",
"version": "v0.57.1"
}
{
"caller": "config.go:515",
"err": "line 138: field dimensions not found in type config.Job",
"level": "warn",
"msg": "config file syntax error",
"ts": "2024-04-09T09:07:14.580840602Z",
"version": "v0.57.1"
}
{
"caller": "config.go:517",
"level": "warn",
"msg": "Config file error(s) detected: Yace might not work as expected. Future versions of Yace might fail to run with an invalid config file.",
"ts": "2024-04-09T09:07:14.580846482Z",
"version": "v0.57.1"
}
{
"caller": "main.go:325",
"feature_flags": "",
"level": "info",
"msg": "Yace startup completed",
"ts": "2024-04-09T09:07:14.580978014Z",
"version": "v0.57.1"
}
Expected Behavior
Yaml misconfiguration error log to be logged when debug mode is enabled.
Steps To Reproduce
Create a sagemaker job, and place it under "discovery" jobs type.
Add "dimensions" to the sagemaker job as shared in the config file above.
Make sure to disable debug mode.
Apply, and then the misconfiguration error log should appear.
Is there an existing issue for this?
YACE version
v0.57.1
Config file
Current Behavior
Hi, I'm not completely certain if this is an actual bug, or if it's really the intended behavior, if so then please consider this issue as a question, thanks.
The job configuration attached above has a problem, it defines "dimensions", while the job type is "discovery" not "static", which leads to yace logging an error about the misconfiguration but only when debug mode is disabled, and therefore metrics not getting scraped. If debug mode is enabled, it doesn't log that error, and yace works ok.
More details:
When debug mode is enabled:
It doesn't log any error regarding the job's configuration, it works ok and scrapes the metrics.
When debug mode is disabled:
then yace logs:
Expected Behavior
Yaml misconfiguration error log to be logged when debug mode is enabled.
Steps To Reproduce
Anything else?
No response