Skip to content

Commit

Permalink
[vSphere][datastorecluster] Add new Datastream Datastore Cluster (#11089
Browse files Browse the repository at this point in the history
)

* initial commit for datastore cluster datastream

* resolve review comments

* update changelog entry

* update README.md

* udpate README

* update changelog entry

* reorder changelog

* fix changelog

* udpate docker-compose

* fix conflicts

* fix description of period

* update and fix system test for datastorecluster

* update processor URL

* remove agent fields
  • Loading branch information
kush-elastic authored Sep 22, 2024
1 parent 3189c70 commit 8966518
Show file tree
Hide file tree
Showing 16 changed files with 472 additions and 18 deletions.
29 changes: 21 additions & 8 deletions packages/vsphere/_dev/build/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ The vSphere integration collects logs and metrics.

Logs help you keep a record of events that happen on your machine. The `Log` data stream collected by vSphere as integration is `log`.

Metrics give you insight into the statistics of the vSphere. The `Metric` data stream collected by the vSphere integration are `cluster`, `datastore`, `host`, `resourcepool` and `virtualmachine` so that the user can monitor and troubleshoot the performance of the vSphere instance.
Metrics give you insight into the statistics of the vSphere. The `Metric` data stream collected by the vSphere integration are `cluster`, `datastore`, `datastorecluster`, `host`, `resourcepool` and `virtualmachine` so that the user can monitor and troubleshoot the performance of the vSphere instance.

Data streams:
- `log`: This data stream collects logs generated by VMware vSphere using a syslog daemon.
- `cluster`: This data stream collects metrics from VMware vSphere, such as lists of datastores, hosts and networks associated with cluster.
- `datastore`: This data stream collects datastore metrics from VMware vSphere, including performance statistics such as capacity, usage, read/write operations, latency, and throughput.
- `host`: This data stream collects host metrics from VMware vSphere, including performance statistics such as CPU usage, memory usage, disk I/O, and network activity.
- `resourcepool`: This data stream collects metrics from VMware vSphere, such as CPU and memory usage, CPU and memory reservation, and CPU and memory limit.
- `virtualmachine`: This data stream collects virtual machine metrics from VMware vSphere, including performance statistics such as status, uptime, CPU usage, memory usage, and network activity.
Data Streams:

- **`log`**: This data stream collects logs generated by VMware vSphere using a syslog daemon.
- **`cluster`**: This data stream collects metrics from VMware vSphere, such as lists of datastores, hosts and networks associated with cluster.
- **`datastore`**: This data stream gathers datastore metrics from VMware vSphere, including performance statistics such as capacity, usage, read/write operations, latency, and throughput.
- **`datastorecluster`**: This data stream gathers metrics for datastore clusters from VMware vSphere, including statistics like cluster capacity and available free space. Additionally, it provides information about the individual datastores that comprise the cluster.
- **`host`**: This data stream collects host metrics from VMware vSphere, including performance statistics such as CPU usage, memory usage, disk I/O, and network activity.
- **`resourcepool`**: This data stream collects metrics from VMware vSphere, such as CPU and memory usage, CPU and memory reservation, and CPU and memory limit.
- **`virtualmachine`**: This data stream gathers virtual machine metrics from VMware vSphere, including performance statistics such as status, uptime, CPU usage, memory usage, and network activity.

Note:
- Users can monitor and see the log inside the ingested documents for vSphere in the `logs-*` index pattern from `Discover`, and for metrics, the index pattern is `metrics-*`.
Expand Down Expand Up @@ -95,6 +96,18 @@ Please refer to the following [document](https://www.elastic.co/guide/en/ecs/cur

{{fields "datastore"}}

### Datastore Cluster

Datastore clusters in vSphere group multiple datastores for optimized management and automated load balancing, ensuring efficient storage utilization and simplified administration.

{{event "datastorecluster"}}

**ECS Field Reference**

Please refer to the following [document](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html) for detailed information on ECS fields.

{{fields "datastorecluster"}}

### Host

This is the `host` data stream. This data stream collects host metrics from VMware vSphere, including performance statistics such as CPU usage, memory usage, disk I/O, and network activity.
Expand Down
2 changes: 1 addition & 1 deletion packages/vsphere/_dev/deploy/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RUN apk add --no-cache curl git
RUN go install github.com/vmware/govmomi/[email protected]

HEALTHCHECK --interval=1s --retries=60 --timeout=10s CMD curl http://localhost:8989/
CMD vcsim -l :8989
CMD vcsim -pod 1 -l :8989
1 change: 0 additions & 1 deletion packages/vsphere/_dev/deploy/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: '2.3'
services:
vsphere-metrics:
image: docker.elastic.co/integrations-ci/beats-vsphere:${VSPHERE_GOLANG_VERSION:-1.17}-1
build:
context: .
args:
Expand Down
3 changes: 3 additions & 0 deletions packages/vsphere/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# newer versions go on top
- version: "1.15.0-next"
changes:
- description: Add new datastorecluster datastream.
type: enhancement
link: https://github.com/elastic/integrations/pull/11089
- description: Add additional metrics for virtualmachine datastream
type: enhancement
link: https://github.com/elastic/integrations/pull/10942
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"events": [
{
"vsphere": {
"datastorecluster": {
"name": "datastore_cluster1",
"capacity": {
"bytes": 8795019280384
},
"free_space": {
"bytes": 8788836876288
},
"datastore": {
"count": 1,
"names": [
"LocalDS_0"
]
}
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"expected": [
{
"ecs": {
"version": "8.11.0"
},
"vsphere": {
"datastorecluster": {
"capacity": {
"bytes": 8795019280384
},
"datastore": {
"count": 1,
"names": [
"LocalDS_0"
]
},
"free_space": {
"bytes": 8788836876288
},
"name": "datastore_cluster1"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
service: vsphere-metrics
vars:
hosts:
- "{{Hostname}}:8989/sdk"
period: 10s
username: "user"
password: "password"
# If insecure is true, don't verify the server's certificate chain
insecure: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
metricsets: ["datastorecluster"]
hosts:
{{#each hosts}}
- {{this}}
{{/each}}
period: {{period}}
username: {{username}}
password: {{password}}
# If insecure is true, don't verify the server's certificate chain
insecure: {{insecure}}

tags:
{{#each tags as |tag|}}
- {{tag}}
{{/each}}

{{#if processors}}
processors:
{{processors}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
description: Pipeline for datastorecluster
processors:
- set:
field: ecs.version
value: '8.11.0'
on_failure:
- set:
field: error.message
value: '{{ _ingest.on_failure_message }}'
20 changes: 20 additions & 0 deletions packages/vsphere/data_stream/datastorecluster/fields/agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- name: host
title: Host
group: 2
description: 'A host is defined as a general computing instance. ECS host.* fields should be populated with details about the host on which the event happened, or from which the measurement was taken. Host types include hardware, virtual machines, Docker containers, and Kubernetes nodes.'
type: group
fields:
- name: name
level: core
type: keyword
dimension: true
ignore_above: 1024
description: 'Name of the host. It can contain what `hostname` returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use.'
- name: agent
title: Agent
type: group
fields:
- name: id
type: keyword
ignore_above: 1024
dimension: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- name: data_stream.type
type: constant_keyword
description: Data stream type.
- name: data_stream.dataset
type: constant_keyword
description: Data stream dataset.
- name: data_stream.namespace
type: constant_keyword
description: Data stream namespace.
- name: '@timestamp'
type: date
description: Event timestamp.
- name: event.module
type: constant_keyword
description: Event module
value: vsphere
- name: event.dataset
type: constant_keyword
description: Event dataset
value: vsphere.datastorecluster
21 changes: 21 additions & 0 deletions packages/vsphere/data_stream/datastorecluster/fields/ecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
- name: service.address
external: ecs
dimension: true
- external: ecs
name: cloud.instance.id
dimension: true
- external: ecs
name: cloud.provider
dimension: true
- external: ecs
name: container.id
dimension: true
- external: ecs
name: cloud.account.id
dimension: true
- external: ecs
name: cloud.region
dimension: true
- external: ecs
name: cloud.availability_zone
dimension: true
57 changes: 57 additions & 0 deletions packages/vsphere/data_stream/datastorecluster/fields/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
- name: vsphere.datastorecluster
type: group
description: >
Datastore Cluster
fields:
- name: capacity.bytes
type: long
metric_type: gauge
unit: byte
description: >
Total capacity of this storage pod, in bytes.
format: bytes
- name: datastore
type: group
fields:
- name: names
type: keyword
description: List of all the Datastore names associated with the Datastore Cluster.
- name: count
type: long
metric_type: gauge
description: Number of datastores in the Datastore Cluster.
- name: free_space.bytes
type: long
metric_type: gauge
unit: byte
description: >
Total free space on this storage pod, in bytes.
format: bytes
- name: name
type: keyword
# Reason to add as a dimension field: unique identifier of the host
dimension: true
description: The Datastore Cluster name.
- name: triggered_alarms
type: group
description: >
List of all the triggered alarms.
fields:
- name: status
type: keyword
description: Status of the alarm.
- name: triggered_time
type: date
description: Time when the alarm was triggered.
- name: description
type: keyword
description: Description of the alarm.
- name: entity_name
type: keyword
description: Name of the entity associated with the alarm.
- name: name
type: keyword
description: Name of the alarm.
- name: id
type: keyword
description: Unique identifier for the alarm.
29 changes: 29 additions & 0 deletions packages/vsphere/data_stream/datastorecluster/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
title: "vSphere DatastoreCluster metrics"
type: metrics
streams:
- input: vsphere/metrics
title: vSphere Datastore Cluster metrics
description: vSphere Datastore Cluster metrics
vars:
- name: period
type: text
title: Period
description: The period for fetching metrics, e.g., every 1s, 1m, 1h.
default: 20s
- name: tags
type: text
title: Tags
multi: true
required: true
show_user: false
default:
- vsphere-datastorecluster
- name: processors
type: yaml
title: Processors
multi: false
required: false
show_user: false
description: Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the events are shipped. See [Processors](https://www.elastic.co/guide/en/fleet/current/elastic-agent-processor-configuration.html) for details.
elasticsearch:
index_mode: "time_series"
79 changes: 79 additions & 0 deletions packages/vsphere/data_stream/datastorecluster/sample_event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"@timestamp": "2024-09-22T05:28:46.315Z",
"agent": {
"ephemeral_id": "8b7e9ea4-0517-4e98-a795-b6fe529f4a2f",
"id": "7737279e-51e9-4d90-a0d0-2c12dc4446bf",
"name": "elastic-agent-23128",
"type": "metricbeat",
"version": "8.15.2"
},
"data_stream": {
"dataset": "vsphere.datastorecluster",
"namespace": "65218",
"type": "metrics"
},
"ecs": {
"version": "8.11.0"
},
"elastic_agent": {
"id": "7737279e-51e9-4d90-a0d0-2c12dc4446bf",
"snapshot": true,
"version": "8.15.2"
},
"event": {
"agent_id_status": "verified",
"dataset": "vsphere.datastorecluster",
"duration": 10772332,
"ingested": "2024-09-22T05:28:49Z",
"module": "vsphere"
},
"host": {
"architecture": "x86_64",
"containerized": true,
"hostname": "elastic-agent-23128",
"id": "57723763cd1b4ff48e54a505de4ebe6c",
"ip": [
"192.168.240.2",
"192.168.255.5"
],
"mac": [
"02-42-C0-A8-F0-02",
"02-42-C0-A8-FF-05"
],
"name": "elastic-agent-23128",
"os": {
"codename": "focal",
"family": "debian",
"kernel": "3.10.0-1160.118.1.el7.x86_64",
"name": "Ubuntu",
"platform": "ubuntu",
"type": "linux",
"version": "20.04.6 LTS (Focal Fossa)"
}
},
"metricset": {
"name": "datastorecluster",
"period": 20000
},
"service": {
"address": "https://svc-vsphere-metrics:8989/sdk",
"type": "vsphere"
},
"tags": [
"vsphere-datastorecluster"
],
"vsphere": {
"datastorecluster": {
"capacity": {
"bytes": 0
},
"datastore": {
"count": 0
},
"free_space": {
"bytes": 0
},
"name": "DC0_POD0"
}
}
}
Loading

0 comments on commit 8966518

Please sign in to comment.