published on Friday, Aug 28, 2026 by Pulumi
published on Friday, Aug 28, 2026 by Pulumi
mongodbatlas.MetricIntegration describes the configuration of a metric integration at the project level.
To use this data source, the requesting Service Account or API Key must have the Organization Owner or Project Owner role.
Example Usage
The following example creates a mongodbatlas.MetricIntegration resource that exports Atlas metrics to an OpenTelemetry-compatible endpoint, then uses this data source to read back a single integration by its metric integration ID and output its integration type.
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const atlasMetrics = new datadog.index.ApiKey("atlas_metrics", {name: "mongodb-atlas-metrics"});
const exampleMetricIntegration = new mongodbatlas.MetricIntegration("example", {
projectId: project.id,
integrationType: "OTEL",
providerType: "CUSTOM",
authType: "HEADER",
aggregationTemporality: "DELTA",
endpoint: datadogEndpoint,
metricSelections: ["ATLAS_STREAM_PROCESSING"],
headers: [{
name: "dd-api-key",
value: atlasMetrics.key,
}],
});
const example = mongodbatlas.getMetricIntegrationOutput({
projectId: exampleMetricIntegration.projectId,
metricIntegrationId: exampleMetricIntegration.metricIntegrationId,
});
export const metricIntegrationType = example.integrationType;
const exampleGetMetricIntegrations = mongodbatlas.getMetricIntegrationsOutput({
projectId: exampleMetricIntegration.projectId,
});
export const metricIntegrationIds = exampleGetMetricIntegrations.apply(exampleGetMetricIntegrations => .map(r => (r.metricIntegrationId)));
import pulumi
import pulumi_datadog as datadog
import pulumi_mongodbatlas as mongodbatlas
atlas_metrics = datadog.ApiKey("atlas_metrics", name=mongodb-atlas-metrics)
example_metric_integration = mongodbatlas.MetricIntegration("example",
project_id=project["id"],
integration_type="OTEL",
provider_type="CUSTOM",
auth_type="HEADER",
aggregation_temporality="DELTA",
endpoint=datadog_endpoint,
metric_selections=["ATLAS_STREAM_PROCESSING"],
headers=[{
"name": "dd-api-key",
"value": atlas_metrics["key"],
}])
example = mongodbatlas.get_metric_integration_output(project_id=example_metric_integration.project_id,
metric_integration_id=example_metric_integration.metric_integration_id)
pulumi.export("metricIntegrationType", example.integration_type)
example_get_metric_integrations = mongodbatlas.get_metric_integrations_output(project_id=example_metric_integration.project_id)
pulumi.export("metricIntegrationIds", example_get_metric_integrations.apply(lambda example_get_metric_integrations: [r.metric_integration_id for r in example_get_metric_integrations.results]))
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
var atlasMetrics = new Datadog.ApiKey("atlas_metrics", new()
{
Name = "mongodb-atlas-metrics",
});
var exampleMetricIntegration = new Mongodbatlas.MetricIntegration("example", new()
{
ProjectId = project.Id,
IntegrationType = "OTEL",
ProviderType = "CUSTOM",
AuthType = "HEADER",
AggregationTemporality = "DELTA",
Endpoint = datadogEndpoint,
MetricSelections = new[]
{
"ATLAS_STREAM_PROCESSING",
},
Headers = new[]
{
new Mongodbatlas.Inputs.MetricIntegrationHeaderArgs
{
Name = "dd-api-key",
Value = atlasMetrics.Key,
},
},
});
var example = Mongodbatlas.GetMetricIntegration.Invoke(new()
{
ProjectId = exampleMetricIntegration.ProjectId,
MetricIntegrationId = exampleMetricIntegration.MetricIntegrationId,
});
var exampleGetMetricIntegrations = Mongodbatlas.GetMetricIntegrations.Invoke(new()
{
ProjectId = exampleMetricIntegration.ProjectId,
});
return new Dictionary<string, object?>
{
["metricIntegrationType"] = example.Apply(getMetricIntegrationResult => getMetricIntegrationResult.IntegrationType),
["metricIntegrationIds"] = .Select(r =>
{
return r.MetricIntegrationId;
}).ToList(),
};
});
Example coming soon!
Example coming soon!
pulumi {
required_providers {
mongodbatlas = {
source = "pulumi/mongodbatlas"
}
}
}
data "mongodbatlas_getmetricintegration" "example" {
project_id = mongodbatlas_metricintegration.example.project_id
metric_integration_id = mongodbatlas_metricintegration.example.metric_integration_id
}
data "mongodbatlas_getmetricintegrations" "exampleGetMetricIntegrations" {
project_id = mongodbatlas_metricintegration.example.project_id
}
resource "datadog_apikey" "atlas_metrics" {
name = "mongodb-atlas-metrics"
}
resource "mongodbatlas_metricintegration" "example" {
project_id = project.id
integration_type = "OTEL"
provider_type = "CUSTOM"
auth_type = "HEADER"
aggregation_temporality = "DELTA"
endpoint = datadogEndpoint
metric_selections = ["ATLAS_STREAM_PROCESSING"]
headers {
name = "dd-api-key"
value = datadog_apikey.atlas_metrics.key
}
}
output "metricIntegrationType" {
value = data.mongodbatlas_getmetricintegration.example.integration_type
}
output "metricIntegrationIds" {
value = [for r in data.mongodbatlas_getmetricintegrations.exampleGetMetricIntegrations.results : r.metricIntegrationId]
}
Further Examples
- Metric Integration Examples
Using getMetricIntegration
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getMetricIntegration(args: GetMetricIntegrationArgs, opts?: InvokeOptions): Promise<GetMetricIntegrationResult>
function getMetricIntegrationOutput(args: GetMetricIntegrationOutputArgs, opts?: InvokeOutputOptions): Output<GetMetricIntegrationResult>def get_metric_integration(metric_integration_id: Optional[str] = None,
project_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetMetricIntegrationResult
def get_metric_integration_output(metric_integration_id: pulumi.Input[Optional[str]] = None,
project_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetMetricIntegrationResult]func LookupMetricIntegration(ctx *Context, args *LookupMetricIntegrationArgs, opts ...InvokeOption) (*LookupMetricIntegrationResult, error)
func LookupMetricIntegrationOutput(ctx *Context, args *LookupMetricIntegrationOutputArgs, opts ...InvokeOption) LookupMetricIntegrationResultOutput> Note: This function is named LookupMetricIntegration in the Go SDK.
public static class GetMetricIntegration
{
public static Task<GetMetricIntegrationResult> InvokeAsync(GetMetricIntegrationArgs args, InvokeOptions? opts = null)
public static Output<GetMetricIntegrationResult> Invoke(GetMetricIntegrationInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetMetricIntegrationResult> Invoke(GetMetricIntegrationInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetMetricIntegrationResult> getMetricIntegration(GetMetricIntegrationArgs args, InvokeOptions options)
public static Output<GetMetricIntegrationResult> getMetricIntegration(GetMetricIntegrationArgs args, InvokeOptions options)
public static Output<GetMetricIntegrationResult> getMetricIntegration(GetMetricIntegrationArgs args, InvokeOutputOptions options)
fn::invoke:
function: mongodbatlas:index/getMetricIntegration:getMetricIntegration
arguments:
# arguments dictionarydata "mongodbatlas_get_metric_integration" "name" {
# arguments
}The following arguments are supported:
- Metric
Integration stringId - Unique identifier of the metric integration configuration.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation.
- Metric
Integration stringId - Unique identifier of the metric integration configuration.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation.
- metric_
integration_ stringid - Unique identifier of the metric integration configuration.
- project_
id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation.
- metric
Integration StringId - Unique identifier of the metric integration configuration.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation.
- metric
Integration stringId - Unique identifier of the metric integration configuration.
- project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation.
- metric_
integration_ strid - Unique identifier of the metric integration configuration.
- project_
id str - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation.
- metric
Integration StringId - Unique identifier of the metric integration configuration.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation.
getMetricIntegration Result
The following output properties are available:
- Aggregation
Temporality string - The temporality to send to the metric integration.
- Auth
Type string - Authentication method the integration uses when exporting metrics to the endpoint.
- Endpoint string
- OpenTelemetry collector endpoint URL.
- Headers
Redacteds List<GetMetric Integration Headers Redacted> - HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
- Integration
Type string - Type of metric integration. Identifies which protocol will be used for the integration.
- Metric
Integration stringId - Unique identifier of the metric integration configuration.
- Metric
Selections List<string> - Array of metric categories to export. Determines which types of metrics are sent to the integration.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - Provider
Type string - The provider type for the metric integration. Identifies the third-party service provider.
- Aggregation
Temporality string - The temporality to send to the metric integration.
- Auth
Type string - Authentication method the integration uses when exporting metrics to the endpoint.
- Endpoint string
- OpenTelemetry collector endpoint URL.
- Headers
Redacteds []GetMetric Integration Headers Redacted - HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
- Integration
Type string - Type of metric integration. Identifies which protocol will be used for the integration.
- Metric
Integration stringId - Unique identifier of the metric integration configuration.
- Metric
Selections []string - Array of metric categories to export. Determines which types of metrics are sent to the integration.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - Provider
Type string - The provider type for the metric integration. Identifies the third-party service provider.
- aggregation_
temporality string - The temporality to send to the metric integration.
- auth_
type string - Authentication method the integration uses when exporting metrics to the endpoint.
- endpoint string
- OpenTelemetry collector endpoint URL.
- headers_
redacteds list(object) - HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
- integration_
type string - Type of metric integration. Identifies which protocol will be used for the integration.
- metric_
integration_ stringid - Unique identifier of the metric integration configuration.
- metric_
selections list(string) - Array of metric categories to export. Determines which types of metrics are sent to the integration.
- project_
id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - provider_
type string - The provider type for the metric integration. Identifies the third-party service provider.
- aggregation
Temporality String - The temporality to send to the metric integration.
- auth
Type String - Authentication method the integration uses when exporting metrics to the endpoint.
- endpoint String
- OpenTelemetry collector endpoint URL.
- headers
Redacteds List<GetMetric Integration Headers Redacted> - HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
- integration
Type String - Type of metric integration. Identifies which protocol will be used for the integration.
- metric
Integration StringId - Unique identifier of the metric integration configuration.
- metric
Selections List<String> - Array of metric categories to export. Determines which types of metrics are sent to the integration.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - provider
Type String - The provider type for the metric integration. Identifies the third-party service provider.
- aggregation
Temporality string - The temporality to send to the metric integration.
- auth
Type string - Authentication method the integration uses when exporting metrics to the endpoint.
- endpoint string
- OpenTelemetry collector endpoint URL.
- headers
Redacteds GetMetric Integration Headers Redacted[] - HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
- integration
Type string - Type of metric integration. Identifies which protocol will be used for the integration.
- metric
Integration stringId - Unique identifier of the metric integration configuration.
- metric
Selections string[] - Array of metric categories to export. Determines which types of metrics are sent to the integration.
- project
Id string - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - provider
Type string - The provider type for the metric integration. Identifies the third-party service provider.
- aggregation_
temporality str - The temporality to send to the metric integration.
- auth_
type str - Authentication method the integration uses when exporting metrics to the endpoint.
- endpoint str
- OpenTelemetry collector endpoint URL.
- headers_
redacteds Sequence[GetMetric Integration Headers Redacted] - HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
- integration_
type str - Type of metric integration. Identifies which protocol will be used for the integration.
- metric_
integration_ strid - Unique identifier of the metric integration configuration.
- metric_
selections Sequence[str] - Array of metric categories to export. Determines which types of metrics are sent to the integration.
- project_
id str - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - provider_
type str - The provider type for the metric integration. Identifies the third-party service provider.
- aggregation
Temporality String - The temporality to send to the metric integration.
- auth
Type String - Authentication method the integration uses when exporting metrics to the endpoint.
- endpoint String
- OpenTelemetry collector endpoint URL.
- headers
Redacteds List<Property Map> - HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
- integration
Type String - Type of metric integration. Identifies which protocol will be used for the integration.
- metric
Integration StringId - Unique identifier of the metric integration configuration.
- metric
Selections List<String> - Array of metric categories to export. Determines which types of metrics are sent to the integration.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project, also known as
groupIdin the official documentation. - provider
Type String - The provider type for the metric integration. Identifies the third-party service provider.
Supporting Types
GetMetricIntegrationHeadersRedacted
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlasTerraform Provider.
published on Friday, Aug 28, 2026 by Pulumi