Mongo DB exporter panics if initial connection fails

Description

User impact:

Exporter panics when handling requests if client connection fails.

Steps to reproduce:

Attempt to test/run exporter when mongodb is not available.

Actual result:

Expected result:

Exporter runs, providing only metrics from the default gatherer.

How to test

Run exporter with unavailable mongodb (i.e. some fake server 1.2.3.4)
Navigate to '/metrics' endpoint
Exporter should serve go_runtime metrics

How to document

None

Smart Checklist

Activity

Show:

Taras Shcherban October 7, 2022 at 7:16 AM

Now exporter doesn't crash if mongodb is not available, serves default metrics.

Done

Details

Assignee

Reporter

Priority

Components

Needs QA

Yes

Needs Doc

No

Planned Version/s

Fix versions

Story Points

Smart Checklist

Created September 12, 2022 at 10:53 AM
Updated November 13, 2024 at 9:44 AM
Resolved October 7, 2022 at 7:18 AM