Skip to content

Commit

Permalink
Merge pull request #123 from getanteon/develop
Browse files Browse the repository at this point in the history
filter processes & logs & rebranding to anteon
  • Loading branch information
fatihbaltaci committed Apr 30, 2024
2 parents a13547a + 9e812ba commit 854f681
Show file tree
Hide file tree
Showing 63 changed files with 2,712 additions and 1,116 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.DS_Store
.DS_Store
.vscode/settings.json
.vscode/launch.json
6 changes: 4 additions & 2 deletions Dockerfile.default
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM golang:1.20.14-bullseye as builder
FROM golang:1.22.1-bullseye as builder
WORKDIR /app
COPY . ./
RUN apt update

ARG VERSION
RUN GOOS=linux go build -ldflags="-X 'github.com/ddosify/alaz/datastore.tag=$VERSION'" -o alaz
ENV GOCACHE=/root/.cache/go-build
RUN go mod tidy -v
RUN --mount=type=cache,target="/root/.cache/go-build" GOOS=linux go build -ldflags="-X 'github.com/ddosify/alaz/datastore.tag=$VERSION'" -o alaz

FROM debian:12.5-slim
RUN apt-get update && apt-get install -y procps ca-certificates && rm -rf /var/lib/apt/lists/*
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

Ddosify - Load testing tool for any web system.
Copyright (C) 2021 Ddosify
Anteon
Copyright (C) 2021 Ddosify Inc.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CONTAINER_ENGINE ?= docker
CONTAINER_RUN_ARGS ?= $(--user "${UIDGID}")

IMAGE_GENERATE := ebpf-builder
VERSION_GENERATE := v1
VERSION_GENERATE := v1-1.22.1
GENERATE_DOCKERFILE := ebpf-builder/Dockerfile

# clang <8 doesn't tag relocs properly (STT_NOTYPE)
Expand Down
94 changes: 47 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@

<h1 align="center">Alaz - Ddosify eBPF Agent for Kubernetes Monitoring</h1>
<h1 align="center">Alaz - Anteon (Formerly Ddosify) eBPF Agent for Kubernetes Monitoring</h1>

<p align="center">
<a href="https://github.com/ddosify/alaz/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/badge/LICENSE-AGPL--3.0-orange?style=for-the-badge&logo=none" alt="alaz license" /></a>
<a href="https://discord.gg/9KdnrSUZQg" target="_blank"><img src="https://img.shields.io/discord/898523141788287017?style=for-the-badge&logo=discord&label=DISCORD" alt="ddosify discord server" /></a>
<a href="https://github.com/getanteon/alaz/blob/master/LICENSE" target="_blank"><img src="https://img.shields.io/badge/LICENSE-AGPL--3.0-orange?style=for-the-badge&logo=none" alt="alaz license" /></a>
<a href="https://discord.gg/9KdnrSUZQg" target="_blank"><img src="https://img.shields.io/discord/898523141788287017?style=for-the-badge&logo=discord&label=DISCORD" alt="Anteon discord server" /></a>
<a href="https://hub.docker.com/r/ddosify/alaz" target="_blank"><img src="https://img.shields.io/docker/v/ddosify/alaz?style=for-the-badge&logo=docker&label=docker&sort=semver" alt="alaz docker image" /></a>
</p>

<p align="center">
<img src="https://raw.githubusercontent.com/ddosify/alaz/master/assets/ddosify_service_map.png" alt="Ddosify Kubernetes Monitoring Service Map" />
<i>Ddosify automatically generates Service Map of your K8s cluster without code instrumentation or sidecars with eBPF Agent Alaz. So you can easily find the bottlenecks in your system. Red lines indicate the high latency between services.</i>
<img src="https://raw.githubusercontent.com/getanteon/anteon/master/assets/anteon_service_map.png" alt="Anteon Kubernetes Monitoring Service Map" />
<i>Anteon automatically generates Service Map of your K8s cluster without code instrumentation or sidecars with eBPF Agent Alaz. So you can easily find the bottlenecks in your system. Red lines indicate the high latency between services.</i>
</p>

<h2 align="center">
<a href="https://demo.ddosify.com/clusters/0ce2ef05-ef64-459d-90d9-7f2cbd65fff8" target="_blank">Live Demo</a> •
<a href="https://docs.ddosify.com/" target="_blank">Documentation</a> •
<a href="https://docs.ddosify.com/ddosify/deployment" target="_blank">Deployment</a> •
<a href="https://docs.ddosify.com/ddosify/deployment" target="_blank">Discord</a>
<a href="https://demo.getanteo.com/clusters/0ce2ef05-ef64-459d-90d9-7f2cbd65fff8" target="_blank">Live Demo</a> •
<a href="https://getanteon.com/docs/" target="_blank">Documentation</a> •
<a href="https://getanteon.com/docs/deployment" target="_blank">Deployment</a> •
<a href="https://discord.com/invite/9KdnrSUZQg" target="_blank">Discord</a>
</h2>


## What is Alaz?

[Alaz](https://github.com/ddosify/alaz) is an open-source Ddosify eBPF agent that can inspect and collect Kubernetes (K8s) service traffic without the need for code instrumentation, sidecars, or service restarts. This is possible due to its use of eBPF technology.
[Alaz](https://github.com/getanteon/alaz) is an open-source Anteon eBPF agent that can inspect and collect Kubernetes (K8s) service traffic without the need for code instrumentation, sidecars, or service restarts. This is possible due to its use of eBPF technology.

Alaz can create a **Service Map** that helps identify golden signals and problems like:
- High latencies between K8s services
- Detect 5xx HTTP status codes
- Detect Idle / Zombie services
- Detect slow SQL queries

Additionally, Ddosify tracks and displays live data on your cluster instances CPU, memory, disk, and network usage. All of the dashboards are generated out-of-box and you can create alerts based on these metrics values. Check out the [docs](https://docs.ddosify.com/) for more.
Additionally, Anteon tracks and displays live data on your cluster instances CPU, memory, disk, and network usage. All of the dashboards are generated out-of-box and you can create alerts based on these metrics values. Check out the [docs](https://getanteon.com/docs/) for more.

<p align="center">
<img src="https://raw.githubusercontent.com/ddosify/alaz/master/assets/ddosify_metrics.png" alt="Ddosify Kubernetes Monitoring Metrics" />
<i>Ddosify tracks and displays live data on your cluster instances CPU, memory, disk, and network usage.</i>
<img src="https://raw.githubusercontent.com/getanteon/anteon/master/assets/anteon_metrics.png" alt="Anteon Kubernetes Monitoring Metrics" />
<i>Anteon tracks and displays live data on your cluster instances CPU, memory, disk, and network usage.</i>
</p>


➡️ For more information about Ddosify, see [Ddosify](https://github.com/ddosify/ddosify).
➡️ For more information about Anteon, see [Anteon](https://github.com/getanteon/anteon).

## Features

Expand All @@ -48,98 +48,98 @@ Inspect and collect K8s service traffic without the need for code instrumentatio

**Effortless:**

Ddosify will create the Service Map & Metrics Dashboard that helps identify golden signals and issues such as high latencies, 5xx errors, zombie services.
Anteon will create the Service Map & Metrics Dashboard that helps identify golden signals and issues such as high latencies, 5xx errors, zombie services.

**Prometheus Compatible:**

Gather system information and resources via the Prometheus Node Exporter, which is readily available on the agent.

**Cloud or On-premise:**

Export metrics to [Ddosify Cloud](https://ddosify.com), or install the [Ddosify Self-Hosted](https://github.com/ddosify/ddosify/tree/master/selfhosted) in your infrastructure and manage everything according to your needs.
Export metrics to [Anteon Cloud](https://getanteon.com), or install the [Anteon Self-Hosted](https://github.com/getanteon/anteon/tree/master/selfhosted) in your infrastructure and manage everything according to your needs.

**Test & Observe:**

Ddosify Performance Testing and Alaz can work collaboratively. You can start a load test and monitor your system simultaneously. This will help you spot performance issues instantly. Check out the [Ddosify GitHub Repository](https://github.com/ddosify/ddosify) for more information about Ddosify Stack.
Anteon Performance Testing and Alaz can work collaboratively. You can start a load test and monitor your system simultaneously. This will help you spot performance issues instantly. Check out the [Anteon GitHub Repository](https://github.com/getanteon/anteon) for more information about Anteon Stack.

**Alerts for Anomalies:** If something unusual, like a sudden increase in CPU usage, happens in your Kubernetes (K8s) cluster, Ddosify immediately sends alerts to your Slack.
**Alerts for Anomalies:** If something unusual, like a sudden increase in CPU usage, happens in your Kubernetes (K8s) cluster, Anteon immediately sends alerts to your Slack.

✅ Works on both Arm64 and x86_64 architectures.

## Getting Started

To use Alaz, you need to have a [Ddosify Cloud](https://app.ddosify.com/register) account or [Ddosify Self-Hosted](https://github.com/ddosify/ddosify/tree/master/selfhosted) installed.
To use Alaz, you need to have a [Anteon Cloud](https://app.getanteon.com/register) account or [Anteon Self-Hosted](https://github.com/getanteon/anteon/tree/master/selfhosted) installed.

### ☁️ For Ddosify Cloud
### ☁️ For Anteon Cloud

1. Register for a [Ddosify Cloud account](https://app.ddosify.com/register).
2. Add a cluster on the [Observability page](https://app.ddosify.com/clusters). You will receive a Monitoring ID and instructions.
1. Register for a [Anteon Cloud account](https://app.getanteon.com/register).
2. Add a cluster on the [Observability page](https://app.getanteon.com/clusters). You will receive a Monitoring ID and instructions.
3. Run the agent on your Kubernetes cluster using the instructions you received. There are two options for Kubernetes deployment:

#### Using the kubectl

```bash
# Replace <MONITORING_ID> with your monitoring ID from the Ddosify Cloud. Change XXXXX with your monitoring ID.
# Replace <MONITORING_ID> with your monitoring ID from the Anteon Cloud. Change XXXXX with your monitoring ID.
MONITORING_ID=XXXXX
curl -sSL https://raw.githubusercontent.com/ddosify/alaz/master/resources/alaz.yaml -o alaz.yaml
curl -sSL https://raw.githubusercontent.com/getanteon/alaz/master/resources/alaz.yaml -o alaz.yaml
sed -i"" -e "s/<MONITORING_ID>/$MONITORING_ID/g" alaz.yaml
kubectl create namespace ddosify
kubectl create namespace anteon
kubectl apply -f alaz.yaml
```

#### Using the Helm

```bash
# Replace <MONITORING_ID> with your monitoring ID from the Ddosify Cloud. Change XXXXX with your monitoring ID.
# Replace <MONITORING_ID> with your monitoring ID from the Anteon Cloud. Change XXXXX with your monitoring ID.
MONITORING_ID=XXXXX
helm repo add ddosify https://ddosify.github.io/ddosify-helm-charts/
helm repo add anteon https://getanteon.github.io/anteon-helm-charts/
helm repo update
kubectl create namespace ddosify
helm upgrade --install --namespace ddosify alaz ddosify/alaz --set monitoringID=$MONITORING_ID
kubectl create namespace anteon
helm upgrade --install --namespace anteon alaz anteon/alaz --set monitoringID=$MONITORING_ID
```

Then you can view the metrics and Kubernetes Service Map on the [Ddosify Observability dashboard](https://app.ddosify.com/clusters). For more information, see [Ddosify Kubernetes Monitoring](https://docs.ddosify.com/ddosify/kubernetes-monitoring).
Then you can view the metrics and Kubernetes Service Map on the [Anteon Observability dashboard](https://app.getanteon.com/clusters). For more information, see [Anteon Kubernetes Monitoring](https://getanteon.com/docs/kubernetes-monitoring/).

### 🏠 For Ddosify Self-Hosted
### 🏠 For Anteon Self-Hosted

1. Install [Ddosify Self-Hosted](https://github.com/ddosify/ddosify/tree/master/selfhosted)
1. Install [Anteon Self-Hosted](https://github.com/getanteon/anteon/tree/master/selfhosted)
2. Add a cluster on the Observability page of your Self-Hosted frontend. You will receive a Monitoring ID and instructions.
3. Run the agent on your Kubernetes cluster using the instructions you received.

Note: After you install Ddosify Self-Hosted, you will have a Ddosify Self-Hosted endpoint of nginx reverse proxy. The base URL of the Ddosify Self-Hosted endpoint forwards traffic to the frontend. The base URL of the Ddosify Self-Hosted endpoint with `/api` suffix forwards traffic to the backend. So you need to set the backend host variable as `http://<your-ddosify-self-hosted-endpoint>/api`.
Note: After you install Anteon Self-Hosted, you will have a Anteon Self-Hosted endpoint of nginx reverse proxy. The base URL of the Anteon Self-Hosted endpoint forwards traffic to the frontend. The base URL of the Anteon Self-Hosted endpoint with `/api` suffix forwards traffic to the backend. So you need to set the backend host variable as `http://<your-anteon-self-hosted-endpoint>/api`.

There are two options for Kubernetes deployment:

#### Using the kubectl

```bash
# Replace <MONITORING_ID> with your monitoring ID from the Ddosify Cloud. Change XXXXX with your monitoring ID.
# Replace <MONITORING_ID> with your monitoring ID from the Anteon Cloud. Change XXXXX with your monitoring ID.
MONITORING_ID=XXXXX
# Set BACKEND_HOST with your Ddosify Self Hosted Endpoint. If your Ddosify Self Hosted endpoint is http://localhost:8014, then BACKEND_HOST=localhost:8014
# Set BACKEND_HOST with your Anteon Self Hosted Endpoint. If your Anteon Self Hosted endpoint is http://localhost:8014, then BACKEND_HOST=localhost:8014
BACKEND_HOST=XXXXX
curl -sSL https://raw.githubusercontent.com/ddosify/alaz/master/resources/alaz.yaml -o alaz.yaml
curl -sSL https://raw.githubusercontent.com/getanteon/alaz/master/resources/alaz.yaml -o alaz.yaml
sed -i"" -e "s/<MONITORING_ID>/$MONITORING_ID/g" alaz.yaml
sed -i"" -e "s/https:\/\/api-alaz.ddosify.com:443/http:\/\/$BACKEND_HOST\/api/g" alaz.yaml
kubectl create namespace ddosify
sed -i"" -e "s/https:\/\/api-alaz.getanteon.com:443/http:\/\/$BACKEND_HOST\/api/g" alaz.yaml
kubectl create namespace anteon
kubectl apply -f alaz.yaml
```

#### Using the Helm

```bash
# Replace <MONITORING_ID> with your monitoring ID from the Ddosify Cloud. Change XXXXX with your monitoring ID.
# Replace <MONITORING_ID> with your monitoring ID from the Anteon Cloud. Change XXXXX with your monitoring ID.
MONITORING_ID=XXXXX
# Set BACKEND_HOST with your Ddosify Self Hosted Endpoint. If your Ddosify Self Hosted endpoint is http://localhost:8014, then BACKEND_HOST=http://localhost:8014/api
# Set BACKEND_HOST with your Anteon Self Hosted Endpoint. If your Anteon Self Hosted endpoint is http://localhost:8014, then BACKEND_HOST=http://localhost:8014/api
BACKEND_HOST=XXXXX
helm repo add ddosify https://ddosify.github.io/ddosify-helm-charts/
helm repo add anteon https://getanteon.github.io/anteon-helm-charts/
helm repo update
kubectl create namespace ddosify
helm upgrade --install --namespace ddosify alaz ddosify/alaz --set monitoringID=$MONITORING_ID --set backendHost=$BACKEND_HOST
kubectl create namespace anteon
helm upgrade --install --namespace anteon alaz anteon/alaz --set monitoringID=$MONITORING_ID --set backendHost=$BACKEND_HOST
```

Then you can view the metrics and Kubernetes Service Map on the Ddosify Self-Hosted Observability dashboard. For more information, see [Ddosify Monitoring Docs](https://docs.ddosify.com/ddosify/kubernetes-monitoring).
Then you can view the metrics and Kubernetes Service Map on the Anteon Self-Hosted Observability dashboard. For more information, see [Anteon Monitoring Docs](https://getanteon.com/docs/kubernetes-monitoring/).

Alaz runs as a DaemonSet on your Kubernetes cluster. It collects metrics and sends them to Ddosify Cloud or Ddosify Self-Hosted. You can view the metrics on the Ddosify Observability dashboard. For the detailed Alaz architecture, see [Alaz Architecture](https://github.com/ddosify/alaz/blob/master/Alaz-Architecture.md).
Alaz runs as a DaemonSet on your Kubernetes cluster. It collects metrics and sends them to Anteon Cloud or Anteon Self-Hosted. You can view the metrics on the Anteon Observability dashboard. For the detailed Alaz architecture, see [Alaz Architecture](https://github.com/getanteon/alaz/blob/master/Alaz-Architecture.md).

## Cleanup

Expand All @@ -148,13 +148,13 @@ To remove Alaz from your Kubernetes cluster, run the following command:
- For Kubectl

```bash
kubectl delete -f https://raw.githubusercontent.com/ddosify/alaz/master/resources/alaz.yaml
kubectl delete -f https://raw.githubusercontent.com/getanteon/alaz/master/resources/alaz.yaml
```

- For Helm

```bash
helm delete alaz --namespace ddosify
helm delete alaz --namespace anteon
```

## Supported Protocols
Expand Down
4 changes: 3 additions & 1 deletion aggregator/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ func (a *Aggregator) processk8s() {
a.processContainer(d)
case k8s.DAEMONSET:
a.processDaemonSet(d)
case k8s.STATEFULSET:
a.processStatefulSet(d)
default:
log.Logger.Warn().Msgf("unknown resource type %s", d.ResourceType)
}
Expand Down Expand Up @@ -1016,7 +1018,7 @@ func (a *Aggregator) processL7(ctx context.Context, d *l7_req.L7Event) {
if skInfo == nil {
log.Logger.Debug().Uint32("pid", d.Pid).
Uint64("fd", d.Fd).Uint64("writeTime", d.WriteTimeNs).
Str("protocol", d.Protocol).Any("payload", string(d.Payload[:])).Msg("socket not found")
Str("protocol", d.Protocol).Any("payload", string(d.Payload[:d.PayloadSize])).Msg("socket not found")
return
}

Expand Down
19 changes: 19 additions & 0 deletions aggregator/persist.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,22 @@ func (a *Aggregator) processDaemonSet(d k8s.K8sResourceMessage) {
go a.ds.PersistDaemonSet(dtoDaemonSet, DELETE)
}
}

func (a *Aggregator) processStatefulSet(d k8s.K8sResourceMessage) {
statefulSet := d.Object.(*appsv1.StatefulSet)

dtoStatefulSet := datastore.StatefulSet{
UID: string(statefulSet.UID),
Name: statefulSet.Name,
Namespace: statefulSet.Namespace,
}

switch d.EventType {
case k8s.ADD:
go a.ds.PersistStatefulSet(dtoStatefulSet, ADD)
case k8s.UPDATE:
go a.ds.PersistStatefulSet(dtoStatefulSet, UPDATE)
case k8s.DELETE:
go a.ds.PersistStatefulSet(dtoStatefulSet, DELETE)
}
}
Binary file removed assets/ddosify_metrics.png
Binary file not shown.
Binary file removed assets/ddosify_service_map.png
Binary file not shown.
Loading

0 comments on commit 854f681

Please sign in to comment.