Skip to content

Commit 2a86e77

Browse files
authored
fix: modify doc (#2527)
* fix: modify doc * feat: add changlog
1 parent f07c1b7 commit 2a86e77

File tree

3 files changed

+127
-0
lines changed

3 files changed

+127
-0
lines changed

.changelog/2527.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_monitor_tmp_exporter_integration: Documentation example added.
3+
```

tencentcloud/services/tmp/resource_tc_monitor_tmp_exporter_integration.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,66 @@ resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration
4747
cluster_id = ""
4848
kube_type = 3
4949
}
50+
```
51+
52+
Integration Center: CVM Scrape Job
53+
54+
```
55+
resource "tencentcloud_vpc" "vpc" {
56+
name = "tf-eks-vpc"
57+
cidr_block = "10.2.0.0/16"
58+
}
59+
60+
resource "tencentcloud_subnet" "sub" {
61+
vpc_id = tencentcloud_vpc.vpc.id
62+
name = "tf-as-subnet"
63+
cidr_block = "10.2.11.0/24"
64+
availability_zone = "ap-guangzhou-3"
65+
}
66+
67+
resource "tencentcloud_monitor_tmp_instance" "tmpInstance" {
68+
instance_name = "tf-test-tmp"
69+
vpc_id = tencentcloud_vpc.vpc.id
70+
subnet_id = tencentcloud_subnet.sub.id
71+
data_retention_time = 15
72+
zone = "ap-guangzhou-3"
73+
tags = {
74+
"createdBy" = "terraform"
75+
}
76+
}
77+
78+
# Integration Center: CVM Scrape Job
79+
resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration" {
80+
instance_id = tencentcloud_monitor_tmp_instance.tmpInstance.id
81+
kind = "cvm-http-sd-exporter"
82+
content = jsonencode({
83+
"kind": "cvm-http-sd-exporter",
84+
"spec": {
85+
"job": <<-EOT
86+
job_name: example-cvm-job-name
87+
metrics_path: /metrics
88+
cvm_sd_configs:
89+
- region: ap-guangzhou
90+
ports:
91+
- 9100
92+
filters:
93+
- name: tag:YOUR_TAG_KEY
94+
values:
95+
- YOUR_TAG_VALUE
96+
relabel_configs:
97+
- source_labels: [__meta_cvm_instance_state]
98+
regex: RUNNING
99+
action: keep
100+
- regex: __meta_cvm_tag_(.*)
101+
replacement: $1
102+
action: labelmap
103+
- source_labels: [__meta_cvm_region]
104+
target_label: region
105+
action: replace
106+
EOT
107+
}
108+
})
109+
kube_type = 3
110+
cluster_id = ""
111+
}
50112
```

website/docs/r/monitor_tmp_exporter_integration.html.markdown

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,68 @@ resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration
6060
}
6161
```
6262

63+
### Integration Center: CVM Scrape Job
64+
65+
```hcl
66+
resource "tencentcloud_vpc" "vpc" {
67+
name = "tf-eks-vpc"
68+
cidr_block = "10.2.0.0/16"
69+
}
70+
71+
resource "tencentcloud_subnet" "sub" {
72+
vpc_id = tencentcloud_vpc.vpc.id
73+
name = "tf-as-subnet"
74+
cidr_block = "10.2.11.0/24"
75+
availability_zone = "ap-guangzhou-3"
76+
}
77+
78+
resource "tencentcloud_monitor_tmp_instance" "tmpInstance" {
79+
instance_name = "tf-test-tmp"
80+
vpc_id = tencentcloud_vpc.vpc.id
81+
subnet_id = tencentcloud_subnet.sub.id
82+
data_retention_time = 15
83+
zone = "ap-guangzhou-3"
84+
tags = {
85+
"createdBy" = "terraform"
86+
}
87+
}
88+
89+
# Integration Center: CVM Scrape Job
90+
resource "tencentcloud_monitor_tmp_exporter_integration" "tmpExporterIntegration" {
91+
instance_id = tencentcloud_monitor_tmp_instance.tmpInstance.id
92+
kind = "cvm-http-sd-exporter"
93+
content = jsonencode({
94+
"kind" : "cvm-http-sd-exporter",
95+
"spec" : {
96+
"job" : <<-EOT
97+
job_name: example-cvm-job-name
98+
metrics_path: /metrics
99+
cvm_sd_configs:
100+
- region: ap-guangzhou
101+
ports:
102+
- 9100
103+
filters:
104+
- name: tag:YOUR_TAG_KEY
105+
values:
106+
- YOUR_TAG_VALUE
107+
relabel_configs:
108+
- source_labels: [__meta_cvm_instance_state]
109+
regex: RUNNING
110+
action: keep
111+
- regex: __meta_cvm_tag_(.*)
112+
replacement: $1
113+
action: labelmap
114+
- source_labels: [__meta_cvm_region]
115+
target_label: region
116+
action: replace
117+
EOT
118+
}
119+
})
120+
kube_type = 3
121+
cluster_id = ""
122+
}
123+
```
124+
63125
## Argument Reference
64126

65127
The following arguments are supported:

0 commit comments

Comments
 (0)