# Grouping metrics by env

**URL:** <https://discuss.elastic.co/t/grouping-metrics-by-env/342211>\
**Category:** Kibana\
**Created:** [September 4, 2023, 5:09am UTC](https://discuss.elastic.co/t/grouping-metrics-by-env/342211 "2023-09-04T05:09:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Supun\_Madushanka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/supun_madushanka/32/79828_2.png) [@Supun\_Madushanka](https://discuss.elastic.co/u/Supun_Madushanka)\
**Post date:** [September 4, 2023, 5:09am UTC](https://discuss.elastic.co/t/grouping-metrics-by-env/342211/1 "2023-09-04T05:09:05Z")

</div>

```auto
metricbeat.config.modules:
        path: ${path.config}/modules.d/*.yml
        reload.period: 10s
        reload.enabled: true
      metricbeat.max_start_delay: 10s
      setup.dashboards.enabled: true
      metricbeat.modules:
      - module: system
        metricsets:
          - cpu # CPU usage
          - load # CPU load averages
          - memory # Memory usage
          - network # Network IO
          - process # Per process metrics
          - process_summary # Process summary
          - uptime # System Uptime
          - socket_summary # Socket summary
          #- core # Per CPU core usage
          #- diskio # Disk IO
          #- filesystem # File system usage for each mountpoint
          #- fsstat # File system summary metrics
          #- raid # Raid
          #- socket # Sockets and connection info (linux only)
          #- service # systemd service information
        enabled: true
        period: 10s
        processes: ['.*']

        # Configure the mount point of the host’s filesystem for use in monitoring a host from within a container
        #hostfs: "/hostfs"

        # Configure the metric types that are included by these metricsets.
        cpu.metrics: ["percentages","normalized_percentages"] # The other available option is ticks.
        core.metrics: ["percentages"]

  
      cloud.id: "ELK_CLOUD_ID"
      cloud.auth: "ELK_CLOUD_AUTH"
      logging.to_files: true
      logging.files:
        # Configure the path where the logs are written. The default is the logs directory
        # under the home path (the binary location).
        path: /var/log/metricbeat
      name: 'my-application'
      fields:
        env: ELASTIC_APM_ENV
      processors:
        - add_host_metadata: ~
        - add_cloud_metadata: ~  

```

 ![Screenshot 2023-09-04 at 10.35.40](https://us1.discourse-cdn.com/elastic/original/3X/1/0/10b950191cc28ee63dba356d26195e8a23639500.png)

I have received instance information in kibana dashboard. i want to group instance by environment(dev,staging,prod) and check whole group CPU utilization and create alert

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 2, 2023, 5:09am UTC](https://discuss.elastic.co/t/grouping-metrics-by-env/342211/2 "2023-10-02T05:09:26Z")

</div>

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