doc: Add OAuth examples for mongodbatlas_metric_integration - #4746
marcabreracast wants to merge 5 commits into
Conversation
|
APIx bot: a message has been sent to Docs Slack channel |
🤖 Augment PR SummarySummary: Reorganizes Metric Integration examples and documents OAuth authentication. Changes:
Technical Notes: The OAuth configurations use 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
🟡 Changes recommended
The rendered documentation omits the project resource, and the header example’s documented Datadog environment variables do not populate its Terraform variables.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Reorganizes metric integration examples and adds OAuth 2.0 client-secret and private-key JWT configurations.
Changes:
- Splits the existing Datadog example into
header/. - Adds two OAuth example flows with data-source readbacks.
- Updates templates, generated documentation, and READMEs.
File summaries
| File | Description |
|---|---|
templates/resources/metric_integration.md.tmpl |
Updates embedded example and links. |
templates/data-sources/metric_integrations.md.tmpl |
Updates embedded example and links. |
templates/data-sources/metric_integration.md.tmpl |
Updates embedded example and links. |
examples/mongodbatlas_metric_integration/README.md |
Adds the example index. |
examples/mongodbatlas_metric_integration/header/* |
Moves and documents the Datadog example. |
examples/mongodbatlas_metric_integration/oauth/client_secret/* |
Adds client-secret OAuth configuration. |
examples/mongodbatlas_metric_integration/oauth/private_key_jwt/* |
Adds private-key JWT OAuth configuration. |
docs/resources/metric_integration.md |
Updates resource example links. |
docs/data-sources/metric_integrations.md |
Updates plural data-source links. |
docs/data-sources/metric_integration.md |
Updates singular data-source links. |
Review details
- Files reviewed: 18/23 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| client_id = var.atlas_client_id | ||
| client_secret = var.atlas_client_secret |
| client_id = var.atlas_client_id | ||
| client_secret = var.atlas_client_secret |
Updated environment variable exports for Datadog API and app keys to use Terraform variable format. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Docs Link Check failures are expected, as the examples are not available yet on the released version of the provider. |
|
|
||
| ### Further Examples | ||
| - [Metric Integration Examples](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v2.18.0/examples/mongodbatlas_metric_integration) | ||
| - [Header-based](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v2.18.0/examples/mongodbatlas_metric_integration/header) — export using header-based authentication. |
There was a problem hiding this comment.
export what? try to provide a title that leaves no room for the reader or llm to guess what you mean.
| ### Further Examples | ||
| - [Metric Integration Examples](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v2.18.0/examples/mongodbatlas_metric_integration) | ||
| - [Header-based](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v2.18.0/examples/mongodbatlas_metric_integration/header) — export using header-based authentication. | ||
| - [OAuth 2.0](https://github.com/mongodb/terraform-provider-mongodbatlas/tree/v2.18.0/examples/mongodbatlas_metric_integration/oauth) — export using OAuth 2.0 authentication. |
| @@ -0,0 +1,66 @@ | |||
| # MongoDB Atlas Metric Integration with Datadog Example | |||
|
|
|||
| This example demonstrates how to configure a metric integration to export MongoDB Atlas metrics to Datadog over OTLP. It also shows how to read the integration back with the singular and plural data sources. | |||
There was a problem hiding this comment.
a metric integration that exports ....
new paragraph:
The example also shows ....
|
|
||
| This example demonstrates how to configure a metric integration to export MongoDB Atlas metrics to Datadog over OTLP. It also shows how to read the integration back with the singular and plural data sources. | ||
|
|
||
| This example is specific to Datadog. To export to another provider, update `provider_type` (`CUSTOM`, `NEW_RELIC`, or `DYNATRACE`), the `endpoint`, and the authentication `headers` to match that provider. |
There was a problem hiding this comment.
To export what? metrics? Add this
add "the values for that provider", as in:
... to match the values for that provider.
| export TF_VAR_datadog_app_key="<DATADOG_APP_KEY>" | ||
| ``` | ||
|
|
||
| Alternatively, follow as in the `variables.tf` file and create a **terraform.tfvars** file with all the variable values: |
There was a problem hiding this comment.
Did you mean: Alternatively, specify all the variable values in a single file, as shown in the following example of the variables.tf file:
If yes, please consider rewriting this
|
|
||
| **2\. Review the Terraform plan.** | ||
|
|
||
| Execute the following command and confirm the plan's accuracy. |
| terraform plan | ||
| ``` | ||
|
|
||
| **3\. Execute the Terraform apply.** |
There was a problem hiding this comment.
Here and elsewhere: Run is much shorter than execute. consider replacing all literal instruction text instances of execute with run. The scope is just this PR, don't expand scope. This can be gradually adopted as the practice over time.
This is just a suggestion and is optional.
|
|
||
| **4\. Destroy the resources.** | ||
|
|
||
| When you have finished your testing, ensure you destroy the resources to avoid accruing charges in Atlas. |
There was a problem hiding this comment.
in the sentence at least, suggest to use you delete... instead of destroy
Description
Restructures the
mongodbatlas_metric_integrationexamples into sibling directories and adds OAuth 2.0 examples alongside the existing header-based one:header/— the existing header-based (Datadog) example.oauth/client_secret/— export metrics using a shared client secret.oauth/private_key_jwt/— export metrics using an Atlas-managed private-key JWT signing assertion; register the returnedjwks_uriwith your identity provider.Each example creates a MongoDB Atlas project and the metric integration, and reads it back with the singular and plural data sources. Regenerates the resource and data source docs to reference the new examples.
Link to any related issue(s): CLOUDP-445734
Type of change:
Required Checklist:
Further comments