Add time range filter in this prometheus.yml of metricbeat to get output for a particular time interval

Hello Team,
For metricbeat prometheus module we need output for a particular time interval.. How can we add the filter in at modules.d/prometheus.yml to get the output for a particular time interval.. Request for your help..
Current prometheus.yml file is as follows.. How we can add time range in this prometheus.yml of metricbeat?

$ cat modules.d/prometheus.yml
- module: prometheus
  hosts: ["http://localhost:9090"]
  metrics_path: '/federate'
  ssl.verification_mode: none
  period: 20m
  query: 
    'match[]':
       - '{__name__=~"container_cpu.*|container_memory.*|container_network.*|alertmanager_alerts.*|kube_node_info.*"}'
  metrics_filters:
     include: []
     exclude: []

  # Use Elasticsearch histogram type to store histograms (beta, default: false)
  # This will change the default layout and put metric type in the field name
  use_types: true

Hello! I don't think we support only collecting metrics from a set time frame in Metricbeat. But you can definitely do the filtering in Kibana after all the metrics are collected based on the timestamp field.

1 Like

Thanks @Kaiyan_Sheng for your help. Looking forward for your subject matter expertise for many further queries in future.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.