Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CC-26984] metric-export: add resource for prometheus integration #200

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.7.0] - 2024-05-17

## Added

- New `cockroach_metric_export_prometheus_config` resource allows user to configure prometheus metric
export integration in AWS and GCP cloud providers.

## [1.6.0] - 2024-05-02

## Added
Expand Down
35 changes: 35 additions & 0 deletions docs/resources/metric_export_prometheus_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "cockroach_metric_export_prometheus_config Resource - terraform-provider-cockroach"
subcategory: ""
description: |-
Prometheus metric export configuration for a cluster. This is only available for dedicated clusters with AWS and GCP cloud providers.
---

# cockroach_metric_export_prometheus_config (Resource)

Prometheus metric export configuration for a cluster. This is only available for dedicated clusters with AWS and GCP cloud providers.

## Example Usage

```terraform
variable "cluster_id" {
type = string
}

resource "cockroach_metric_export_prometheus_config" "example" {
id = var.cluster_id
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) Cluster ID.

### Read-Only

- `status` (String) The current state of the metric export configuration. Possible values are: [`NOT_DEPLOYED` `DISABLING` `ENABLING` `ENABLED` `ERROR`]
- `targets` (Map of String) Represents prometheus scrape endpoint for each region. You can fetch endpoints either by executing `terraform state show {resource}` or by enabling terraform logs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
variable "cluster_id" {
type = string
}

resource "cockroach_metric_export_prometheus_config" "example" {
id = var.cluster_id
}
4 changes: 4 additions & 0 deletions examples/workflows/cockroach_metric_export/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,8 @@ resource "cockroach_metric_export_datadog_config" "example" {
id = cockroach_cluster.example.id
site = var.datadog_site
api_key = var.datadog_api_key
}

resource "cockroach_metric_export_prometheus_config" "example" {
id = cockroach_cluster.example.id
}
4 changes: 4 additions & 0 deletions examples/workflows/cockroach_metric_export/gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,7 @@ resource "cockroach_metric_export_datadog_config" "example" {
site = var.datadog_site
api_key = var.datadog_api_key
}

resource "cockroach_metric_export_prometheus_config" "example" {
id = cockroach_cluster.example.id
}
Loading
Loading