Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/mongodbatlasreceiver] added mongodb_atlas.user.alias attribute, the user-friendly hostname of the cluster node as displayed in the Atlas portal. #18881

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .chloggen/mongodbatlasreceiver-add-attribute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: receiver/mongodbatlasreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: emit "`mongodb_atlas.user.alias`" attribute which is the user-friendly hostname of the cluster node as displayed in the Atlas portal.
This attribute is disabled by default, if you want to emit it, you'll need to explicitly enable it.

# One or more tracking issues related to the change
issues: [18881]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
1 change: 1 addition & 0 deletions receiver/mongodbatlasreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -972,3 +972,4 @@ Aggregate of MongoDB Metrics MAX_SWAP_USAGE_FREE, MAX_SWAP_USAGE_USED
| mongodb_atlas.process.type_name | Process type | Any Str | true |
| mongodb_atlas.project.id | Project ID | Any Str | true |
| mongodb_atlas.project.name | Project Name | Any Str | true |
| mongodb_atlas.user.alias | User-friendly hostname of the cluster node | Any Str | false |

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ all_set:
enabled: true
mongodb_atlas.project.name:
enabled: true
mongodb_atlas.user.alias:
enabled: true
none_set:
metrics:
mongodbatlas.db.counts:
Expand Down Expand Up @@ -293,3 +295,5 @@ none_set:
enabled: false
mongodb_atlas.project.name:
enabled: false
mongodb_atlas.user.alias:
enabled: false
4 changes: 4 additions & 0 deletions receiver/mongodbatlasreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ resource_attributes:
description: Hostname of the process
enabled: true
type: string
mongodb_atlas.user.alias:
dloucasfx marked this conversation as resolved.
Show resolved Hide resolved
description: User-friendly hostname of the cluster node
enabled: false
type: string
mongodb_atlas.process.port:
description: Port process is bound to
enabled: true
Expand Down
3 changes: 3 additions & 0 deletions receiver/mongodbatlasreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (s *receiver) poll(ctx context.Context, time timeconstraints) error {
metadata.WithMongodbAtlasProjectName(project.Name),
metadata.WithMongodbAtlasProjectID(project.ID),
metadata.WithMongodbAtlasHostName(process.Hostname),
metadata.WithMongodbAtlasUserAlias(process.UserAlias),
metadata.WithMongodbAtlasProcessPort(strconv.Itoa(process.Port)),
metadata.WithMongodbAtlasProcessTypeName(process.TypeName),
metadata.WithMongodbAtlasProcessID(process.ID),
Expand Down Expand Up @@ -195,6 +196,7 @@ func (s *receiver) extractProcessDatabaseMetrics(
metadata.WithMongodbAtlasProjectName(project.Name),
metadata.WithMongodbAtlasProjectID(project.ID),
metadata.WithMongodbAtlasHostName(process.Hostname),
metadata.WithMongodbAtlasUserAlias(process.UserAlias),
metadata.WithMongodbAtlasProcessPort(strconv.Itoa(process.Port)),
metadata.WithMongodbAtlasProcessTypeName(process.TypeName),
metadata.WithMongodbAtlasProcessID(process.ID),
Expand Down Expand Up @@ -230,6 +232,7 @@ func (s *receiver) extractProcessDiskMetrics(
metadata.WithMongodbAtlasProjectName(project.Name),
metadata.WithMongodbAtlasProjectID(project.ID),
metadata.WithMongodbAtlasHostName(process.Hostname),
metadata.WithMongodbAtlasUserAlias(process.UserAlias),
metadata.WithMongodbAtlasProcessPort(strconv.Itoa(process.Port)),
metadata.WithMongodbAtlasProcessTypeName(process.TypeName),
metadata.WithMongodbAtlasProcessID(process.ID),
Expand Down