Skip to content

Commit

Permalink
Merge branch 'main' of github.com:open-telemetry/opentelemetry-operat…
Browse files Browse the repository at this point in the history
…or into feature/2588
  • Loading branch information
iblancasa committed Mar 25, 2024
2 parents 774b10c + dab898f commit 87c29f8
Show file tree
Hide file tree
Showing 214 changed files with 33,860 additions and 14,594 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
component: auto-instrumentation

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Bump NodeJS autoinstrumentations dependency to a version that supports enabling selected instrumentations via environment variable."

# One or more tracking issues related to the change
issues: [2622]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
See [the documentation](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node#usage-auto-instrumentation) for details.
Usage example: `export OTEL_NODE_ENABLED_INSTRUMENTATIONS="http,nestjs-core"`.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: change dotnet instrumentation feature gate into command line flag --enable-dotnet-instrumentation
note: Added missing label for Service/Pod Monitors

# One or more tracking issues related to the change
issues: [2582, 2671]
issues: [2251]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
subtext:
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
component: target allocator
# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
component: operator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Fix per-node target allocation for targets from endpointslices"
note: remove featuregate `operator.autoinstrumentation.python`. Use command line flag `--enable-python-instrumentation` instead

# One or more tracking issues related to the change
issues: [2718]
issues: [2582, 2672]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: "The per-node target allocation strategy was not matching endpointslice entries for with a `kind` of Node, such as those for the kubelet metrics created by the prometheus operator"
subtext:
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
component: operator
component: instrumentation

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Removes UPDATE from pod mutating admission webhook since it only needs to mutate on pod CREATE events."
note: "Don't preserve ownership of files copied from the autoinstrumenation image. This avoids issues when instrumenting workloads running as non-root"

# One or more tracking issues related to the change
issues: [1514]
issues: [2655]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: "The pod webhook currently modifies the pod spec in invalid ways on UPDATE events, and UPDATES are not necessary in the webhook."
subtext:
16 changes: 16 additions & 0 deletions .chloggen/opampbridge-version-label.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
component: opamp bridge

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Fix opamp bridge configmap "app.kubernetes.io/version" label to be generated in the same way as other resource version labels

# One or more tracking issues related to the change
issues: [2583]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
16 changes: 16 additions & 0 deletions .chloggen/remove-env-var-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
component: instrumentation

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove env var prefix validation

# One or more tracking issues related to the change
issues: [2768]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
25 changes: 25 additions & 0 deletions .chloggen/v1beta1-webhook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: new_component

# The name of the component, or a single word describing the area of concern, (e.g. operator, target allocator, github action)
component: collector

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Enable reconciliation of Collector v1beta1 CRD.

# One or more tracking issues related to the change
issues: [2620]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
Users are expected to migrate to `otelcol.v1beta1.opentelemetry.io`.
The support for `otelcol.v1alpha1.opentelemetry.io` will be removed in the future.
Follow [migration guide](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#upgrade-existing-objects-to-a-new-stored-version) for upgrading already created collector instances.
After all `otelcol.v1alpha1.opentelemetry.io` are stored as `v1beta1` update the collector CRD to store only `v1beta1`
`kubectl patch customresourcedefinitions opentelemetrycollectors.opentelemetry.io --subresource='status' --type='merge' -p '{"status":{"storedVersions":["v1beta1"]}}'`.
**Only `AllNamespaces` install mode is now supported** due to the conversion webhook from `v1beta1` to `v1alpha1`.
See [OLM docs](https://olm.operatorframework.io/docs/tasks/install-operator-with-olm/) and
[OLM operator groups docs](https://olm.operatorframework.io/docs/advanced-tasks/operator-scoping-with-operatorgroups/).
6 changes: 4 additions & 2 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ jobs:

- name: Set up Go
uses: actions/setup-go@v5
id: setup-go
with:
go-version: "~1.21.1"

- name: Cache tools
uses: actions/cache@v4
with:
path: bin
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}-${{ steps.setup-go.outputs.go-version }}

- name: Install tools
run: make install-tools
Expand All @@ -49,9 +50,10 @@ jobs:

- name: Cache tools
uses: actions/cache@v4
id: setup-go
with:
path: bin
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}-${{ steps.setup-go.outputs.go-version }}

- name: Install tools
run: make install-tools
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,28 @@ jobs:
- e2e-targetallocator
- e2e-upgrade
- e2e-multi-instrumentation
- e2e-metadata-filters
include:
- group: e2e-prometheuscr
setup: "prepare-e2e-with-featuregates FEATUREGATES=+operator.observability.prometheus"
- group: e2e-multi-instrumentation
setup: "add-operator-arg OPERATOR_ARG=--enable-multi-instrumentation prepare-e2e"
- group: e2e-metadata-filters
setup: "add-operator-arg OPERATOR_ARG='--annotations-filter=*filter.out --labels=*filter.out' prepare-e2e"

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
id: setup-go
with:
go-version: "~1.21.3"
- name: Cache tools
uses: actions/cache@v4
with:
path: bin
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}-${{ steps.setup-go.outputs.go-version }}
- name: Install chainsaw
uses: kyverno/action-install-chainsaw@v0.1.7
uses: kyverno/action-install-chainsaw@v0.1.9
- name: Install tools
run: make install-tools
- name: Prepare e2e tests
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:

- name: Set up Go
uses: actions/setup-go@v5
id: setup-go
with:
go-version: "~1.21.1"

Expand All @@ -34,7 +35,7 @@ jobs:
uses: actions/cache@v4
with:
path: bin
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Makefile') }}-${{ steps.setup-go.outputs.go-version }}

- name: Install tools
run: make install-tools
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@ Changes by Version
==================
<!-- next version -->

## 0.96.0

### 🛑 Breaking changes 🛑

- `operator`: change dotnet instrumentation feature gate into command line flag --enable-dotnet-instrumentation (#2582, #2671)

### 💡 Enhancements 💡

- `operator`: Created ability to filter out Annotations (#2627)

### 🧰 Bug fixes 🧰

- `target allocator`: Fix per-node target allocation for targets from endpointslices (#2718)
The per-node target allocation strategy was not matching endpointslice entries for with a `kind` of Node, such as those for the kubelet metrics created by the prometheus operator
- `operator`: Removes UPDATE from pod mutating admission webhook since it only needs to mutate on pod CREATE events. (#1514)
The pod webhook currently modifies the pod spec in invalid ways on UPDATE events, and UPDATES are not necessary in the webhook.

### Components

* [OpenTelemetry Collector - v0.96.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.96.0)
* [OpenTelemetry Contrib - v0.96.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.96.0)
* [Java auto-instrumentation - v1.32.1](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.32.1)
* [.NET auto-instrumentation - v1.2.0](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/tag/{AUTO_INSTRUMENTATION_DOTNET_VERSION})
* [Node.JS - v0.46.0](https://github.com/open-telemetry/opentelemetry-js/releases/tag/experimental%2Fv0.46.0)
* [Python - v0.44b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.44b0)
* [Go - v0.10.1-alpha](https://github.com/open-telemetry/opentelemetry-go-instrumentation/releases/tag/v0.10.1-alpha)
* [ApacheHTTPD - 1.0.4](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.4)
* [Nginx - 1.0.4](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.4)

## 0.95.0

### 🛑 Breaking changes 🛑
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

CRD_OPTIONS ?= "crd:generateEmbeddedObjectMeta=true,maxDescLen=200"
# kubectl apply does not work on large CRDs.
CRD_OPTIONS ?= "crd:generateEmbeddedObjectMeta=true,maxDescLen=0"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -240,6 +241,11 @@ e2e-prometheuscr: chainsaw
e2e-targetallocator: chainsaw
$(CHAINSAW) test --test-dir ./tests/e2e-targetallocator

# end-to-end-test for Annotations/Labels Filters
.PHONY: e2e-metadata-filters
e2e-metadata-filters: chainsaw
$(CHAINSAW) test --test-dir ./tests/e2e-metadata-filters

# end-to-end-test for testing upgrading
.PHONY: e2e-upgrade
e2e-upgrade: undeploy chainsaw
Expand Down Expand Up @@ -364,7 +370,7 @@ GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint
CHAINSAW ?= $(LOCALBIN)/chainsaw

KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_TOOLS_VERSION ?= v0.12.0
CONTROLLER_TOOLS_VERSION ?= v0.14.0
GOLANGCI_LINT_VERSION ?= v1.54.0
KIND_VERSION ?= v0.20.0
CHAINSAW_VERSION ?= v0.1.7
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@ The OpenTelemetry Operator *might* work on versions outside of the given range,

| OpenTelemetry Operator | Kubernetes | Cert-Manager |
|------------------------|----------------------|---------------------|
| v0.96.0 | v1.23 to v1.29 | v1 |
| v0.95.0 | v1.23 to v1.29 | v1 |
| v0.94.0 | v1.23 to v1.29 | v1 |
| v0.93.0 | v1.23 to v1.29 | v1 |
Expand All @@ -732,7 +733,6 @@ The OpenTelemetry Operator *might* work on versions outside of the given range,
| v0.76.1 | v1.19 to v1.26 | v1 |
| v0.75.0 | v1.19 to v1.26 | v1 |
| v0.74.0 | v1.19 to v1.26 | v1 |
| v0.73.0 | v1.19 to v1.26 | v1 |

## Contributing and Developing

Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ The operator should be released within a week after the [OpenTelemetry collector

| Version | Release manager |
|----------|-----------------|
| v0.96.0 | @frzifus |
| v0.97.0 | @jaronoff97 |
| v0.98.0 | @yuriolisa |
| v0.99.0 | @pavolloffay |
| v0.100.0 | @VineethReddy02 |
| v0.101.0 | @TylerHelmuth |
| v0.102.0 | @swiatekm-sumo |
| v0.103.0 | @frzifus |
2 changes: 1 addition & 1 deletion apis/v1alpha1/collector_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ func checkAutoscalerSpec(autoscaler *AutoscalerSpec) error {
func SetupCollectorWebhook(mgr ctrl.Manager, cfg config.Config, reviewer *rbac.Reviewer) error {
cvw := &CollectorWebhook{
reviewer: reviewer,
logger: mgr.GetLogger().WithValues("handler", "CollectorWebhook"),
logger: mgr.GetLogger().WithValues("handler", "CollectorWebhook", "version", "v1alpha1"),
scheme: mgr.GetScheme(),
cfg: cfg,
}
Expand Down
40 changes: 0 additions & 40 deletions apis/v1alpha1/instrumentation_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ import (
"github.com/open-telemetry/opentelemetry-operator/pkg/constants"
)

const (
envPrefix = "OTEL_"
envSplunkPrefix = "SPLUNK_"
)

var (
_ admission.CustomValidator = &InstrumentationWebhook{}
_ admission.CustomDefaulter = &InstrumentationWebhook{}
Expand Down Expand Up @@ -245,44 +240,9 @@ func (w InstrumentationWebhook) validate(r *Instrumentation) (admission.Warnings
default:
return warnings, fmt.Errorf("spec.sampler.type is not valid: %s", r.Spec.Sampler.Type)
}

// validate env vars
if err := w.validateEnv(r.Spec.Env); err != nil {
return warnings, err
}
if err := w.validateEnv(r.Spec.Java.Env); err != nil {
return warnings, err
}
if err := w.validateEnv(r.Spec.NodeJS.Env); err != nil {
return warnings, err
}
if err := w.validateEnv(r.Spec.Python.Env); err != nil {
return warnings, err
}
if err := w.validateEnv(r.Spec.DotNet.Env); err != nil {
return warnings, err
}
if err := w.validateEnv(r.Spec.Go.Env); err != nil {
return warnings, err
}
if err := w.validateEnv(r.Spec.ApacheHttpd.Env); err != nil {
return warnings, err
}
if err := w.validateEnv(r.Spec.Nginx.Env); err != nil {
return warnings, err
}
return warnings, nil
}

func (w InstrumentationWebhook) validateEnv(envs []corev1.EnvVar) error {
for _, env := range envs {
if !strings.HasPrefix(env.Name, envPrefix) && !strings.HasPrefix(env.Name, envSplunkPrefix) {
return fmt.Errorf("env name should start with \"OTEL_\" or \"SPLUNK_\": %s", env.Name)
}
}
return nil
}

func validateJaegerRemoteSamplerArgument(argument string) error {
parts := strings.Split(argument, ",")

Expand Down
2 changes: 1 addition & 1 deletion apis/v1alpha1/opentelemetrycollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ type OpenTelemetryCollectorStatus struct {
Replicas int32 `json:"replicas,omitempty"`
}

// +kubebuilder:deprecatedversion:warning="OpenTelemetryCollector v1alpha1 is deprecated. Migrate to v1beta1."
// +kubebuilder:object:root=true
// +kubebuilder:storageversion
// +kubebuilder:resource:shortName=otelcol;otelcols
// +kubebuilder:subresource:status
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.scale.replicas,selectorpath=.status.scale.selector
Expand Down
Loading

0 comments on commit 87c29f8

Please sign in to comment.