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.error #8762

Merged
merged 10 commits into from
Jan 16, 2024
14 changes: 14 additions & 0 deletions packages/nginx/_dev/benchmark/rally/error-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Benchmark 20000 nginx.error events ingested
data_stream:
name: error
corpora:
generator:
total_events: 20000
template:
type: gotext
path: ./error-benchmark/template.ndjson
config:
path: ./error-benchmark/config.yml
fields:
path: ./error-benchmark/fields.yml
19 changes: 19 additions & 0 deletions packages/nginx/_dev/benchmark/rally/error-benchmark/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
fields:
- name: 'timestamp'
period: -24h # one day
- name: agent.id
value: "ef5e274d-4b53-45e6-943a-a5bcf1a6f523"
- name: log.level
enum: ["debug", "info", "notice", "warn", "error", "crit", "alert", "emerg"]
- name: process.pid
range:
min: 1
max: 100000
- name: thread.id
range:
min: 1
max: 100000
- name: connection_id
range:
min: 1
max: 100000
28 changes: 28 additions & 0 deletions packages/nginx/_dev/benchmark/rally/error-benchmark/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
- name: agent.ephemeral_id
type: keyword
- name: agent.ephemeral_id
type: keyword
- name: agent.id
type: keyword
- name: agent.name
type: keyword
- name: agent.version
type: keyword
- name: agent.version
type: keyword
- name: connection_id
type: long
- name: host.ip
type: ip
- name: host.name
type: keyword
- name: log.level
type: keyword
- name: message
type: text
- name: process.pid
type: long
- name: thread.id
type: long
- name: timestamp
type: date
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{{- $timestamp := generate "timestamp" }}
{{- $agentId := generate "agent.id" }}
{{- $agentVersion := generate "agent.version" }}
{{- $agentName := generate "agent.name" }}
{{- $agentEphemeralid := generate "agent.ephemeral_id" }}
{{- $logLevel := generate "log.level" }}
{{- $pid := generate "process.pid" }}
{{- $threadId := generate "thread.id" }}
{{- $connectionId := generate "connection_id" }}
{
"@timestamp": "{{ $timestamp.Format "2006-01-02T15:04:05.000Z" }}",
"agent": {
"ephemeral_id": "{{ $agentEphemeralid }}",
"id": "{{ $agentId }}",
"name": "{{ $agentName }}",
"type": "filebeat",
"version": "8.8.0"
},
"data_stream": {
"dataset": "nginx.error",
"namespace": "ep",
"type": "logs"
},
"ecs": {
"version": "8.5.1"
},
"elastic_agent": {
"id": "{{ $agentEphemeralid }}",
"snapshot": false,
"version": "8.8.0"
},
"event": {
"agent_id_status": "verified",
"dataset": "nginx.error",
"timezone": "{{ $timestamp.Format "-07:00" }}"
},
"host": {
"architecture": "x86_64",
"containerized": false,
"hostname": "docker-fleet-agent",
"id": "66392b0697b84641af8006d87aeb89f1",
"ip": [
"{{ generate "host.ip" }}"
],
"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": "/var/log/nginx/error.log"
},
"offset": 0
},
"message": "{{$timestamp.Format "2006/01/02 15:04:05"}} [{{ $logLevel }}] {{ $pid }}#{{ $threadId }}: *{{ $connectionId }} {{generate "message"}}",
Copy link
Contributor

Choose a reason for hiding this comment

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

Reviewing this I stumbled over the {{generate "message"}} part in the UI as it generates a random message. I was a bit surprised by this but something we can tune as a follow up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with your point that it generates random messages that doesn't look realistic. But I referred from this PR in which the same field is being generated.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can always follow up on this one. Lets keep it as is for now.

"tags": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this tag shipped by the agent normally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is basically the user provided value or the default value of the data stream that remains static in all the events if kept unchanged throughout the period integration is configured. It can be set by user while configuring the integration.

"nginx-error"
]
}