published on Tuesday, Oct 27, 2026 by Pulumi
published on Tuesday, Oct 27, 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!
terraform {
required_providers {
mongodbatlas = {
source = "pulumi/mongodbatlas"
}
}
}
data "mongodbatlas_metric_integration" "example" {
project_id = mongodbatlas_metric_integration.example.project_id
metric_integration_id = mongodbatlas_metric_integration.example.metric_integration_id
}
data "mongodbatlas_metric_integrations" "exampleGetMetricIntegrations" {
project_id = mongodbatlas_metric_integration.example.project_id
}
resource "datadog_api_key" "atlas_metrics" {
lifecycle {
create_before_destroy = true
}
name = "mongodb-atlas-metrics"
}
resource "mongodbatlas_metric_integration" "example" {
lifecycle {
create_before_destroy = true
}
project_id = project.id
integration_type = "OTEL"
provider_type = "CUSTOM"
auth_type = "HEADER"
aggregation_temporality = "DELTA"
endpoint = datadogEndpoint
metric_selection = ["ATLAS_STREAM_PROCESSING"]
headers = [{
name = "dd-api-key"
value = datadog_api_key.atlas_metrics.key
}]
}
output "metricIntegrationType" {
value = data.mongodbatlas_metric_integration.example.integration_type
}
output "metricIntegrationIds" {
value = [for r in data.mongodbatlas_metric_integrations.exampleGetMetricIntegrations.results : r.metricIntegrationId]
}
Further Examples
- Header-based — export Atlas metrics using header-based authentication.
- OAuth 2.0 — export Atlas metrics using OAuth 2.0 authentication.
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.
- Oauth
Get
Metric Integration Oauth - OAuth 2.0 configuration returned for a metric integration. Secrets are never returned.
- 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.
- Oauth
Get
Metric Integration Oauth - OAuth 2.0 configuration returned for a metric integration. Secrets are never returned.
- 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.
- oauth object
- OAuth 2.0 configuration returned for a metric integration. Secrets are never returned.
- 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.
- oauth
Get
Metric Integration Oauth - OAuth 2.0 configuration returned for a metric integration. Secrets are never returned.
- 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.
- oauth
Get
Metric Integration Oauth - OAuth 2.0 configuration returned for a metric integration. Secrets are never returned.
- 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.
- oauth
Get
Metric Integration Oauth - OAuth 2.0 configuration returned for a metric integration. Secrets are never returned.
- 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.
- oauth Property Map
- OAuth 2.0 configuration returned for a metric integration. Secrets are never returned.
- 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
GetMetricIntegrationOauth
- Client
Auth stringMethod - How the client authenticates to the token endpoint.
- Client
Id string - OAuth 2.0 client identifier registered with the token endpoint.
- Scopes List<string>
- OAuth 2.0 scopes requested on the token.
- Signing
Key GetInfo Metric Integration Oauth Signing Key Info - Read-only metadata for the Atlas-managed signing key used by
PRIVATE_KEY_JWT. Present only for that method. Register the jwks*uri with your identity provider. Atlas rotates the underlying key without changing this URL. - Token
Endpoint string - OAuth 2.0 token endpoint URL.
- Token
Request Dictionary<string, string>Params - Provider-specific parameters added to the token request.
- Client
Auth stringMethod - How the client authenticates to the token endpoint.
- Client
Id string - OAuth 2.0 client identifier registered with the token endpoint.
- Scopes []string
- OAuth 2.0 scopes requested on the token.
- Signing
Key GetInfo Metric Integration Oauth Signing Key Info - Read-only metadata for the Atlas-managed signing key used by
PRIVATE_KEY_JWT. Present only for that method. Register the jwks*uri with your identity provider. Atlas rotates the underlying key without changing this URL. - Token
Endpoint string - OAuth 2.0 token endpoint URL.
- Token
Request map[string]stringParams - Provider-specific parameters added to the token request.
- client_
auth_ stringmethod - How the client authenticates to the token endpoint.
- client_
id string - OAuth 2.0 client identifier registered with the token endpoint.
- scopes list(string)
- OAuth 2.0 scopes requested on the token.
- signing_
key_ objectinfo - Read-only metadata for the Atlas-managed signing key used by
PRIVATE_KEY_JWT. Present only for that method. Register the jwks*uri with your identity provider. Atlas rotates the underlying key without changing this URL. - token_
endpoint string - OAuth 2.0 token endpoint URL.
- token_
request_ map(string)params - Provider-specific parameters added to the token request.
- client
Auth StringMethod - How the client authenticates to the token endpoint.
- client
Id String - OAuth 2.0 client identifier registered with the token endpoint.
- scopes List<String>
- OAuth 2.0 scopes requested on the token.
- signing
Key GetInfo Metric Integration Oauth Signing Key Info - Read-only metadata for the Atlas-managed signing key used by
PRIVATE_KEY_JWT. Present only for that method. Register the jwks*uri with your identity provider. Atlas rotates the underlying key without changing this URL. - token
Endpoint String - OAuth 2.0 token endpoint URL.
- token
Request Map<String,String>Params - Provider-specific parameters added to the token request.
- client
Auth stringMethod - How the client authenticates to the token endpoint.
- client
Id string - OAuth 2.0 client identifier registered with the token endpoint.
- scopes string[]
- OAuth 2.0 scopes requested on the token.
- signing
Key GetInfo Metric Integration Oauth Signing Key Info - Read-only metadata for the Atlas-managed signing key used by
PRIVATE_KEY_JWT. Present only for that method. Register the jwks*uri with your identity provider. Atlas rotates the underlying key without changing this URL. - token
Endpoint string - OAuth 2.0 token endpoint URL.
- token
Request {[key: string]: string}Params - Provider-specific parameters added to the token request.
- client_
auth_ strmethod - How the client authenticates to the token endpoint.
- client_
id str - OAuth 2.0 client identifier registered with the token endpoint.
- scopes Sequence[str]
- OAuth 2.0 scopes requested on the token.
- signing_
key_ Getinfo Metric Integration Oauth Signing Key Info - Read-only metadata for the Atlas-managed signing key used by
PRIVATE_KEY_JWT. Present only for that method. Register the jwks*uri with your identity provider. Atlas rotates the underlying key without changing this URL. - token_
endpoint str - OAuth 2.0 token endpoint URL.
- token_
request_ Mapping[str, str]params - Provider-specific parameters added to the token request.
- client
Auth StringMethod - How the client authenticates to the token endpoint.
- client
Id String - OAuth 2.0 client identifier registered with the token endpoint.
- scopes List<String>
- OAuth 2.0 scopes requested on the token.
- signing
Key Property MapInfo - Read-only metadata for the Atlas-managed signing key used by
PRIVATE_KEY_JWT. Present only for that method. Register the jwks*uri with your identity provider. Atlas rotates the underlying key without changing this URL. - token
Endpoint String - OAuth 2.0 token endpoint URL.
- token
Request Map<String>Params - Provider-specific parameters added to the token request.
GetMetricIntegrationOauthSigningKeyInfo
- Algorithm string
- Signing algorithm of the Atlas-managed key.
- Created
At string - When the currently active signing key was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- Jwks
Uri string - Public JWKS URL serving this integration's signing keys. Fixed for the lifetime of the integration.
- Kid string
- Key ID stamped on client assertions, the
SHA-1thumbprint of the key certificate in uppercase hexadecimal. Changes when Atlas rotates the key.
- Algorithm string
- Signing algorithm of the Atlas-managed key.
- Created
At string - When the currently active signing key was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- Jwks
Uri string - Public JWKS URL serving this integration's signing keys. Fixed for the lifetime of the integration.
- Kid string
- Key ID stamped on client assertions, the
SHA-1thumbprint of the key certificate in uppercase hexadecimal. Changes when Atlas rotates the key.
- algorithm string
- Signing algorithm of the Atlas-managed key.
- created_
at string - When the currently active signing key was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- jwks_
uri string - Public JWKS URL serving this integration's signing keys. Fixed for the lifetime of the integration.
- kid string
- Key ID stamped on client assertions, the
SHA-1thumbprint of the key certificate in uppercase hexadecimal. Changes when Atlas rotates the key.
- algorithm String
- Signing algorithm of the Atlas-managed key.
- created
At String - When the currently active signing key was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- jwks
Uri String - Public JWKS URL serving this integration's signing keys. Fixed for the lifetime of the integration.
- kid String
- Key ID stamped on client assertions, the
SHA-1thumbprint of the key certificate in uppercase hexadecimal. Changes when Atlas rotates the key.
- algorithm string
- Signing algorithm of the Atlas-managed key.
- created
At string - When the currently active signing key was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- jwks
Uri string - Public JWKS URL serving this integration's signing keys. Fixed for the lifetime of the integration.
- kid string
- Key ID stamped on client assertions, the
SHA-1thumbprint of the key certificate in uppercase hexadecimal. Changes when Atlas rotates the key.
- algorithm str
- Signing algorithm of the Atlas-managed key.
- created_
at str - When the currently active signing key was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- jwks_
uri str - Public JWKS URL serving this integration's signing keys. Fixed for the lifetime of the integration.
- kid str
- Key ID stamped on client assertions, the
SHA-1thumbprint of the key certificate in uppercase hexadecimal. Changes when Atlas rotates the key.
- algorithm String
- Signing algorithm of the Atlas-managed key.
- created
At String - When the currently active signing key was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC.
- jwks
Uri String - Public JWKS URL serving this integration's signing keys. Fixed for the lifetime of the integration.
- kid String
- Key ID stamped on client assertions, the
SHA-1thumbprint of the key certificate in uppercase hexadecimal. Changes when Atlas rotates the key.
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlasTerraform Provider.
published on Tuesday, Oct 27, 2026 by Pulumi