Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[O11y][Nginx] Rally benchmark nginx.access #9032

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/nginx/_dev/benchmark/rally/access-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Benchmark 20000 nginx.access events ingested
data_stream:
name: access
corpora:
generator:
total_events: 20000
template:
type: gotext
path: ./access-benchmark/template.ndjson
config:
path: ./access-benchmark/config.yml
fields:
path: ./access-benchmark/fields.yml
17 changes: 17 additions & 0 deletions packages/nginx/_dev/benchmark/rally/access-benchmark/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
fields:
- name: 'timestamp'
period: -24h # one day
- name: agent.id
value: "ef5e274d-4b53-45e6-943a-a5bcf1a6f523"
- name: request_method
enum: ["GET", "POST", "PUT", "DELETE"]
- name: status_code
enum: ["101", "102", "200", "201", "202", "300", "301", "302", "400", "401", "402", "500", "501"]
- name: response_bytes
range:
min: 100
max: 30000
- name: id
enum: ["1", "2", "3"]
- name: domains
enum: [".com", ".net", ".info", ".org"]
25 changes: 25 additions & 0 deletions packages/nginx/_dev/benchmark/rally/access-benchmark/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
- name: agent.ephemeral_id
type: keyword
- name: agent.id
type: keyword
- name: agent.name
type: keyword
- name: destination_domain
type: keyword
example: lessons.example
- name: domains
type: keyword
- name: remote_ip
type: ip
- name: timestamp
type: date
- name: request_method
type: keyword
- name: status_code
type: keyword
- name: response_bytes
type: long
- name: remote_user
type: keyword
- name: id
type: keyword
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{{- $timestamp := generate "timestamp" }}
{{- $agentId := generate "agent.id" }}
{{- $agentName := generate "agent.name" }}
{{- $agentEphemeralid := generate "agent.ephemeral_id" }}
{{- $destinationDomain := generate "destination_domain" }}
{{- $remoteIp := generate "remote_ip" }}
{{- $remoteUser := generate "remote_user" }}
{{- $requestMethod := generate "request_method" }}
{{- $statusCode := generate "status_code" }}
{{- $responseBytes := generate "response_bytes" }}
{{- $domains := generate "domains" }}
{{- $id := generate "id" }}
{
"@timestamp": "{{ $timestamp.Format "2006-01-02T15:04:05.000Z07:00" }}",
"agent": {
"ephemeral_id": "{{ $agentEphemeralid }}",
"id": "{{ $agentId }}",
"name": "{{ $agentName }}",
"type": "filebeat",
"version": "8.5.1"
},
"data_stream": {
"dataset": "nginx.access",
"namespace": "ep",
"type": "logs"
},
"ecs": {
"version": "8.5.1"
},
"elastic_agent": {
"id": "{{ $agentId }}",
"snapshot": false,
"version": "8.5.0"
},
"message": "{{ $destinationDomain }}{{ $domains }}:80 {{ $remoteIp }} - {{ $remoteUser }} [{{$timestamp | date "02/Jan/2006:15:04:05"}} {{ $timestamp.Format "Z0700" }}] \"{{$requestMethod}} /downloads/product_{{ $id }} HTTP/1.1\" {{ $statusCode }} {{ $responseBytes }} \"http://localhost:8080/\" \"Chef Client/12.0.3 (ruby-2.1.4-p265; ohai-8.0.1; x86_64-linux; +http://opscode.com)\"",
"event": {
"agent_id_status": "verified",
"dataset": "nginx.access",
"timezone": "{{ $timestamp.Format "-07:00" }}"
},
"host": {
"architecture": "x86_64",
"containerized": false,
"hostname": "docker-fleet-agent",
"id": "66392b0697b84641af8006d87aeb89f1",
"ip": [
"172.18.0.7"
],
"mac": [
"02-42-AC-12-00-07"
],
"name": "docker-fleet-agent",
"os": {
"codename": "focal",
"family": "debian",
"kernel": "5.15.49-linuxkit",
"name": "Ubuntu",
"platform": "ubuntu",
"type": "linux",
"version": "20.04.5 LTS (Focal Fossa)"
}
},
"input": {
"type": "log"
},
"log": {
"file": {
"path": "/tmp/service_logs/access.log"
},
"offset": 0
lalit-satapathy marked this conversation as resolved.
Show resolved Hide resolved
},
"tags": [
"nginx-access"
]
}