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

[chore] Add benchmark for container parser #34281

Merged
merged 1 commit into from
Jul 30, 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
13 changes: 7 additions & 6 deletions examples/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ Following table shows result of example run:

Test |Result|Duration|CPU Avg%|CPU Max%|RAM Avg MiB|RAM Max MiB|Sent Items|Received Items|
----------------------------------------|------|-------:|-------:|-------:|----------:|----------:|---------:|-------------:|
Log10kDPS/OTLP |PASS | 15s| 15.2| 15.7| 69| 73| 149900| 149900|
Log10kDPS/filelog |PASS | 15s| 16.5| 18.0| 61| 74| 150000| 150000|
Log10kDPS/kubernetes_containers |PASS | 15s| 42.3| 44.0| 66| 80| 150000| 150000|
Log10kDPS/k8s_CRI-Containerd |PASS | 15s| 36.7| 38.0| 64| 78| 150000| 150000|
Log10kDPS/k8s_CRI-Containerd_no_attr_ops|PASS | 15s| 28.9| 29.7| 64| 77| 150000| 150000|
Log10kDPS/CRI-Containerd |PASS | 15s| 19.0| 21.0| 63| 77| 150000| 150000|
Log10kDPS/OTLP |PASS | 15s| 10.4| 11.0| 68| 94| 150100| 150100|
Log10kDPS/filelog |PASS | 15s| 7.8| 8.7| 65| 93| 150100| 150100|
Log10kDPS/kubernetes_containers |PASS | 15s| 18.3| 19.7| 67| 96| 150100| 150100|
Log10kDPS/kubernetes_containers_parser |PASS | 15s| 18.2| 19.0| 66| 95| 150100| 150100|
Log10kDPS/k8s_CRI-Containerd |PASS | 15s| 15.4| 16.3| 66| 95| 150100| 150100|
Log10kDPS/k8s_CRI-Containerd_no_attr_ops|PASS | 15s| 15.1| 16.3| 66| 95| 150100| 150100|
Log10kDPS/CRI-Containerd |PASS | 15s| 11.1| 13.0| 65| 93| 150100| 150100|

## ToDo

Expand Down
15 changes: 15 additions & 0 deletions testbed/datasenders/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,21 @@ func NewKubernetesContainerWriter() *FileLogK8sWriter {
`)
}

// NewKubernetesContainerParserWriter returns FileLogK8sWriter with configuration
// to recognize and parse kubernetes container logs using the container parser
func NewKubernetesContainerParserWriter() *FileLogK8sWriter {
return NewFileLogK8sWriter(`
filelog:
include: [ %s ]
start_at: beginning
include_file_path: true
include_file_name: false
operators:
- type: container
id: container-parser
`)
}

// NewKubernetesCRIContainerdWriter returns FileLogK8sWriter with configuration
// to parse only CRI-Containerd kubernetes logs
func NewKubernetesCRIContainerdWriter() *FileLogK8sWriter {
Expand Down
9 changes: 9 additions & 0 deletions testbed/tests/log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ func TestLog10kDPS(t *testing.T) {
ExpectedMaxRAM: 150,
},
},
{
name: "kubernetes containers parser",
sender: datasenders.NewKubernetesContainerParserWriter(),
receiver: testbed.NewOTLPDataReceiver(testutil.GetAvailablePort(t)),
resourceSpec: testbed.ResourceSpec{
ExpectedMaxCPU: 110,
ExpectedMaxRAM: 150,
},
},
{
name: "k8s CRI-Containerd",
sender: datasenders.NewKubernetesCRIContainerdWriter(),
Expand Down