Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Sep 12, 2024

Proposed commit message

Add metrics_count metric (counter) to each document (if enabled) for collector and remote_write datastreams. Please see the sample docs for more info.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Sample output

Collector
{
  "_index": ".ds-metricbeat-8.16.0-2024.08.01-000001",
  "_id": "i14sKZEBcmwqWRmK-rWQ",
  "_version": 1,
  "_score": 0,
  "_source": {
    "@timestamp": "2024-08-06T19:31:39.257Z",
    "prometheus": {
      "labels": {
        "instance": "localhost:8081",
        "job": "prometheus"
      },
      "system_memory_usage_bytes": {
        "value": 7351702269.7480135
      },
      "up": {
        "value": 1
      }
    },
    "metrics_count": 2,
    "metricset": {
      "name": "collector",
      "period": 10000
    },
    "service": {
      "type": "prometheus",
      "address": "http://localhost:8081/metrics"
    },
    "event": {
      "dataset": "prometheus.collector",
      "module": "prometheus",
      "duration": 2130125
    },
    "agent": {
      "name": "Subhams-MacBook-Pro.local",
      "type": "metricbeat",
      "version": "8.16.0",
      "ephemeral_id": "6d63b998-1566-4299-aa59-ced8c7a0b7e3",
      "id": "00e1e439-0173-4fb3-8d90-74f4b06ea202"
    },
    "ecs": {
      "version": "8.0.0"
    },
    "host": {
      "mac": [
        "36-1C-20-59-8C-80",
        "36-1C-20-59-8C-84",
        "36-1C-20-59-8C-88",
        "6A-03-C5-9F-E3-B5",
        "6A-03-C5-9F-E3-B6",
        "6A-03-C5-9F-E3-B7",
        "6A-03-C5-9F-E3-D5",
        "6A-03-C5-9F-E3-D6",
        "6A-03-C5-9F-E3-D7",
        "AA-B7-74-48-81-60",
        "BC-D0-74-0D-6F-A5",
        "BE-D0-74-0D-6F-A5",
        "BE-D0-74-D0-53-64",
        "CA-59-C1-CF-D2-0F"
      ],
      "hostname": "Subhams-MacBook-Pro.local",
      "name": "subhams-macbook-pro.local",
      "architecture": "arm64",
      "os": {
        "type": "macos",
        "platform": "darwin",
        "version": "13.6",
        "family": "darwin",
        "name": "macOS",
        "kernel": "22.6.0",
        "build": "22G120"
      },
      "id": "C2677768-AA3E-5023-BD42-EB78BC3453A2",
      "ip": [
        "fe80::6803:c5ff:fe9f:e3d7",
        "fe80::6803:c5ff:fe9f:e3d5",
        "fe80::6803:c5ff:fe9f:e3d6",
        "fe80::bcd0:74ff:fe0d:6fa5",
        "fe80::8e1:bdcb:6244:6bc2",
        "2405:201:d02a:1114:1042:40ca:c385:f622",
        "2405:201:d02a:1114:da8:4a8:4c93:310f",
        "192.168.29.202",
        "fe80::c859:c1ff:fecf:d20f",
        "fe80::c859:c1ff:fecf:d20f",
        "fe80::c646:a13d:9b18:7919",
        "fe80::db4f:7fe7:4b9:cc51",
        "fe80::ce81:b1c:bd2c:69e",
        "fe80::8c9c:d4c3:99a0:8bf8",
        "fe80::781e:7cd2:79db:db56",
        "fe80::2376:e283:a58f:4f88",
        "fe80::7ff1:4c06:56e6:d8e2",
        "192.168.65.1",
        "fe80::bcd0:74ff:fed0:5364",
        "fda2:9011:41d4:6fd3:14bc:39e2:c7ad:76c4"
      ]
    }
  },
  "fields": {
    "beats_state.state.host.hostname": [
      "Subhams-MacBook-Pro.local"
    ],
    "host.os.name.text": [
      "macOS"
    ],
    "host.hostname": [
      "Subhams-MacBook-Pro.local"
    ],
    "host.mac": [
      "36-1C-20-59-8C-80",
      "36-1C-20-59-8C-84",
      "36-1C-20-59-8C-88",
      "6A-03-C5-9F-E3-B5",
      "6A-03-C5-9F-E3-B6",
      "6A-03-C5-9F-E3-B7",
      "6A-03-C5-9F-E3-D5",
      "6A-03-C5-9F-E3-D6",
      "6A-03-C5-9F-E3-D7",
      "AA-B7-74-48-81-60",
      "BC-D0-74-0D-6F-A5",
      "BE-D0-74-0D-6F-A5",
      "BE-D0-74-D0-53-64",
      "CA-59-C1-CF-D2-0F"
    ],
    "host.os.build": [
      "22G120"
    ],
    "service.type": [
      "prometheus"
    ],
    "host.ip": [
      "fe80::6803:c5ff:fe9f:e3d7",
      "fe80::6803:c5ff:fe9f:e3d5",
      "fe80::6803:c5ff:fe9f:e3d6",
      "fe80::bcd0:74ff:fe0d:6fa5",
      "fe80::8e1:bdcb:6244:6bc2",
      "2405:201:d02a:1114:1042:40ca:c385:f622",
      "2405:201:d02a:1114:da8:4a8:4c93:310f",
      "192.168.29.202",
      "fe80::c859:c1ff:fecf:d20f",
      "fe80::c859:c1ff:fecf:d20f",
      "fe80::c646:a13d:9b18:7919",
      "fe80::db4f:7fe7:4b9:cc51",
      "fe80::ce81:b1c:bd2c:69e",
      "fe80::8c9c:d4c3:99a0:8bf8",
      "fe80::781e:7cd2:79db:db56",
      "fe80::2376:e283:a58f:4f88",
      "fe80::7ff1:4c06:56e6:d8e2",
      "192.168.65.1",
      "fe80::bcd0:74ff:fed0:5364",
      "fda2:9011:41d4:6fd3:14bc:39e2:c7ad:76c4"
    ],
    "agent.type": [
      "metricbeat"
    ],
    "logstash_stats.timestamp": [
      "2024-08-06T19:31:39.257Z"
    ],
    "event.module": [
      "prometheus"
    ],
    "host.os.version": [
      "13.6"
    ],
    "host.os.kernel": [
      "22.6.0"
    ],
    "host.os.name": [
      "macOS"
    ],
    "metrics_count": [
      2
    ],
    "agent.name": [
      "Subhams-MacBook-Pro.local"
    ],
    "host.name": [
      "subhams-macbook-pro.local"
    ],
    "beats_state.timestamp": [
      "2024-08-06T19:31:39.257Z"
    ],
    "host.id": [
      "C2677768-AA3E-5023-BD42-EB78BC3453A2"
    ],
    "beats_state.state.host.name": [
      "subhams-macbook-pro.local"
    ],
    "timestamp": [
      "2024-08-06T19:31:39.257Z"
    ],
    "prometheus.system_memory_usage_bytes.value": [
      7351702269.7480135
    ],
    "prometheus.up.value": [
      1
    ],
    "host.os.type": [
      "macos"
    ],
    "kibana_stats.timestamp": [
      "2024-08-06T19:31:39.257Z"
    ],
    "metricset.period": [
      10000
    ],
    "agent.hostname": [
      "Subhams-MacBook-Pro.local"
    ],
    "event.duration": [
      2130125
    ],
    "host.architecture": [
      "arm64"
    ],
    "metricset.name": [
      "collector"
    ],
    "prometheus.labels.instance": [
      "localhost:8081"
    ],
    "@timestamp": [
      "2024-08-06T19:31:39.257Z"
    ],
    "agent.id": [
      "00e1e439-0173-4fb3-8d90-74f4b06ea202"
    ],
    "ecs.version": [
      "8.0.0"
    ],
    "host.os.platform": [
      "darwin"
    ],
    "service.address": [
      "http://localhost:8081/metrics"
    ],
    "agent.ephemeral_id": [
      "6d63b998-1566-4299-aa59-ced8c7a0b7e3"
    ],
    "prometheus.labels.job": [
      "prometheus"
    ],
    "agent.version": [
      "8.16.0"
    ],
    "beats_state.state.host.architecture": [
      "arm64"
    ],
    "host.os.family": [
      "darwin"
    ],
    "event.dataset": [
      "prometheus.collector"
    ]
  }
}
Remote Write
{
  "@timestamp": [
    "2024-08-06T20:11:35.881Z"
  ],
  "agent.ephemeral_id": [
    "4b5d7b27-4dec-4d60-89c5-5214e9805929"
  ],
  "agent.hostname": [
    "Subhams-MacBook-Pro.local"
  ],
  "agent.id": [
    "00e1e439-0173-4fb3-8d90-74f4b06ea202"
  ],
  "agent.name": [
    "Subhams-MacBook-Pro.local"
  ],
  "agent.type": [
    "metricbeat"
  ],
  "agent.version": [
    "8.16.0"
  ],
  "beats_state.state.host.architecture": [
    "arm64"
  ],
  "beats_state.state.host.hostname": [
    "Subhams-MacBook-Pro.local"
  ],
  "beats_state.state.host.name": [
    "subhams-macbook-pro.local"
  ],
  "beats_state.timestamp": [
    "2024-08-06T20:11:35.881Z"
  ],
  "ecs.version": [
    "8.0.0"
  ],
  "event.dataset": [
    "prometheus.remote_write"
  ],
  "event.module": [
    "prometheus"
  ],
  "host.architecture": [
    "arm64"
  ],
  "host.hostname": [
    "Subhams-MacBook-Pro.local"
  ],
  "host.id": [
    "C2677768-AA3E-5023-BD42-EB78BC3453A2"
  ],
  "host.ip": [
    "fe80::6803:c5ff:fe9f:e3d7",
    "fe80::6803:c5ff:fe9f:e3d5",
    "fe80::6803:c5ff:fe9f:e3d6",
    "fe80::bcd0:74ff:fe0d:6fa5",
    "fe80::8e1:bdcb:6244:6bc2",
    "2405:201:d02a:1114:1042:40ca:c385:f622",
    "2405:201:d02a:1114:da8:4a8:4c93:310f",
    "192.168.29.202",
    "fe80::c859:c1ff:fecf:d20f",
    "fe80::c859:c1ff:fecf:d20f",
    "fe80::c646:a13d:9b18:7919",
    "fe80::db4f:7fe7:4b9:cc51",
    "fe80::ce81:b1c:bd2c:69e",
    "fe80::8c9c:d4c3:99a0:8bf8",
    "fe80::781e:7cd2:79db:db56",
    "fe80::2376:e283:a58f:4f88",
    "fe80::7ff1:4c06:56e6:d8e2",
    "192.168.65.1",
    "fe80::bcd0:74ff:fed0:5364",
    "fda2:9011:41d4:6fd3:14bc:39e2:c7ad:76c4"
  ],
  "host.mac": [
    "36-1C-20-59-8C-80",
    "36-1C-20-59-8C-84",
    "36-1C-20-59-8C-88",
    "6A-03-C5-9F-E3-B5",
    "6A-03-C5-9F-E3-B6",
    "6A-03-C5-9F-E3-B7",
    "6A-03-C5-9F-E3-D5",
    "6A-03-C5-9F-E3-D6",
    "6A-03-C5-9F-E3-D7",
    "AA-B7-74-48-81-60",
    "BC-D0-74-0D-6F-A5",
    "BE-D0-74-0D-6F-A5",
    "BE-D0-74-D0-53-64",
    "CA-59-C1-CF-D2-0F"
  ],
  "host.name": [
    "subhams-macbook-pro.local"
  ],
  "host.os.build": [
    "22G120"
  ],
  "host.os.family": [
    "darwin"
  ],
  "host.os.kernel": [
    "22.6.0"
  ],
  "host.os.name": [
    "macOS"
  ],
  "host.os.name.text": [
    "macOS"
  ],
  "host.os.platform": [
    "darwin"
  ],
  "host.os.type": [
    "macos"
  ],
  "host.os.version": [
    "13.6"
  ],
  "kibana_stats.timestamp": [
    "2024-08-06T20:11:35.881Z"
  ],
  "logstash_stats.timestamp": [
    "2024-08-06T20:11:35.881Z"
  ],
  "metrics_count": [
    6
  ],
  "metricset.name": [
    "remote_write"
  ],
  "prometheus.labels.instance": [
    "localhost:8081"
  ],
  "prometheus.labels.job": [
    "prometheus"
  ],
  "prometheus.scrape_duration_seconds.value": [
    0.0047865
  ],
  "prometheus.scrape_samples_post_metric_relabeling.value": [
    17
  ],
  "prometheus.scrape_samples_scraped.value": [
    17
  ],
  "prometheus.scrape_series_added.value": [
    0
  ],
  "prometheus.system_memory_usage_bytes.value": [
    2583889525.1153283
  ],
  "prometheus.up.value": [
    1
  ],
  "service.type": [
    "prometheus"
  ],
  "timestamp": [
    "2024-08-06T20:11:35.881Z"
  ],
  "_id": "-l5RKZEBcmwqWRmKn-Xc",
  "_index": ".ds-metricbeat-8.16.0-2024.08.01-000001",
  "_score": null
}

