Skip to content

Prometheus goss_tests_run_{outcomes, duration} metric has wrong label if the goss suite has no errors/skipped tests #789

@timeu

Description

@timeu

Describe the bug

The two metrics goss_tests_run_outcomes_total and goss_tests_run_duration_milliseconds for the overall run always have the "unknown" outcome label if the goss test has no failures or skipped tests.
It works fine, if there is at least one skipped or failed test

# HELP goss_tests_run_duration_milliseconds The end-to-end duration of this run.
# TYPE goss_tests_run_duration_milliseconds counter
goss_tests_run_duration_milliseconds{outcome="unknown"} 126
# HELP goss_tests_run_outcomes_total The outcomes of this run as a whole.
# TYPE goss_tests_run_outcomes_total counter
goss_tests_run_outcomes_total{outcome="unknown"} 5

How To Reproduce

  • Make sure that goss suite is clean
  • Start the prometheus endpoint and run a curl against the healtz endpoint

Expected Behavior

goss_tests_run_outcomes_total{outcome="pass"} 1 
goss_tests_run_duration_milliseconds{outcome="pass"} xx

Actual Behavior

goss_tests_run_outcomes_total{outcome="unknown"} 1 
goss_tests_run_duration_milliseconds{outcome="unknown"} zzz

Environment:
goss 0.3.20

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions