elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
103 stars 4.92k forks source link

How prometheus remote_write to metricbeat #41471

Open pretystar opened 2 weeks ago

pretystar commented 2 weeks ago

Hey,

I am new to elasti stack.

I want to use prometheus remote_write to send metric to metricbeat.

I deployed metricbeat to k8s with configmap updated:

apiVersion: v1
kind: ConfigMap
metadata:
  name: metricbeat-daemonset-config
  namespace: kube-system
  labels:
    k8s-app: metricbeat
data:
  metricbeat.yml: |-
    metricbeat.modules:
    - module: prometheus
      metricsets: ["remote_write"]
      host: "0.0.0.0"
      port: "9201"
      use_types: true
      rate_counters: true
      period: 60s

expose port and service:

apiVersion: v1
kind: Service
metadata:
  name: metricbeat
  namespace: kube-system
  labels:
    k8s-app: metricbeat
spec:
  ports:
    - port: 9201
      protocol: TCP
      targetPort: 9201
  selector:
    k8s-app: metricbeat
  sessionAffinity: None
  type: ClusterIP

and I enabled the remote write to metricbeat in prometheus:

- url: http://metricbeat.kube-system:9201/write
  remote_timeout: 30s
  follow_redirects: true
  enable_http2: true
  queue_config:
    capacity: 20000
    max_shards: 3
    min_shards: 1
    max_samples_per_send: 10000
    batch_send_deadline: 5s
    min_backoff: 30ms
    max_backoff: 5s

My question is:

  1. How can check that prometheus send the data to metricbeat
  2. How can I query the metric from prometheus in kibana? any examples?
botelastic[bot] commented 2 weeks ago

This issue doesn't have a Team:<team> label.