This is an automatic backport of pull request #40411 done by [Mergify](https://mergify.com).

…`metrics_count` to Prometheus module if `metrics_count` is `true` (#40411)

Co-authored-by: Ishleen Kaur <[email protected]>
Co-authored-by: Aman <[email protected]>
(cherry picked from commit 3c9563c)
@mergify mergify bot requested review from a team as code owners September 12, 2024 10:03
@mergify mergify bot added the backport label Sep 12, 2024
@mergify mergify bot requested review from MichaelKatsoulis and tetianakravchenko and removed request for a team September 12, 2024 10:03
@mergify mergify bot assigned shmsr Sep 12, 2024
@mergify mergify bot requested review from belimawr and rdner and removed request for a team September 12, 2024 10:03
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 12, 2024
@shmsr shmsr added the Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team label Sep 12, 2024
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 12, 2024
- Log the total time taken for GCP `ListTimeSeries` and `AggregatedList` requests {pull}40661[40661]
- Add new metricset datastorecluster for vSphere module. {pull}40634[40634] {pull}40694[40694]
- Add new metrics for the vSphere Virtualmachine metricset. {pull}40485[40485]
- Add support for snapshot in vSphere virtualmachine metricset {pull}40683[40683]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think those should be taken care and corrected. As it is a backport only last one is correct I guess

@shmsr shmsr merged commit 9136549 into 8.x Sep 13, 2024
@shmsr shmsr deleted the mergify/bp/8.x/pr-40411 branch September 13, 2024 10:50
@khushijain21 khushijain21 mentioned this pull request Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants