Skip to content

Commit

Permalink
[CC-26984] metric-export: add resource for prometheus integration (#200)
Browse files Browse the repository at this point in the history
* [CC-26984] metric-export: add resource for prometheus integration

This change introduces resource MetricExportPrometheusConfig which manages
prometheus metric export integration in gcp and aws cloud providers.

---------

Co-authored-by: Arjun Mahishi <arjun.mahishi@gmail.com>
  • Loading branch information
aa-joshi and arjunmahishi committed May 17, 2024
1 parent 7a41c89 commit bd06581
Show file tree
Hide file tree
Showing 9 changed files with 666 additions and 0 deletions.
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

0 comments on commit bd06581

Please sign in to comment.