Skip to content

Commit

Permalink
Doc changes for Integrations and Metrics Export (#136)
Browse files Browse the repository at this point in the history
* Sunset date for deprecated resource ybm_metrics_exporter and deprecation message

* Integration and Metrics export doc improvements

* Prometheus and VictoriaMetrics docs
  • Loading branch information
bansal01yash authored Nov 27, 2024
1 parent ee7f4da commit 2c288e9
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Read-Only:

Read-Only:

- `endpoint` (String) Prometheus OTLP endpoint URL e.g. http://prometheus.yourcompany.com/api/v1/otlp
- `endpoint` (String) Prometheus OTLP endpoint URL e.g. http://my-prometheus-endpoint/api/v1/otlp


<a id="nestedatt--sumologic_spec"></a>
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/associate_metrics_exporter_cluster.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
page_title: "ybm_associate_metrics_exporter_cluster Resource - YugabyteDB Aeon"
description: |-
The resource to associate a metrics exporter config to a cluster in YugabyteDB Aeon.
The resource to manage metrics export configuration for a cluster in YugabyteDB Aeon.
---

# ybm_associate_metrics_exporter_cluster (Resource)

The resource to associate a metrics exporter config to a cluster in YugabyteDB Aeon.
The resource to manage metrics export configuration for a cluster in YugabyteDB Aeon.


## Example Usage
Expand Down
35 changes: 32 additions & 3 deletions docs/resources/integration.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
---
page_title: "ybm_integration Resource - YugabyteDB Aeon"
description: |-
The resource to create an integration in YugabyteDB Aeon.
The resource to create an export configuration for the integration you want to use in YugabyteDB Aeon.
Using the configuration you created, connect to your cluster:
- Export metrics using resource ybm_associate_metrics_exporter_cluster
---

# ybm_integration (Resource)

The resource to create an integration in YugabyteDB Aeon.
The resource to create an export configuration for the integration you want to use in YugabyteDB Aeon.

Using the configuration you created, connect to your cluster:
- Export metrics using resource `ybm_associate_metrics_exporter_cluster`


## Example Usage
Expand Down Expand Up @@ -53,6 +58,30 @@ resource "ybm_integration" "sumologic" {
}
```

To create Prometheus integration

```terraform
resource "ybm_integration" "prometheus" {
config_name = "prometheus-example"
type = "PROMETHEUS"
prometheus_spec = {
endpoint = "http://my-prometheus-endpoint/api/v1/otlp"
}
}
```

To create VictoriaMetrics integration

```terraform
resource "ybm_integration" "victoriametrics" {
config_name = "victoriametrics-example"
type = "VICTORIAMETRICS"
victoriametrics_spec = {
endpoint = "http://my-victoria-metrics-endpoint/opentelemetry"
}
}
```

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

Expand Down Expand Up @@ -123,7 +152,7 @@ Required:

Required:

- `endpoint` (String) Prometheus OTLP endpoint URL e.g. http://prometheus.yourcompany.com/api/v1/otlp
- `endpoint` (String) Prometheus OTLP endpoint URL e.g. http://my-prometheus-endpoint/api/v1/otlp


<a id="nestedatt--sumologic_spec"></a>
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/metrics_exporter.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
page_title: "ybm_metrics_exporter Resource - YugabyteDB Aeon"
description: |-
[DEPRECATED] Please use ybm_integration instead.
The resource to create a metrics exporter config in YugabyteDB Aeon.
[DEPRECATED] The resource to create a metrics exporter config in YugabyteDB Aeon.
This resource has been deprecated on 2024-11-30 and will be supported until 2025-2-28. Please use ybm_integration instead.
---

# ybm_metrics_exporter (Resource)

[DEPRECATED] Please use `ybm_integration` instead.
[DEPRECATED] The resource to create a metrics exporter config in YugabyteDB Aeon.

The resource to create a metrics exporter config in YugabyteDB Aeon.
This resource has been deprecated on 2024-11-30 and will be supported until 2025-2-28. Please use `ybm_integration` instead.


## Example Usage
Expand Down
7 changes: 7 additions & 0 deletions examples/resources/ybm_integration/prometheus-integration.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "ybm_integration" "prometheus" {
config_name = "prometheus-example"
type = "PROMETHEUS"
prometheus_spec = {
endpoint = "http://my-prometheus-endpoint/api/v1/otlp"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "ybm_integration" "victoriametrics" {
config_name = "victoriametrics-example"
type = "VICTORIAMETRICS"
victoriametrics_spec = {
endpoint = "http://my-victoria-metrics-endpoint/opentelemetry"
}
}
2 changes: 1 addition & 1 deletion managed/data_source_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (r dataSourceIntegrationType) GetSchema(_ context.Context) (tfsdk.Schema, d
Computed: true,
Attributes: tfsdk.SingleNestedAttributes(map[string]tfsdk.Attribute{
"endpoint": {
Description: "Prometheus OTLP endpoint URL e.g. http://prometheus.yourcompany.com/api/v1/otlp",
Description: "Prometheus OTLP endpoint URL e.g. http://my-prometheus-endpoint/api/v1/otlp",
Type: types.StringType,
Computed: true,
},
Expand Down
2 changes: 1 addition & 1 deletion managed/resource_associate_me_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type resourceAssociateMetricsExporterClusterType struct{}

func (r resourceAssociateMetricsExporterClusterType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
Description: `The resource to associate a metrics exporter config to a cluster in YugabyteDB Aeon.`,
Description: `The resource to manage metrics export configuration for a cluster in YugabyteDB Aeon.`,
Attributes: map[string]tfsdk.Attribute{
"account_id": {
Description: "The ID of the account this private service endpoint belongs to.",
Expand Down
9 changes: 6 additions & 3 deletions managed/resource_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ type resourceIntegrationType struct{}

func (r resourceIntegrationType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
Description: "The resource to create an integration in YugabyteDB Aeon.",
Attributes: r.getSchemaAttributes(),
Description: `The resource to create an export configuration for the integration you want to use in YugabyteDB Aeon.
Using the configuration you created, connect to your cluster:
- Export metrics using resource ` + "`ybm_associate_metrics_exporter_cluster`",
Attributes: r.getSchemaAttributes(),
}, nil
}

Expand Down Expand Up @@ -86,7 +89,7 @@ func (r resourceIntegrationType) getSchemaAttributes() map[string]tfsdk.Attribut
Validators: onlyContainsPath("prometheus_spec"),
Attributes: tfsdk.SingleNestedAttributes(map[string]tfsdk.Attribute{
"endpoint": {
Description: "Prometheus OTLP endpoint URL e.g. http://prometheus.yourcompany.com/api/v1/otlp",
Description: "Prometheus OTLP endpoint URL e.g. http://my-prometheus-endpoint/api/v1/otlp",
Type: types.StringType,
Required: true,
},
Expand Down
5 changes: 3 additions & 2 deletions managed/resource_metrics_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ type resourceMetricsExporterType struct{}

func (r resourceMetricsExporterType) GetSchema(_ context.Context) (tfsdk.Schema, diag.Diagnostics) {
return tfsdk.Schema{
Description: `[DEPRECATED] Please use ` + "`ybm_integration`" + ` instead.
Description: `[DEPRECATED] The resource to create a metrics exporter config in YugabyteDB Aeon.
The resource to create a metrics exporter config in YugabyteDB Aeon.`,
This resource has been deprecated on 2024-11-30 and will be supported until 2025-2-28. Please use ` + "`ybm_integration`" + ` instead.`,
DeprecationMessage: `This resource has been deprecated on 2024-11-30 and will be supported until 2025-2-28. Please use ` + "`ybm_integration`" + ` instead.`,
Attributes: map[string]tfsdk.Attribute{
"account_id": {
Description: "The ID of the account this metrics exporter config belongs to.",
Expand Down
8 changes: 8 additions & 0 deletions templates/resources/integration.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ To create Sumologic integration

{{ tffile "examples/resources/ybm_integration/sumologic-integration.tf" }}

To create Prometheus integration

{{ tffile "examples/resources/ybm_integration/prometheus-integration.tf" }}

To create VictoriaMetrics integration

{{ tffile "examples/resources/ybm_integration/victoriametrics-integration.tf" }}

{{ .SchemaMarkdown | trimspace }}

0 comments on commit 2c288e9

Please sign in to comment.