Skip to content
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

feat: enable polyglot otel config #287

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/eks-monitoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ See examples using this Terraform modules in the **Amazon EKS** section of [this
| <a name="input_enable_nginx"></a> [enable\_nginx](#input\_enable\_nginx) | Enable NGINX workloads monitoring, alerting and default dashboards | `bool` | `false` | no |
| <a name="input_enable_node_exporter"></a> [enable\_node\_exporter](#input\_enable\_node\_exporter) | Enables or disables Node exporter. Disabling this might affect some data in the dashboards | `bool` | `true` | no |
| <a name="input_enable_nvidia_monitoring"></a> [enable\_nvidia\_monitoring](#input\_enable\_nvidia\_monitoring) | Enables monitoring of nvidia metrics | `bool` | `true` | no |
| <a name="input_enable_polyglot"></a> [enable\_polyglot](#input\_enable\_polyglot) | Enable monitoring for .Net,Rust and other languages | `bool` | `false` | no |
| <a name="input_enable_recording_rules"></a> [enable\_recording\_rules](#input\_enable\_recording\_rules) | Enables or disables Managed Prometheus recording rules | `bool` | `true` | no |
| <a name="input_enable_tracing"></a> [enable\_tracing](#input\_enable\_tracing) | Enables tracing with OTLP traces receiver to X-Ray | `bool` | `true` | no |
| <a name="input_flux_config"></a> [flux\_config](#input\_flux\_config) | FluxCD configuration | <pre>object({<br> create_namespace = optional(bool, true)<br> k8s_namespace = optional(string, "flux-system")<br> helm_chart_name = optional(string, "flux2")<br> helm_chart_version = optional(string, "2.12.2")<br> helm_release_name = optional(string, "observability-fluxcd-addon")<br> helm_repo_url = optional(string, "https://fluxcd-community.github.io/helm-charts")<br> helm_settings = optional(map(string), {})<br> helm_values = optional(map(any), {})<br> })</pre> | `{}` | no |
Expand Down
10 changes: 10 additions & 0 deletions modules/eks-monitoring/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ module "helm_addon" {
name = "enableIstio"
value = var.enable_istio
},
{
name = "enablePolyglot"
value = var.enable_polyglot
},
{
name = "istioScrapeSampleLimit"
value = try(var.istio_config.scrape_sample_limit, local.istio_pattern_config.scrape_sample_limit)
Expand Down Expand Up @@ -237,20 +241,26 @@ module "java_monitoring" {
count = var.enable_java ? 1 : 0

pattern_config = coalesce(var.java_config, local.java_pattern_config)

depends_on = [resource.helm_release.fluxcd]
}

module "nginx_monitoring" {
source = "./patterns/nginx"
count = var.enable_nginx ? 1 : 0

pattern_config = local.nginx_pattern_config

depends_on = [resource.helm_release.fluxcd]
}

module "istio_monitoring" {
source = "./patterns/istio"
count = var.enable_istio ? 1 : 0

pattern_config = coalesce(var.istio_config, local.istio_pattern_config)

depends_on = [resource.helm_release.fluxcd]
}

module "fluentbit_logs" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,12 @@ spec:
action: drop
{{ end }}

{{ if .Values.enablePolyglot }}
- job_name: 'kubernetes-polyglot'
kubernetes_sd_configs:
- role: pod
Comment on lines +1391 to +1392
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit wide, as without any relabel config or port capture, it would capture any exposed metrics at the pod level unless i'm missing something. Can you make it more specific to what you are collecting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bonclay7 Happy to discuss this on a call. We are going to setup .net, Rust,Go and other dashboards as part of the RI workshop. We opened up all the pods (defaulted to false and only explicitly set to true) for the usecase. Once we finalize all the metrics for all these languages/apps and understand what filters we need to apply we will apply them along with corresponding dashboards similar to how its implemented for Java.

{{ end }}

{{ if .Values.enableNginx }}
- job_name: 'kubernetes-nginx'
sample_limit: {{ .Values.nginxScrapeSampleLimit }}
Expand Down
2 changes: 2 additions & 0 deletions modules/eks-monitoring/otel-config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@ adotServiceTelemetryLoglevel: ${adot_service_telemetry_loglevel}

enableAdotcollectorMetrics: ${enable_adotcollector_metrics}

enablePolyglot: ${enable_polyglot}

serviceAccount: ${service_account}
namespace: ${namespace}
6 changes: 6 additions & 0 deletions modules/eks-monitoring/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -565,3 +565,9 @@ variable "kubeproxy_monitoring_config" {
# defaults are pre-computed in locals.tf, provide a full definition to override
default = null
}

variable "enable_polyglot" {
description = "Enable monitoring for .Net,Rust and other languages"
type = bool
default = false
}
Loading