Skip to content

Commit f62fec5

Browse files
authored
[receiver/mongodbatlas] Rename mongodbatlas to mongodb_atlas (#45652)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR is part of the effort to standardize the naming on snake case. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Relates to #45339 <!--Describe the documentation added.--> #### Documentation Updated documentation to match the new name <!--Please delete paragraphs that you did not use before submitting.-->
1 parent 110990f commit f62fec5

File tree

12 files changed

+51
-21
lines changed

12 files changed

+51
-21
lines changed

.chloggen/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ components:
284284
- receiver/macosunifiedlogging
285285
- receiver/memcached
286286
- receiver/mongodb
287-
- receiver/mongodbatlas
287+
- receiver/mongodb_atlas
288288
- receiver/mysql
289289
- receiver/namedpipe
290290
- receiver/netflow
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: deprecation
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. receiver/filelog)
7+
component: receiver/mongodb_atlas
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Rename `mongodbatlas` receiver to `mongodb_atlas` and add deprecated alias `mongodbatlas`
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [45652]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

receiver/mongodbatlasreceiver/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| Stability | [beta]: metrics, logs |
77
| Distributions | [contrib] |
88
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fmongodbatlas%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fmongodbatlas) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fmongodbatlas%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fmongodbatlas) |
9-
| Code coverage | [![codecov](https://codecov.io/github/open-telemetry/opentelemetry-collector-contrib/graph/main/badge.svg?component=receiver_mongodbatlas)](https://app.codecov.io/gh/open-telemetry/opentelemetry-collector-contrib/tree/main/?components%5B0%5D=receiver_mongodbatlas&displayType=list) |
9+
| Code coverage | [![codecov](https://codecov.io/github/open-telemetry/opentelemetry-collector-contrib/graph/main/badge.svg?component=receiver_mongodb_atlas)](https://app.codecov.io/gh/open-telemetry/opentelemetry-collector-contrib/tree/main/?components%5B0%5D=receiver_mongodb_atlas&displayType=list) |
1010
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@justinianvoss22](https://www.github.com/justinianvoss22), [@dyl10s](https://www.github.com/dyl10s) \| Seeking more code owners! |
1111

1212
[beta]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#beta
@@ -108,7 +108,7 @@ Receive metrics:
108108

109109
```yaml
110110
receivers:
111-
mongodbatlas:
111+
mongodb_atlas:
112112
public_key: ${env:MONGODB_ATLAS_PUBLIC_KEY}
113113
private_key: ${env:MONGODB_ATLAS_PRIVATE_KEY}
114114
```
@@ -117,7 +117,7 @@ Listen for alerts (default mode):
117117
118118
```yaml
119119
receivers:
120-
mongodbatlas:
120+
mongodb_atlas:
121121
alerts:
122122
enabled: true
123123
secret: "some_secret"
@@ -128,7 +128,7 @@ Poll alerts from API:
128128
129129
```yaml
130130
receivers:
131-
mongodbatlas:
131+
mongodb_atlas:
132132
public_key: <redacted>
133133
private_key: <redacted>
134134
alerts:
@@ -146,7 +146,7 @@ Receive logs:
146146
147147
```yaml
148148
receivers:
149-
mongodbatlas:
149+
mongodb_atlas:
150150
logs:
151151
enabled: true
152152
projects:
@@ -159,7 +159,7 @@ Receive events:
159159
160160
```yaml
161161
receivers:
162-
mongodbatlas:
162+
mongodb_atlas:
163163
events:
164164
projects:
165165
- name: "project 1"
@@ -176,7 +176,7 @@ Poll Access Logs from API:
176176
177177
```yaml
178178
receivers:
179-
mongodbatlas:
179+
mongodb_atlas:
180180
public_key: <redacted>
181181
private_key: <redacted>
182182
logs:

receiver/mongodbatlasreceiver/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)
22

3-
# mongodbatlas
3+
# mongodb_atlas
44

55
## Default Metrics
66

receiver/mongodbatlasreceiver/factory.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"go.opentelemetry.io/collector/config/configretry"
1515
"go.opentelemetry.io/collector/consumer"
1616
"go.opentelemetry.io/collector/receiver"
17+
"go.opentelemetry.io/collector/receiver/xreceiver"
1718
"go.opentelemetry.io/collector/scraper/scraperhelper"
1819

1920
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver/internal/metadata"
@@ -27,11 +28,13 @@ const (
2728

2829
// NewFactory creates a factory for MongoDB Atlas receiver
2930
func NewFactory() receiver.Factory {
30-
return receiver.NewFactory(
31+
return xreceiver.NewFactory(
3132
metadata.Type,
3233
createDefaultConfig,
33-
receiver.WithMetrics(createMetricsReceiver, metadata.MetricsStability),
34-
receiver.WithLogs(createCombinedLogReceiver, metadata.LogsStability))
34+
xreceiver.WithMetrics(createMetricsReceiver, metadata.MetricsStability),
35+
xreceiver.WithLogs(createCombinedLogReceiver, metadata.LogsStability),
36+
xreceiver.WithDeprecatedTypeAlias(component.MustNewType("mongodbatlas")),
37+
)
3538
}
3639

3740
func createMetricsReceiver(

receiver/mongodbatlasreceiver/generated_component_test.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/mongodbatlasreceiver/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ require (
3636
go.opentelemetry.io/collector/consumer/consumertest v0.144.1-0.20260121161034-55399d4743af
3737
go.opentelemetry.io/collector/extension/xextension v0.144.1-0.20260121161034-55399d4743af
3838
go.opentelemetry.io/collector/receiver/receivertest v0.144.1-0.20260121161034-55399d4743af
39+
go.opentelemetry.io/collector/receiver/xreceiver v0.144.1-0.20260121161034-55399d4743af
3940
go.opentelemetry.io/collector/scraper v0.144.1-0.20260121161034-55399d4743af
4041
go.opentelemetry.io/collector/scraper/scraperhelper v0.144.1-0.20260121161034-55399d4743af
4142
)
@@ -83,7 +84,6 @@ require (
8384
go.opentelemetry.io/collector/pipeline v1.50.1-0.20260121161034-55399d4743af // indirect
8485
go.opentelemetry.io/collector/pipeline/xpipeline v0.144.1-0.20260121161034-55399d4743af // indirect
8586
go.opentelemetry.io/collector/receiver/receiverhelper v0.144.1-0.20260121161034-55399d4743af // indirect
86-
go.opentelemetry.io/collector/receiver/xreceiver v0.144.1-0.20260121161034-55399d4743af // indirect
8787
go.opentelemetry.io/otel v1.39.0 // indirect
8888
go.opentelemetry.io/otel/sdk v1.39.0 // indirect
8989
go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect

receiver/mongodbatlasreceiver/internal/metadata/generated_config.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/mongodbatlasreceiver/internal/metadata/generated_status.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/mongodbatlasreceiver/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
type: mongodbatlas
1+
type: mongodb_atlas
22

33
status:
44
class: receiver

0 commit comments

Comments
 (0)