-
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 4 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 |
|---|---|---|
|
|
@@ -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 | ||
| } | ||
|
|
||
|
|
@@ -280,6 +280,24 @@ variable "container_filter" { | |
| } | ||
| } | ||
|
|
||
| variable "prometheus" { | ||
vkuma17 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| description = "Prometheus configuration for the agent. If you want to enable Prometheus configuration, set `file` to true and provide the prometheus.yaml file content in `yaml`. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-types.md#prometheus)." | ||
| type = object({ | ||
| file = bool | ||
vkuma17 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| yaml = map(any) | ||
|
||
| }) | ||
| default = { | ||
| file = false | ||
| yaml = {} | ||
| } | ||
| validation { | ||
| condition = ( | ||
| var.prometheus.file == false || length(keys(var.prometheus.yaml)) > 0 | ||
| ) | ||
| error_message = "If prometheus.file is true, 'yaml' must be a non-empty map." | ||
| } | ||
| } | ||
|
|
||
| ############################################################################## | ||
| # SCC-WP related variables | ||
| ############################################################################## | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.