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

[Release] logzio APM Collector 1.0.0 #561

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
94 changes: 94 additions & 0 deletions .github/workflows/logzio-apm-collector-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Test `logzio-apm-collector` chart

on:
pull_request:
branches:
- master
paths:
- 'charts/logzio-apm-collector/Chart.yaml'
- 'charts/logzio-apm-collector/templates/**'
- 'charts/logzio-apm-collector/values.yaml'
jobs:
test-helm-chart:
name: Test Helm Chart on Kind
runs-on: ubuntu-latest
steps:
- name: Generate random id
id: random_id
run: echo "::set-output name=rand::$(echo $RANDOM)"

- name: Set ENV_ID
run: echo "ENV_ID=apm-test-run-${{ steps.random_id.outputs.rand }}" >> $GITHUB_ENV

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'

- name: Set up Helm
uses: azure/[email protected]

- name: Set up kubectl
uses: azure/setup-kubectl@v4

- name: Install Kind
run: |
curl -Lo ./kind "https://kind.sigs.k8s.io/dl/v0.11.1/kind-Linux-amd64"
chmod +x ./kind
mv ./kind /usr/local/bin/kind

- name: Create Kind cluster
run: |
kind create cluster --name kind-${{ github.run_id }}-${{ matrix.mode }}
kubectl cluster-info

- name: Deploy Helm Chart
run: |
cd charts/logzio-apm-collector
helm upgrade --install \
--set enabled=true \
--set spm.enabled=true \
--set serviceGraph.enabled=true \
--set global.logzioTracesToken=${{ secrets.LOGZIO_TRACES_TOKEN }} \
--set global.logzioSpmToken=${{ secrets.LOGZIO_METRICS_TOKEN }} \
--set global.logzioRegion="us" \
--set global.env_id=${{ env.ENV_ID }} \
logzio-apm-collector .
kubectl rollout status deployment/logzio-apm-collector --timeout=300s
kubectl rollout status deployment/logzio-apm-collector-spm --timeout=300s

- name: Run trace generator
run: |
kubectl apply -f tests/resources/tracegen-apm.yaml
kubectl rollout status deployment/trace-gen --timeout=300s

- name: Run otel demo for service graph
run: |
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo update
helm install otel-demo -f tests/resources/otel-demo-apm.yaml open-telemetry/opentelemetry-demo --version 0.32.5
kubectl rollout status deployment/otel-demo-loadgenerator --timeout=300s

- name: sleep for 3 minutes
run: sleep 180

- name: Run Go Tests
env:
LOGZIO_METRICS_API_KEY: ${{ secrets.LOGZIO_METRICS_API_KEY }}
LOGZIO_TRACES_API_KEY: ${{ secrets.LOGZIO_TRACES_API_KEY }}
run: |
go get go.uber.org/zap
go test -v ./tests/traces_e2e_test.go ./tests/common.go
go test -v ./tests/apm_metrics_e2e_test.go ./tests/common.go

- name: Cleanup Environment
run: |
helm uninstall logzio-apm-collector

- name: Delete Kind cluster
if: always()
run: kind delete cluster --name kind-${{ github.run_id }}-${{ matrix.mode }}

23 changes: 23 additions & 0 deletions charts/logzio-apm-collector/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
7 changes: 7 additions & 0 deletions charts/logzio-apm-collector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changes by Version

<!-- next version -->

## 1.0.0 (date?)
- Initial release
- Kubernetes APM Agent for Logz.io, based on OpenTelemetry Collector
11 changes: 11 additions & 0 deletions charts/logzio-apm-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
name: logzio-apm-collector
version: 1.0.0
description: Kubernetes APM agent for Logz.io based on OpenTelemetry Collector
type: application
home: https://logz.io/
icon: https://logzbucket.s3.eu-west-1.amazonaws.com/logz-io-img/logo400x400.png
maintainers:
- name: Naama Bendalak
email: [email protected]
appVersion: 0.115.1
93 changes: 93 additions & 0 deletions charts/logzio-apm-collector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Logz.io APM Collector Helm Chart
> [!IMPORTANT]
> Kubernetes APM Collection Agent is still In development

This Helm chart deploys an agent, which leverages the OpenTelemetry Collector, that collects traces and span metrics from Kubernetes clusters and sends them to Logz.io.


## Prerequisites
- Kubernetes 1.24+
- Helm 3.9+

## Installation
### Add Logz.io Helm Repository
Before installing the chart, add the Logz.io Helm repository:
```shell
helm repo add logzio-helm https://logzio.github.io/logzio-helm
helm repo update
```

### Install the Chart

The chart provides options for enabling the following:
1. Traces
2. SPM (Service Performance Monitoring)
3. Service Graph


```shell
helm install -n monitoring --create-namespace \
--set enabled=true \
--set spm.enabled=true \
--set serviceGraph.enabled=true \
--set global.logzioTracesToken="<<LOGZIO_TRACES_TOKEN>>" \
--set global.logzioSpmToken="<<LOGZIO_SPM_TOKEN>>" \
--set global.logzioRegion="<<LOGZIO_REGION_CODE>>" \
--set global.env_id="<<ENV_ID>>" \
logzio-apm-collector logzio-helm/logzio-apm-collector
```

> [!NOTE]
> To disable either one of SPM or Service Graph remove the relevant `--set XXX.enabled` line from the above command.

> [!IMPORTANT]
> Values of `<<LOGZIO_TRACES_TOKEN>>`, `<<LOGZIO_SPM_TOKEN>>` and `<<LOGZIO_REGION_CODE>>` can be found in your Logz.io account.
> For `<<ENV_ID>>` define any environment identifier attribute (for example, the cluster name).


## Configuration

- [All configuration options](./VALUES.md)
- [Instrumentation](#instrumentation)
- [Custom Trace Sampling rules](#custom-trace-sampling-rules)


## Instrumentation
If you're using manual instrumentation or an instrumentation agent, configure it to export data to the Logz.io APM collector by setting the export/output address as follows:

```
logzio-apm-collector.monitoring.svc.cluster.local:<<PORT>>
```

> [!IMPORTANT]
> Replace `<<PORT>>` based on the protocol your agent uses:
> - 4317 for GRCP
> - 4318 for HTTP
>
> For a complete list, see `values.yaml` >> `traceConfig` >> `receivers`.


## Custom trace sampling rules
To customize the Traces Sampling rules in the OpenTelemetry Collector, you can follow the below steps:

- **Step 1**: Create [customized Tail sampling rules configuration](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor).

- **Step 2**: Update the `values.yaml` file:

Get the current Chart's `values.yaml` file:
```shell
helm get values logzio-apm-collector -n monitoring > new-values.yaml
```

Edit the section under `traceConfig` >> `processors` >> `tail_sampling` in `new-values.yaml` to contain the custom config which you created in step 1.

- **Step 3**: Apply the config:
```shell
helm upgrade logzio-apm-collector logzio-helm/logzio-apm-collector -n monitoring -f new-values.yaml
```

## Uninstalling
To uninstall the `logzio-apm-collector` chart, you can use:
```shell
helm uninstall -n monitoring logzio-apm-collector
```
Loading
Loading