Skip to content

Commit

Permalink
[O11y][Prometheus Input] Add system test cases (#6490)
Browse files Browse the repository at this point in the history
* add system test case

* update changelog

* update system tests
  • Loading branch information
ali786XI authored Jul 5, 2023
1 parent 64f5a99 commit 8d26c84
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 1 deletion.
15 changes: 15 additions & 0 deletions packages/prometheus_input/_dev/deploy/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '2.3'
services:
prometheus_input:
image: ibmcom/websphere-traditional:9.0.5.11
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9080/metrics"]
interval: 30s
timeout: 30s
retries: 20
ports:
- 9080
volumes:
- ./files/PASSWORD:/tmp/PASSWORD
- ./files/init.jython:/home/scripts/init.jython
- ./files/start_server.sh:/work/start_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Welcome1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
print("Starting metrics")
perfName=AdminControl.completeObjectName('type=Perf,*')
AdminControl.invoke(perfName,'setStatisticSet','all')
AdminApp.install('/opt/IBM/WebSphere/AppServer/installableApps/metrics.ear', '[-node DefaultNode01 -cell DefaultCell01 -server server1]')
AdminConfig.save()
AdminControl.invoke('WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=DefaultNode01,version=9.0.5.11,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=DefaultCell01,spec=1.0', 'startApplication', '[MetricsApp]')
print("Metrics started")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
PROFILE_NAME=${PROFILE_NAME:-"AppSrv01"}
SERVER_NAME=${SERVER_NAME:-"server1"}
/work/set_password.sh
echo "Starting server ..................."
/opt/IBM/WebSphere/AppServer/profiles/$PROFILE_NAME/bin/startServer.sh $SERVER_NAME
wsadmin.sh -lang jython -user wsadmin -password Welcome1 -f /home/scripts/init.jython
tail -f dev/null
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vars:
hosts:
- http://{{Hostname}}:{{Port}}
data_stream.dataset: prometheus_input.prometheus
5 changes: 5 additions & 0 deletions packages/prometheus_input/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "0.1.3"
changes:
- description: Add system test cases
type: enhancement
link: https://github.com/elastic/integrations/pull/6490
- version: "0.1.2"
changes:
- description: Fix the typos in package
Expand Down
4 changes: 4 additions & 0 deletions packages/prometheus_input/fields/base-fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
external: ecs
- name: '@timestamp'
external: ecs
- name: service.address
external: ecs
- name: service.type
external: ecs
2 changes: 2 additions & 0 deletions packages/prometheus_input/fields/ecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- name: ecs.version
external: ecs
2 changes: 1 addition & 1 deletion packages/prometheus_input/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 2.0.0
name: prometheus_input
title: "Prometheus Input"
version: "0.1.2"
version: "0.1.3"
description: "Collects metrics from Prometheus exporter."
type: input
categories:
Expand Down
82 changes: 82 additions & 0 deletions packages/prometheus_input/sample_event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"@timestamp": "2023-06-30T11:56:37.693Z",
"agent": {
"ephemeral_id": "4f603ef5-6900-4369-b593-3fed11799f03",
"id": "8b818229-d30a-4276-b8dc-1771302ac16c",
"name": "docker-fleet-agent",
"type": "metricbeat",
"version": "8.8.0"
},
"data_stream": {
"dataset": "prometheus_input.prometheus",
"namespace": "ep",
"type": "metrics"
},
"ecs": {
"version": "8.0.0"
},
"elastic_agent": {
"id": "8b818229-d30a-4276-b8dc-1771302ac16c",
"snapshot": false,
"version": "8.8.0"
},
"event": {
"agent_id_status": "verified",
"dataset": "prometheus_input.prometheus",
"duration": 65732205,
"ingested": "2023-06-30T11:56:38Z",
"module": "prometheus"
},
"host": {
"architecture": "x86_64",
"containerized": true,
"hostname": "docker-fleet-agent",
"id": "e8978f2086c14e13b7a0af9ed0011d19",
"ip": [
"192.168.245.7"
],
"mac": [
"02-42-C0-A8-F5-07"
],
"name": "docker-fleet-agent",
"os": {
"codename": "focal",
"family": "debian",
"kernel": "3.10.0-1160.88.1.el7.x86_64",
"name": "Ubuntu",
"platform": "ubuntu",
"type": "linux",
"version": "20.04.6 LTS (Focal Fossa)"
}
},
"metricset": {
"name": "collector",
"period": 10000
},
"prometheus": {
"labels": {
"instance": "elastic-package-service_prometheus_input_1:9080",
"job": "prometheus",
"objectpool": "ObjectPool_ibm.system.objectpool_com.ibm.ws.asynchbeans.CJWorkListenerRunnable"
},
"was_objectpool_allocate_total": {
"counter": 0,
"rate": 0
},
"was_objectpool_create_total": {
"counter": 0,
"rate": 0
},
"was_objectpool_idle_objects": {
"value": 0
},
"was_objectpool_return_total": {
"counter": 0,
"rate": 0
}
},
"service": {
"address": "http://elastic-package-service_prometheus_input_1:9080/metrics",
"type": "prometheus"
}
}

0 comments on commit 8d26c84

Please sign in to comment.