receivers: prometheus: config: global: scrape_interval: 1m scrape_timeout: 10s scrape_configs: - job_name: 'kubernetes-pod-fluentbit-plugin' sample_limit: 10000 metrics_path: /api/v1/metrics/prometheus kubernetes_sd_configs: - role: pod relabel_configs: - source_labels: [ __meta_kubernetes_pod_container_name ] action: keep regex: '^fluent-bit.*$' - source_labels: [ __address__ ] action: replace regex: ([^:]+)(?::\d+)? replacement: ${1}:2020 target_label: __address__ - action: labelmap regex: __meta_kubernetes_pod_label_(.+) - action: replace source_labels: - __meta_kubernetes_namespace target_label: Namespace - source_labels: [ __meta_kubernetes_pod_name ] action: replace target_label: pod_name - action: replace source_labels: - __meta_kubernetes_pod_container_name target_label: container_name - action: replace source_labels: - __meta_kubernetes_pod_controller_name target_label: pod_controller_name - action: replace source_labels: - __meta_kubernetes_pod_controller_kind target_label: pod_controller_kind - action: replace source_labels: - __meta_kubernetes_pod_phase target_label: pod_phase - action: replace source_labels: - __meta_kubernetes_pod_node_name - job_name: kubernetes-service-endpoints sample_limit: 10000 kubernetes_sd_configs: - role: endpoints relabel_configs: - action: keep regex: true source_labels: - __meta_kubernetes_service_annotation_prometheus_io_scrape - action: replace regex: (https?) source_labels: - __meta_kubernetes_service_annotation_prometheus_io_scheme target_label: __scheme__ - action: replace regex: (.+) source_labels: - __meta_kubernetes_service_annotation_prometheus_io_path target_label: __metrics_path__ - action: replace regex: ([^:]+)(?::\d+)?;(\d+) replacement: $$1:$$2 source_labels: - __address__ - __meta_kubernetes_service_annotation_prometheus_io_port target_label: __address__ - action: labelmap regex: __meta_kubernetes_service_label_(.+) - action: replace source_labels: - __meta_kubernetes_namespace target_label: Namespace - action: replace source_labels: - __meta_kubernetes_service_name target_label: Service - action: replace source_labels: - __meta_kubernetes_pod_node_name target_label: kubernetes_node - action: replace source_labels: - __meta_kubernetes_pod_name target_label: pod_name - action: replace source_labels: - __meta_kubernetes_pod_container_name target_label: container_name metric_relabel_configs: - source_labels: [ __name__ ] regex: 'go_gc_duration_seconds.*' action: drop - source_labels: [ __name__, proxy ] regex: "haproxy_frontend.+;(.+)" target_label: frontend replacement: "$$1" - source_labels: [ __name__, proxy ] regex: "haproxy_server.+;(.+)" target_label: backend replacement: "$$1" - source_labels: [ __name__, proxy ] regex: "haproxy_backend.+;(.+)" target_label: backend replacement: "$$1" - regex: proxy action: labeldrop processors: resourcedetection/ec2: detectors: [ env ] timeout: 2s override: false resource: attributes: - key: TaskId from_attribute: service.name action: insert - key: receiver value: "prometheus" action: insert exporters: awsemf: namespace: ContainerInsights/Prometheus log_group_name: "/aws/containerinsights/{ClusterName}/prometheus" log_stream_name: "{TaskId}" resource_to_telemetry_conversion: enabled: true dimension_rollup_option: NoDimensionRollup metric_declarations: - dimensions: [ [ Service, Namespace, ClusterName, frontend, code ] ] metric_name_selectors: - "^haproxy_frontend_http_responses_total$" label_matchers: - label_names: - Service - frontend regex: ".*haproxy-ingress-.*metrics;(httpfront-shared-frontend|httpfront-default-backend|httpsfront|_front_http)" - dimensions: [ [ Service, Namespace, ClusterName, backend, code ] ] metric_name_selectors: - "^haproxy_backend_http_responses_total$" label_matchers: - label_names: - Service - backend regex: ".*haproxy-ingress-.*metrics;(httpback-shared-backend|httpback-default-backend|httpsback-shared-backend|_default_backend|.*backend_http)" - dimensions: [ [ Service, Namespace, ClusterName ] ] metric_name_selectors: - "^haproxy_backend_up$" - "^haproxy_backend_status$" - "^haproxy_backend_bytes_(in|out)_total$" - "^haproxy_backend_connections_total$" - "^haproxy_backend_connection_errors_total$" - "^haproxy_backend_current_sessions$" - "^haproxy_frontend_bytes_(in|out)_total$" - "^haproxy_frontend_connections_total$" - "^haproxy_frontend_http_requests_total$" - "^haproxy_frontend_request_errors_total$" - "^haproxy_frontend_requests_denied_total$" - "^haproxy_frontend_current_sessions$" label_matchers: - label_names: - Service regex: ".*haproxy-ingress-.*metrics" service: pipelines: metrics: receivers: [ prometheus ] processors: [ resourcedetection/ec2, resource ] exporters: [ awsemf ]