Skip to content

Commit

Permalink
feat: pull upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv committed Oct 26, 2023
1 parent a0ac63a commit 358cfd7
Show file tree
Hide file tree
Showing 253 changed files with 19,661 additions and 10,804 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/collector-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/demo-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test Demo Chart

on:
pull_request:
paths:
- 'charts/opentelemetry-demo/**'
branches:
- main

jobs:
demo-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
with:
create-kind-cluster: "true"

- name: Run chart-testing (install)
run: "ct install --charts charts/opentelemetry-demo
--chart-repos opentelemetry-collector=https://open-telemetry.github.io/opentelemetry-helm-charts
--chart-repos prometheus=https://prometheus-community.github.io/helm-charts
--chart-repos grafana=https://grafana.github.io/helm-charts
--chart-repos jaeger=https://jaegertracing.github.io/helm-charts"
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
Expand All @@ -19,7 +19,7 @@ jobs:
create-kind-cluster: "false"

- name: Run chart-testing (lint)
run: "ct lint --target-branch main
run: "ct lint --target-branch main --debug
--chart-repos opentelemetry-collector=https://open-telemetry.github.io/opentelemetry-helm-charts
--chart-repos prometheus=https://prometheus-community.github.io/helm-charts
--chart-repos grafana=https://grafana.github.io/helm-charts
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/operator-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test Operator Charts

on:
pull_request:
paths:
- 'charts/opentelemetry-operator/**'
branches:
- main

jobs:
operator-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
with:
create-kind-cluster: "true"

- name: Check CRDs
run: make check-operator-crds

- name: Install Openshift route crd
run: kubectl apply -f https://raw.githubusercontent.com/openshift/router/master/deploy/route_crd.yaml

- name: Install cert-manager
run: |
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml
kubectl wait --timeout=5m --for=condition=available deployment cert-manager -n cert-manager
kubectl wait --timeout=5m --for=condition=available deployment cert-manager-webhook -n cert-manager
- name: Run chart-testing (install)
run: ct install --charts charts/opentelemetry-operator

