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/mongodb] Add mongodb host resource attributes #33714

Merged

Conversation

dmitryax
Copy link
Member

The new attribute are added to the MongoDB receiver to distinguish metrics coming from different MongoDB instances.

  • server.address: The address of the MongoDB host, enabled by default.
  • server.port: The port of the MongoDB host, disabled by default.

Resolves #32350 and #32810

Copy link
Member

@crobert-1 crobert-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nits, the general logic looks good to me though.

# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of ignorance: It's considered a breaking change when metrics are switched to be enabled by default. Since we're adding a resource attribute that is now enabled by default, should this also be a breaking change? Or is it so little extra data that it doesn't merit the breaking label?

I guess counterpoint, adding attributes to metrics isn't considered a breaking change, so I'm not sure where the line in the sand is. (I'm also not finding documentation on this, either way).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have strict guidelines for the resource attributes. I'd say adding a new resource attribute is not a breaking change because it doesn't change cardinality. Removing or changing one should be considered a breaking change, though.

Happy to hear other opinions. cc @djaglowski

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've generally considered it a breaking change because it breaks time series that are based on all attributes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By breaking time series you mean just the interrupted continuity, no other user-facing effect, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would merge this as is, assuming that's the case ^. Let me know if there are any other consequences for the end user that I miss, I'll change it.

.chloggen/mongodb_add_address_res_attr.yaml Outdated Show resolved Hide resolved
receiver/mongodbreceiver/scraper.go Outdated Show resolved Hide resolved
receiver/mongodbreceiver/scraper_test.go Outdated Show resolved Hide resolved
receiver/mongodbreceiver/scraper.go Show resolved Hide resolved
@crobert-1
Copy link
Member

Looks like the integration expected test data needs to be updated to include the new resource attribute.

@dmitryax dmitryax force-pushed the mongodb-add-address-resource-attr branch from dc2592e to 1dbbde5 Compare June 21, 2024 22:57
The new attribute are added to the MongoDB receiver to distinguish metrics coming from different MongoDB instances.
  - `server.address`: The address of the MongoDB host, enabled by default.
  - `server.port`: The port of the MongoDB host, disabled by default.

Co-authored-by: Curtis Robert <crobert@splunk.com>
@dmitryax dmitryax force-pushed the mongodb-add-address-resource-attr branch from 1dbbde5 to 9be660c Compare June 21, 2024 23:05
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've generally considered it a breaking change because it breaks time series that are based on all attributes.

@dmitryax dmitryax merged commit 0ab1b74 into open-telemetry:main Jun 25, 2024
154 checks passed
@github-actions github-actions bot added this to the next release milestone Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to get instance details through mongodb receiver
5 participants