Skip to content

feat: Adds support for send_collection_latency_metrics and send_database_metrics for Datadog integrations in mongodbatlas_third_party_integration #3259

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

Merged
merged 5 commits into from
Apr 11, 2025

Conversation

maastha
Copy link
Collaborator

@maastha maastha commented Apr 8, 2025

Description

Adds support for sendCollectionLatencyMetrics and sendDatabaseMetrics in the Datadog third_party_integration resource and data sources as they are supported by the atlas API

Updates documentation and example configurations to reflect these new options.

Cherry-picked from #3253

Link to any related issue(s): CLOUDP-276352

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

francovp and others added 2 commits April 8, 2025 16:15
Adds support for `sendCollectionLatencyMetrics` and `sendDatabaseMetrics` in the Datadog `third_party_integration` resource and data sources as they are supported by the atlas API

Updates documentation and example configurations to reflect these new options.
@maastha maastha changed the title feat: add support for datadog metrics in third_party_integration feat: Adds support for send_collection_latency_metrics and send_database_metrics for Datadog integrations in mongodbatlas_third_party_integration Apr 8, 2025
@maastha maastha marked this pull request as ready for review April 8, 2025 21:25
@maastha maastha requested review from a team as code owners April 8, 2025 21:25
Copy link
Contributor

github-actions bot commented Apr 8, 2025

APIx bot: a message has been sent to Docs Slack channel

@maastha
Copy link
Collaborator Author

maastha commented Apr 8, 2025

@marcosuma
Copy link
Collaborator

nit: can you also refer in the description the original PR? #3253

),
},
{
Config: configDatadog(projectID, updatedAPIKey, "US", true, true),
Copy link
Member

Choose a reason for hiding this comment

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

nit: don't know if it makes sense to have true, false and false, true in 2 more steps, e.g. to make sure we're not crossing the values

Copy link
Collaborator

@EspenAlbert EspenAlbert Apr 9, 2025

Choose a reason for hiding this comment

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

Potentially see the behavior when you remove the field from the config. Will it go back to the default value of false? Could add a default value in the schema if not
Or alternatively, warn in the docs about using an explicit false instead of removing the field

Copy link
Member

Choose a reason for hiding this comment

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

Agree with Espen we can clarify behaviour in docs, seeing both attributes are O+C we will likely be in this case

warn in the docs about using an explicit false instead of removing the field

Copy link
Collaborator Author

@maastha maastha Apr 10, 2025

Choose a reason for hiding this comment

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

Or alternatively, warn in the docs about using an explicit false instead of removing the field

Since this is a general behavior of O+C attributes, I think we should have a generic documentation note in all resources (best practices in a way). Similar to how we have a note for advanced_configuration in cluster resources, I think we can have something like below:

**NOTE:** For certain attributes with default values, it's recommended to explicitly set them back to their default instead of removing them from the configuration. For example, if `send_collection_latency_metrics` is set to `true` and you want to revert to the default (`false`), set it to `false` rather than removing `it.`

I don't think we should add this recommendation for each attribute separately.

"password": integrationSchema.Password,
"service_discovery": integration.ServiceDiscovery,
"enabled": integration.Enabled,
"id": integration.Id,
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nit] Feels very verbose this function. Seems like we could do this inline

Copy link
Member

@AgustinBettati AgustinBettati left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +135 to +136
Computed: true,
Optional: true,
Copy link
Member

Choose a reason for hiding this comment

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

Always returned by the API right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes

Copy link
Contributor

@carriecwk carriecwk left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@EspenAlbert EspenAlbert left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments!

@maastha maastha merged commit 919a5e0 into master Apr 11, 2025
40 checks passed
@maastha maastha deleted the CLOUDP-276352-tpi-stats branch April 11, 2025 10:28
maastha pushed a commit that referenced this pull request Apr 11, 2025
francovp added a commit to francovp/terraform-provider-mongodbatlas that referenced this pull request Apr 13, 2025
…tabase_metrics` for Datadog integrations in `mongodbatlas_third_party_integration` (mongodb#3259)
@francovp
Copy link

francovp commented Apr 13, 2025

Hi @maastha, thank you for merging this feature so quickly — I really need this feature!

I did notice that I might not have been added as a co-author in 919a5e0, as mentioned in the guidelines?. It would’ve been great to appear as contributor, but no worries.

Also, I’d really appreciate it if you could comment when this is released. Thanks!

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.

7 participants