1. Registry
  2. Packages
  3. Mongodbatlas Provider
  4. API Docs
  5. getMetricIntegrations
Viewing docs for MongoDB Atlas v4.15.0
published on Friday, Aug 28, 2026 by Pulumi
mongodbatlas logo mongodbatlas logo
Viewing docs for MongoDB Atlas v4.15.0
published on Friday, Aug 28, 2026 by Pulumi

    mongodbatlas.getMetricIntegrations describes all metric integrations configured 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.

    Note: integrationType and providerType are optional filters that must be specified together. If one is set, the other must also be set.

    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 retrieve all metric integrations configured in the project and output their metricIntegrationId values.

    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 getMetricIntegrations

    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 getMetricIntegrations(args: GetMetricIntegrationsArgs, opts?: InvokeOptions): Promise<GetMetricIntegrationsResult>
    function getMetricIntegrationsOutput(args: GetMetricIntegrationsOutputArgs, opts?: InvokeOutputOptions): Output<GetMetricIntegrationsResult>
    def get_metric_integrations(integration_type: Optional[str] = None,
                                project_id: Optional[str] = None,
                                provider_type: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetMetricIntegrationsResult
    def get_metric_integrations_output(integration_type: pulumi.Input[Optional[str]] = None,
                                project_id: pulumi.Input[Optional[str]] = None,
                                provider_type: pulumi.Input[Optional[str]] = None,
                                opts: Optional[InvokeOutputOptions] = None) -> Output[GetMetricIntegrationsResult]
    func LookupMetricIntegrations(ctx *Context, args *LookupMetricIntegrationsArgs, opts ...InvokeOption) (*LookupMetricIntegrationsResult, error)
    func LookupMetricIntegrationsOutput(ctx *Context, args *LookupMetricIntegrationsOutputArgs, opts ...InvokeOption) LookupMetricIntegrationsResultOutput

    > Note: This function is named LookupMetricIntegrations in the Go SDK.

    public static class GetMetricIntegrations 
    {
        public static Task<GetMetricIntegrationsResult> InvokeAsync(GetMetricIntegrationsArgs args, InvokeOptions? opts = null)
        public static Output<GetMetricIntegrationsResult> Invoke(GetMetricIntegrationsInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetMetricIntegrationsResult> Invoke(GetMetricIntegrationsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetMetricIntegrationsResult> getMetricIntegrations(GetMetricIntegrationsArgs args, InvokeOptions options)
    public static Output<GetMetricIntegrationsResult> getMetricIntegrations(GetMetricIntegrationsArgs args, InvokeOptions options)
    public static Output<GetMetricIntegrationsResult> getMetricIntegrations(GetMetricIntegrationsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: mongodbatlas:index/getMetricIntegrations:getMetricIntegrations
      arguments:
        # arguments dictionary
    data "mongodbatlas_get_metric_integrations" "name" {
        # arguments
    }

    The following arguments are supported:

    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    IntegrationType string
    Optional filter by integration type (e.g., OTEL).
    ProviderType string
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    IntegrationType string
    Optional filter by integration type (e.g., OTEL).
    ProviderType string
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    project_id string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    integration_type string
    Optional filter by integration type (e.g., OTEL).
    provider_type string
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    integrationType String
    Optional filter by integration type (e.g., OTEL).
    providerType String
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    integrationType string
    Optional filter by integration type (e.g., OTEL).
    providerType string
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    integration_type str
    Optional filter by integration type (e.g., OTEL).
    provider_type str
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    integrationType String
    Optional filter by integration type (e.g., OTEL).
    providerType String
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.

    getMetricIntegrations Result

    The following output properties are available:

    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    Results List<GetMetricIntegrationsResult>
    List of returned documents that MongoDB Cloud provides when completing this request.
    IntegrationType string
    Optional filter by integration type (e.g., OTEL).
    ProviderType string
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    Results []GetMetricIntegrationsResult
    List of returned documents that MongoDB Cloud provides when completing this request.
    IntegrationType string
    Optional filter by integration type (e.g., OTEL).
    ProviderType string
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    project_id string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    results list(object)
    List of returned documents that MongoDB Cloud provides when completing this request.
    integration_type string
    Optional filter by integration type (e.g., OTEL).
    provider_type string
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    results List<GetMetricIntegrationsResult>
    List of returned documents that MongoDB Cloud provides when completing this request.
    integrationType String
    Optional filter by integration type (e.g., OTEL).
    providerType String
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    results GetMetricIntegrationsResult[]
    List of returned documents that MongoDB Cloud provides when completing this request.
    integrationType string
    Optional filter by integration type (e.g., OTEL).
    providerType string
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    results Sequence[GetMetricIntegrationsResult]
    List of returned documents that MongoDB Cloud provides when completing this request.
    integration_type str
    Optional filter by integration type (e.g., OTEL).
    provider_type str
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    results List<Property Map>
    List of returned documents that MongoDB Cloud provides when completing this request.
    integrationType String
    Optional filter by integration type (e.g., OTEL).
    providerType String
    Optional filter by provider type (e.g., CUSTOM). When specified, integrationType must also be specified.

    Supporting Types

    GetMetricIntegrationsResult

    AggregationTemporality string
    The temporality to send to the metric integration.
    AuthType string
    Authentication method the integration uses when exporting metrics to the endpoint.
    Endpoint string
    OpenTelemetry collector endpoint URL.
    HeadersRedacteds List<GetMetricIntegrationsResultHeadersRedacted>
    HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
    IntegrationType string
    Type of metric integration. Identifies which protocol will be used for the integration.
    MetricIntegrationId string
    Unique identifier of the metric integration configuration.
    MetricSelections List<string>
    Array of metric categories to export. Determines which types of metrics are sent to the integration.
    ProviderType string
    The provider type for the metric integration. Identifies the third-party service provider.
    AggregationTemporality string
    The temporality to send to the metric integration.
    AuthType string
    Authentication method the integration uses when exporting metrics to the endpoint.
    Endpoint string
    OpenTelemetry collector endpoint URL.
    HeadersRedacteds []GetMetricIntegrationsResultHeadersRedacted
    HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
    IntegrationType string
    Type of metric integration. Identifies which protocol will be used for the integration.
    MetricIntegrationId string
    Unique identifier of the metric integration configuration.
    MetricSelections []string
    Array of metric categories to export. Determines which types of metrics are sent to the integration.
    ProviderType 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_id string
    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.
    provider_type string
    The provider type for the metric integration. Identifies the third-party service provider.
    aggregationTemporality String
    The temporality to send to the metric integration.
    authType String
    Authentication method the integration uses when exporting metrics to the endpoint.
    endpoint String
    OpenTelemetry collector endpoint URL.
    headersRedacteds List<GetMetricIntegrationsResultHeadersRedacted>
    HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
    integrationType String
    Type of metric integration. Identifies which protocol will be used for the integration.
    metricIntegrationId String
    Unique identifier of the metric integration configuration.
    metricSelections List<String>
    Array of metric categories to export. Determines which types of metrics are sent to the integration.
    providerType String
    The provider type for the metric integration. Identifies the third-party service provider.
    aggregationTemporality string
    The temporality to send to the metric integration.
    authType string
    Authentication method the integration uses when exporting metrics to the endpoint.
    endpoint string
    OpenTelemetry collector endpoint URL.
    headersRedacteds GetMetricIntegrationsResultHeadersRedacted[]
    HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
    integrationType string
    Type of metric integration. Identifies which protocol will be used for the integration.
    metricIntegrationId string
    Unique identifier of the metric integration configuration.
    metricSelections string[]
    Array of metric categories to export. Determines which types of metrics are sent to the integration.
    providerType 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[GetMetricIntegrationsResultHeadersRedacted]
    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_id str
    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.
    provider_type str
    The provider type for the metric integration. Identifies the third-party service provider.
    aggregationTemporality String
    The temporality to send to the metric integration.
    authType String
    Authentication method the integration uses when exporting metrics to the endpoint.
    endpoint String
    OpenTelemetry collector endpoint URL.
    headersRedacteds List<Property Map>
    HTTP headers for authentication and configuration. Values are redacted and never returned in plaintext.
    integrationType String
    Type of metric integration. Identifies which protocol will be used for the integration.
    metricIntegrationId String
    Unique identifier of the metric integration configuration.
    metricSelections List<String>
    Array of metric categories to export. Determines which types of metrics are sent to the integration.
    providerType String
    The provider type for the metric integration. Identifies the third-party service provider.

    GetMetricIntegrationsResultHeadersRedacted

    Name string
    Header name.
    Value string
    Redacted header value.
    Name string
    Header name.
    Value string
    Redacted header value.
    name string
    Header name.
    value string
    Redacted header value.
    name String
    Header name.
    value String
    Redacted header value.
    name string
    Header name.
    value string
    Redacted header value.
    name str
    Header name.
    value str
    Redacted header value.
    name String
    Header name.
    value String
    Redacted header value.

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo mongodbatlas logo
    Viewing docs for MongoDB Atlas v4.15.0
    published on Friday, Aug 28, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial