1. Registry
  2. Packages
  3. Mongodbatlas Provider
  4. API Docs
  5. getMetricIntegration
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.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 dictionary
    data "mongodbatlas_get_metric_integration" "name" {
        # arguments
    }

    The following arguments are supported:

    MetricIntegrationId string
    Unique identifier of the metric integration configuration.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    MetricIntegrationId string
    Unique identifier of the metric integration configuration.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    metric_integration_id string
    Unique identifier of the metric integration configuration.
    project_id string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    metricIntegrationId String
    Unique identifier of the metric integration configuration.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    metricIntegrationId string
    Unique identifier of the metric integration configuration.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    metric_integration_id str
    Unique identifier of the metric integration configuration.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    metricIntegrationId String
    Unique identifier of the metric integration configuration.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.

    getMetricIntegration Result

    The following output properties are available:

    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<GetMetricIntegrationHeadersRedacted>
    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.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    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 []GetMetricIntegrationHeadersRedacted
    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.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    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.
    project_id string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    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<GetMetricIntegrationHeadersRedacted>
    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.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    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 GetMetricIntegrationHeadersRedacted[]
    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.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    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[GetMetricIntegrationHeadersRedacted]
    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.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    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.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    providerType String
    The provider type for the metric integration. Identifies the third-party service provider.

    Supporting Types

    GetMetricIntegrationHeadersRedacted

    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