- name: Get opentelemetry-operator repository
run: |
appVersion=$(cat ./charts/opentelemetry-operator/Chart.yaml | sed -nr 's/appVersion: ([0-9]+\.[0-9]+\.[0-9]+)/\1/p')
git clone -b v"$appVersion" --single-branch https://github.com/open-telemetry/opentelemetry-operator.git ./opentelemetry-operator
- name: Use public target-allocator image in tests
run: |
LOCAL_TARGET_ALLOCATOR_IMG="local\/opentelemetry-operator-targetallocator:e2e"
PUBLIC_TARGET_ALLOCATOR_IMG="ghcr.io\/open-telemetry\/opentelemetry-operator\/target-allocator:0.1.0"
sed -i "s/$LOCAL_TARGET_ALLOCATOR_IMG/${PUBLIC_TARGET_ALLOCATOR_IMG}/g" ./opentelemetry-operator/tests/e2e/smoke-targetallocator/*.yaml
sed -i "s/$LOCAL_TARGET_ALLOCATOR_IMG/${PUBLIC_TARGET_ALLOCATOR_IMG}/g" ./opentelemetry-operator/tests/e2e/targetallocator-features/00-install.yaml
sed -i "s/$LOCAL_TARGET_ALLOCATOR_IMG/${PUBLIC_TARGET_ALLOCATOR_IMG}/g" ./opentelemetry-operator/tests/e2e/prometheus-config-validation/*.yaml
- name: Install kuttl
run: |
sudo curl -Lo /usr/local/bin/kubectl-kuttl https://github.com/kudobuilder/kuttl/releases/download/v0.12.1/kubectl-kuttl_0.12.1_linux_x86_64
sudo chmod +x /usr/local/bin/kubectl-kuttl
export PATH=$PATH:/usr/local/bin
- name: Install metrics-server
run: |
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
kubectl patch deployment -n kube-system metrics-server --type "json" -p '[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": --kubelet-insecure-tls}]'
kubectl wait --for=condition=available deployment/metrics-server -n kube-system --timeout=5m
- name: Install opentelemetry-operator chart
run: |
helm install --namespace=opentelemetry-operator-system --create-namespace my-opentelemetry-operator ./charts/opentelemetry-operator --set "manager.featureGates=operator.autoinstrumentation.go"
kubectl wait --timeout=5m --for=condition=available deployment my-opentelemetry-operator -n opentelemetry-operator-system
- name: Run e2e tests
run: kubectl kuttl test ./opentelemetry-operator/tests/e2e --config ./charts/opentelemetry-operator/kuttl-test.yaml
3 changes: 3 additions & 0 deletions charts/opentelemetry-collector/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## OpenTelemetry Collector

### v0.73.7 / 2023-10-26
- [CHORE] Pull upstream changes

### v0.73.0 / 2023-10-05

- [CHORE] Bump Collector to 0.85.0
Expand Down
4 changes: 2 additions & 2 deletions charts/opentelemetry-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: opentelemetry-collector
version: 0.73.6
version: 0.73.7
description: OpenTelemetry Collector Helm chart for Kubernetes
type: application
home: https://opentelemetry.io/
Expand All @@ -11,5 +11,5 @@ sources:
- https://github.com/open-telemetry/opentelemetry-helm-charts
icon: https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png
maintainers:
- name: povilasv
- name: povilasv
appVersion: 0.85.0
94 changes: 63 additions & 31 deletions charts/opentelemetry-collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ helm install my-opentelemetry-collector open-telemetry/opentelemetry-collector -

Where the `mode` value needs to be set to one of `daemonset`, `deployment` or `statefulset`.

For an in-depth walk through getting started in Kubernetes using this helm chart, see [OpenTelemetry Kubernetes Getting Started](https://opentelemetry.io/docs/kubernetes/getting-started/).

## Upgrading

See [UPGRADING.md](UPGRADING.md).
Expand All @@ -42,7 +44,7 @@ Some care must be taken when using `hostNetwork: true`, as then OpenTelemetry Co
### Default configuration

By default this chart will deploy an OpenTelemetry Collector with three pipelines (logs, metrics and traces)
and logging exporter enabled by default. The collector can be installed either as daemonset (agent), deployment or stateful set.
and debug exporter enabled by default. The collector can be installed either as daemonset (agent), deployment or stateful set.

*Example*: Install collector as a deployment.

Expand All @@ -56,11 +58,9 @@ By default collector has the following receivers enabled:
- **traces**: OTLP, zipkin and jaeger (thrift and grpc).
- **logs**: OTLP (to enable container logs, see [Configuration for Kubernetes container logs](#configuration-for-kubernetes-container-logs)).
There are two ways to configure collector pipelines, which can be used together as well.
### Basic top level configuration
### Basic Top Level Configuration
Default components can be removed with `null`. When changing a pipeline, you must explicitly list all the components that are in the pipeline, including any default components.
The Collector's configuration is set via the `config` section. Default components can be removed with `null`. Remember that lists in helm are not merged, so if you want to modify any default list you must specify all items, including any default items you want to keep.

*Example*: Disable metrics and logging pipelines and non-otlp receivers:

Expand All @@ -79,24 +79,15 @@ config:
logs: null
```

*Example*: Add host metrics receiver:
The chart also provides several presets, detailed below, to help configure important Kubernetes components. For more details on each component, see [Kubernetes Collector Components](https://opentelemetry.io/docs/kubernetes/collector/components/).

```yaml
mode: daemonset
presets:
hostMetrics:
enabled: true
```

### Configuration for Kubernetes container logs
### Configuration for Kubernetes Container Logs

The collector can be used to collect logs sent to standard output by Kubernetes containers.
This feature is disabled by default. It has the following requirements:

- It needs agent collector to be deployed.
- It requires the [contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib) version
of the collector image.
- It requires the [Filelog receiver](https://opentelemetry.io/docs/kubernetes/collector/components/#filelog-receiver) to be included in the collector, such as [contrib](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) version of the collector image.

To enable this feature, set the `presets.logsCollection.enabled` property to `true`.
Here is an example `values.yaml`:
Expand All @@ -115,19 +106,19 @@ to read the files where Kubernetes container runtime writes all containers' cons

#### :warning: Warning: Risk of looping the exported logs back into the receiver, causing "log explosion"

The container logs pipeline uses the `logging` console exporter by default.
The container logs pipeline uses the `debug` exporter by default.
Paired with the default `filelog` receiver that receives all containers' console output,
it is easy to accidentally feed the exported logs back into the receiver.

Also note that using the `--log-level=debug` option for the `logging` exporter causes it to output
Also note that using the `--verbosity=detailed` option for the `debug` exporter causes it to output
multiple lines per single received log, which when looped, would amplify the logs exponentially.

To prevent the looping, the default configuration of the receiver excludes logs from the collector's containers.

If you want to include the collector's logs, make sure to replace the `logging` exporter
If you want to include the collector's logs, make sure to replace the `debug` exporter
with an exporter that does not send logs to collector's standard output.

Here's an example `values.yaml` file that replaces the default `logging` exporter on the `logs` pipeline
Here's an example `values.yaml` file that replaces the default `debug` exporter on the `logs` pipeline
with an `otlphttp` exporter that sends the container logs to `https://example.com:55681` endpoint.
It also clears the `filelog` receiver's `exclude` property, for collector logs to be included in the pipeline.

Expand All @@ -150,13 +141,13 @@ config:
- otlphttp
```

### Configuration for Kubernetes attributes processor
### Configuration for Kubernetes Attributes Processor

The collector can be configured to add Kubernetes metadata to logs, metrics and traces.
The collector can be configured to add Kubernetes metadata, such as pod name and namespace name, as resource attributes to incoming logs, metrics and traces.

This feature is disabled by default. It has the following requirements:

- It requires [k8sattributesprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/k8sattributesprocessor) processor to be included in the collector, such as [contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib) version of the collector image.
- It requires the [Kubernetes Attributes processor](https://opentelemetry.io/docs/kubernetes/collector/components/#kubernetes-attributes-processor) to be included in the collector, such as [contrib](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) version of the collector image.

To enable this feature, set the `presets.kubernetesAttributes.enabled` property to `true`.
Here is an example `values.yaml`:
Expand All @@ -166,6 +157,28 @@ mode: daemonset
presets:
kubernetesAttributes:
enabled: true
# You can also configure the preset to add all of the associated pod's labels and annotations to you telemetry.
# The label/annotation name will become the resource attribute's key.
extractAllPodLabels: true
extractAllPodAnnotations: true
```

### Configuration for Retrieving Kubelet Metrics

The collector can be configured to collect node, pod, and container metrics from the API server on a kubelet.

This feature is disabled by default. It has the following requirements:

- It requires the [Kubeletstats receiver](https://opentelemetry.io/docs/kubernetes/collector/components/#kubeletstats-receiver) to be included in the collector, such as [contrib](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) version of the collector image.

To enable this feature, set the `presets.kubeletMetrics.enabled` property to `true`.
Here is an example `values.yaml`:

```yaml
mode: daemonset
presets:
kubeletMetrics:
enabled: true
```

### Configuration for Kubernetes Cluster Metrics
Expand All @@ -174,7 +187,7 @@ The collector can be configured to collects cluster-level metrics from the Kuber

This feature is disabled by default. It has the following requirements:

- It requires [k8sclusterreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/k8sclusterreceiver) to be included in the collector, such as [contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib) version of the collector image.
- It requires the [Kubernetes Cluster receiver](https://opentelemetry.io/docs/kubernetes/collector/components/#kubernetes-cluster-receiver) to be included in the collector, such as [contrib](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) version of the collector image.
- It requires statefulset or deployment mode with a single replica.

To enable this feature, set the `presets.clusterMetrics.enabled` property to `true`.
Expand All @@ -189,25 +202,44 @@ presets:
enabled: true
```

### Configuration for retrieving Kubelet metrics
### Configuration for Retrieving Kubernetes Events

The collector can be configured to collect Kubelet metrics.
The collector can be configured to collect Kubernetes events.

This feature is disabled by default. It has the following requirements:

- It requires [kubeletstats](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/kubeletstatsreceiver) receiver to be included in the collector, such as [contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib) version of the collector image.
- It requires [Kubernetes Objects receiver](https://opentelemetry.io/docs/kubernetes/collector/components/#kubernetes-objects-receiver) to be included in the collector, such as [contrib](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) version of the collector image.

To enable this feature, set the `presets.kubeletMetrics.enabled` property to `true`.
To enable this feature, set the `presets.kubernetesEvents.enabled` property to `true`.
Here is an example `values.yaml`:

```yaml
mode: deployment
replicaCount: 1
presets:
kubernetesEvents:
enabled: true
```

### Configuration for Host Metrics

The collector can be configured to collect host metrics for Kubernetes nodes.

This feature is disabled by default. It has the following requirements:

- It requires [Host Metrics receiver](https://opentelemetry.io/docs/kubernetes/collector/components/#host-metrics-receiver) to be included in the collector, such as [contrib](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) version of the collector image.

To enable this feature, set the `presets.hostMetrics.enabled` property to `true`.
Here is an example `values.yaml`:

```yaml
mode: daemonset
presets:
kubeletMetrics:
hostMetrics:
enabled: true
```

### CRDs
## CRDs

At this time, Prometheus CRDs are supported but other CRDs are not.

Expand Down
35 changes: 35 additions & 0 deletions charts/opentelemetry-collector/UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,41 @@ These upgrade guidelines only contain instructions for version upgrades which re
If the version you want to upgrade to is not listed here, then there is nothing to do for you.
Just upgrade and enjoy.

## Feature Flags

### useGOMEMLIMIT

A new flag, `useGOMEMLIMIT` has been added that allows specifying whether or not the chart should use the `GOMEMLIMIT` environment variable or the Memory Ballast Extension.
When enabled, the chart will remove the Memory Ballast Extension from the collector's configuration AND will setup a `GOMEMLIMIT` environment variable that is set to 80%
of the configured `resources.limits.memory`. If no `resources.limits.memory` are set when `useGOMEMLIMIT` is enabled then a `GOMEMLIMIT` environment variable WILL NOT be
created but the Memory Ballast Extension will still be removed.

If you are not interested in using `GOMEMLIMIT` then this change does not affect you. But, depending on the progress made in [Issue 891](https://github.com/open-telemetry/opentelemetry-helm-charts/issues/891),
the use of `GOMEMLIMIT` may completely replace the Memory Ballast Extension in the future.

## 0.69.3 to 0.70.0

The following deprecated fields have been removed. Please use the new values:

- `extraConfigMapMounts` -> `extraVolumes`
- `extraHostPathMounts` -> `extraVolumes`
- `secretMounts` -> `extraVolumes`
- `containerLogs` -> `presets.logsCollection`

## 0.69.0 to 0.69.1 & 0.69.2

The `loggingexporter` was replaced with the `debugexporter`. This ended up being an accidental breaking change for any user that depended on the default logging exporter config when explicitly listing the logging exporter in an exporter list.

When using versions `0.69.1` or `0.69.2` you should explicitly list the debugging exporter instead of the logging exporter. You other option is to skip these version and use `0.69.3` or newer, which includes the logging exporter configuration.

**The logging exporter will be removed in a future version.** We highly recommend switching to the debug exporter.

## 0.67 to 0.68

The `preset.kubernetesEvents` preset now excludes `DELETED` watch types so that an log is not ingested when Kubernetes deletes an event.
The intention behind this change is to cleanup the data ingested by the preset as the `DELETED` updated for a Kubernetes Events is
uninteresting. If you want to keep ingesting `DELETED` updates for Kubernetes Events you will need to configure the `k8sobjectsreceiver` manually.

## 0.62 to 0.63

The `kubernetesAttributes` preset now respects order of processors in logs, metrics and traces pipelines.
Expand Down
3 changes: 3 additions & 0 deletions charts/opentelemetry-collector/ci/GOMEMLIMIT-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mode: deployment

useGOMEMLIMIT: true
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: ClusterRole
metadata:
name: example-opentelemetry-collector
labels:
helm.sh/chart: opentelemetry-collector-0.73.6
helm.sh/chart: opentelemetry-collector-0.73.7
app.kubernetes.io/name: opentelemetry-collector
app.kubernetes.io/instance: example
app.kubernetes.io/version: "0.85.0"
Expand Down
Loading

0 comments on commit 358cfd7

Please sign in to comment.