-
Notifications
You must be signed in to change notification settings - Fork 4
feat: added support for prometheus metrics scraping #167
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
Changes from 6 commits
61ff3bb
cddf677
28d0771
85bd171
602ae79
b4cba3b
586a02c
5de25b7
65d3c0e
a5bae35
9bf9af7
5208d98
813bdd5
5a0d67e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,3 +39,9 @@ variable "datacenter" { | |
| description = "If creating a classic cluster, the data center where the cluster is created" | ||
| default = "syd01" | ||
| } | ||
|
|
||
| variable "prometheus_config" { | ||
| description = "Prometheus configuration for the agent. If you want to enable Prometheus configuration provide the prometheus.yaml file content in `hcl` format. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-types.md#prometheus)." | ||
|
||
| type = map(any) | ||
| default = {} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,3 +47,56 @@ type = list(object({ | |
|
|
||
| **Tip:** | ||
| Use `metrics_filter` to optimize your monitoring setup by collecting only the metrics that matter most to your use case. This can help reduce costs and improve performance. | ||
|
|
||
| ## `prometheus` | ||
|
||
|
|
||
| The `prometheus` variable allows you to enable sysdig agent to scrape metrics from processes that expose Prometheus metric endpoints on its own host and send findings to the Sysdig collector for storing and further processing. | ||
vkuma17 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Type | ||
|
|
||
| ```hcl | ||
| object({ | ||
| file = bool | ||
| yaml = map(any) | ||
| }) | ||
| ``` | ||
|
|
||
| ### Example Usage | ||
|
|
||
| ```hcl | ||
| { | ||
| file = true | ||
| yaml = { | ||
| scrape_configs = [ | ||
| { | ||
| job_name = "testing-prometheus-scrape" | ||
| tls_config = { | ||
| insecure_skip_verify = true | ||
| } | ||
| kubernetes_sd_configs = [ | ||
| { | ||
| role = "pod" | ||
| } | ||
| ] | ||
| relabel_configs = [ | ||
| { | ||
| action = "keep" | ||
| source_labels = ["__meta_kubernetes_pod_host_ip"] | ||
| regex = "__HOSTIPS__" | ||
| }, | ||
| { | ||
| action = "drop" | ||
| source_labels = ["__meta_kubernetes_pod_annotation_promcat_sysdig_com_omit"] | ||
| regex = "true" | ||
| }, | ||
| { | ||
| source_labels = ["__meta_kubernetes_pod_phase"] | ||
| action = "keep" | ||
| regex = "Running" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -236,7 +236,7 @@ variable "agent_limits_memory" { | |
|
|
||
| variable "enable_universal_ebpf" { | ||
| type = bool | ||
| description = "Deploy monitoring agent with universal extended Berkeley Packet Filter (eBPF) enabled. It requires kernel version 5.8+. Learn more: https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-docs.md#when-to-enable-enable_universal_ebpf" | ||
| description = "Deploy monitoring agent with universal extended Berkeley Packet Filter (eBPF) enabled. It requires kernel version 5.8+. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-docs.md#when-to-enable-enable_universal_ebpf)" | ||
| default = true | ||
| } | ||
|
|
||
|
|
@@ -290,6 +290,12 @@ variable "container_filter" { | |
| } | ||
| } | ||
|
|
||
| variable "prometheus_config" { | ||
| description = "Prometheus configuration for the agent. If you want to enable Prometheus configuration provide the prometheus.yaml file content in `hcl` format. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-types.md#prometheus)." | ||
|
||
| type = map(any) | ||
| default = {} | ||
ocofaigh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| ############################################################################## | ||
| # SCC-WP related variables | ||
| ############################################################################## | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its probably better to hard code a sample value in the example itself instead of exposing a variable. That way people can see a sample value that can be passed. We don't usually expose variables like this in examples as we don't want the example to become flexible solution thats people will use. they are just for reference