Skip to content

Commit

Permalink
fix: modify doc
Browse files Browse the repository at this point in the history
  • Loading branch information
gitmkn committed Feb 5, 2024
1 parent b9a8fa4 commit fbbef40
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,66 @@ resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration
cluster_id = ""
kube_type = 3
}
```

Integration Center: CVM Scrape Job

```
resource "tencentcloud_vpc" "vpc" {
name = "tf-eks-vpc"
cidr_block = "10.2.0.0/16"
}
resource "tencentcloud_subnet" "sub" {
vpc_id = tencentcloud_vpc.vpc.id
name = "tf-as-subnet"
cidr_block = "10.2.11.0/24"
availability_zone = "ap-guangzhou-3"
}
resource "tencentcloud_monitor_tmp_instance" "tmpInstance" {
instance_name = "tf-test-tmp"
vpc_id = tencentcloud_vpc.vpc.id
subnet_id = tencentcloud_subnet.sub.id
data_retention_time = 15
zone = "ap-guangzhou-3"
tags = {
"createdBy" = "terraform"
}
}
# Integration Center: CVM Scrape Job
resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration" {
instance_id = tencentcloud_monitor_tmp_instance.tmpInstance.id
kind = "cvm-http-sd-exporter"
content = jsonencode({
"kind": "cvm-http-sd-exporter",
"spec": {
"job": <<-EOT
job_name: example-cvm-job-name
metrics_path: /metrics
cvm_sd_configs:
- region: ap-guangzhou
ports:
- 9100
filters:
- name: tag:YOUR_TAG_KEY
values:
- YOUR_TAG_VALUE
relabel_configs:
- source_labels: [__meta_cvm_instance_state]
regex: RUNNING
action: keep
- regex: __meta_cvm_tag_(.*)
replacement: $1
action: labelmap
- source_labels: [__meta_cvm_region]
target_label: region
action: replace
EOT
}
})
kube_type = 3
cluster_id = ""
}
```
62 changes: 62 additions & 0 deletions website/docs/r/monitor_tmp_exporter_integration.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,68 @@ resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration
}
```

### Integration Center: CVM Scrape Job

```hcl
resource "tencentcloud_vpc" "vpc" {
name = "tf-eks-vpc"
cidr_block = "10.2.0.0/16"
}
resource "tencentcloud_subnet" "sub" {
vpc_id = tencentcloud_vpc.vpc.id
name = "tf-as-subnet"
cidr_block = "10.2.11.0/24"
availability_zone = "ap-guangzhou-3"
}
resource "tencentcloud_monitor_tmp_instance" "tmpInstance" {
instance_name = "tf-test-tmp"
vpc_id = tencentcloud_vpc.vpc.id
subnet_id = tencentcloud_subnet.sub.id
data_retention_time = 15
zone = "ap-guangzhou-3"
tags = {
"createdBy" = "terraform"
}
}
# Integration Center: CVM Scrape Job
resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration" {
instance_id = tencentcloud_monitor_tmp_instance.tmpInstance.id
kind = "cvm-http-sd-exporter"
content = jsonencode({
"kind" : "cvm-http-sd-exporter",
"spec" : {
"job" : <<-EOT
job_name: example-cvm-job-name
metrics_path: /metrics
cvm_sd_configs:
- region: ap-guangzhou
ports:
- 9100
filters:
- name: tag:YOUR_TAG_KEY
values:
- YOUR_TAG_VALUE
relabel_configs:
- source_labels: [__meta_cvm_instance_state]
regex: RUNNING
action: keep
- regex: __meta_cvm_tag_(.*)
replacement: $1
action: labelmap
- source_labels: [__meta_cvm_region]
target_label: region
action: replace
EOT
}
})
kube_type = 3
cluster_id = ""
}
```

## Argument Reference

The following arguments are supported:
Expand Down

0 comments on commit fbbef40

Please sign in to comment.