Skip to content

Commit f1068be

Browse files
authored
[receiver/mongodb] fix missing version (#23860)
**Description:** Fix missing version in mongodb creating panics during scrapes **Link to tracking Issue:** Fixes #23859 **Testing:** No tests, really. **Documentation:** N/A
1 parent 5a2214b commit f1068be

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use this changelog template to create an entry for release notes.
2+
# If your change doesn't affect end users, such as a test fix or a tooling change,
3+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
4+
5+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
6+
change_type: bug_fix
7+
8+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
9+
component: mongodbreceiver
10+
11+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
12+
note: Fix missing version in mongodb creating panics during scrapes
13+
14+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
15+
issues: [23859]
16+
17+
# (Optional) One or more lines of additional information to render under the primary note.
18+
# These lines will be padded with 2 spaces and then inserted directly into the document.
19+
# Use pipe (|) for multiline entries.
20+
subtext:

receiver/mongodbreceiver/scraper.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ type mongodbScraper struct {
3030
}
3131

3232
func newMongodbScraper(settings receiver.CreateSettings, config *Config) *mongodbScraper {
33+
v, _ := version.NewVersion("0.0")
3334
return &mongodbScraper{
34-
logger: settings.Logger,
35-
config: config,
36-
mb: metadata.NewMetricsBuilder(config.MetricsBuilderConfig, settings),
35+
logger: settings.Logger,
36+
config: config,
37+
mb: metadata.NewMetricsBuilder(config.MetricsBuilderConfig, settings),
38+
mongoVersion: v,
3739
}
3840
}
3941

0 commit comments

Comments
 (0)