Skip to content

Commit

Permalink
Merge branch 'main' into instrumentation-support-label
Browse files Browse the repository at this point in the history
  • Loading branch information
crossoverJie committed May 5, 2024
2 parents b11cb13 + fbbca3d commit 787e7fe
Show file tree
Hide file tree
Showing 172 changed files with 39,348 additions and 15,922 deletions.
10 changes: 5 additions & 5 deletions .chloggen/2763 - add hostPort support.yaml → ...gen/fix_load-initial-servicemonitors.yaml
100644 → 100755
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: enhancement
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: operator
component: target allocator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Add support for adding/extending otc-collector container ports."
note: Fix target allocator readiness check

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

# (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:
4 changes: 3 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ jobs:
- e2e-multi-instrumentation
- e2e-metadata-filters
include:
- group: e2e-instrumentation
setup: "add-instrumentation-params prepare-e2e"
- group: e2e-multi-instrumentation
setup: "add-operator-arg OPERATOR_ARG=--enable-multi-instrumentation prepare-e2e"
setup: "add-multi-instrumentation-params prepare-e2e"
- group: e2e-metadata-filters
setup: "add-operator-arg OPERATOR_ARG='--annotations-filter=*filter.out --labels=*filter.out' prepare-e2e"

Expand Down
19 changes: 13 additions & 6 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ linters-settings:
template-path: header.txt
goimports:
local-prefixes: github.com/open-telemetry/opentelemetry-operator
maligned:
suggest-new: true
gci:
sections:
- standard
- default
- prefix(github.com/open-telemetry/opentelemetry-operator)
misspell:
locale: US
ignore-words:
Expand All @@ -22,9 +25,6 @@ linters-settings:
- kilometre
- kilometres
govet:
# report about shadowed variables
check-shadowing: true

# settings per analyzer
settings:
printf: # analyzer name, run `go tool vet help` to see all analyzers
Expand All @@ -41,7 +41,7 @@ linters-settings:
gofmt:
simplify: true
revive:
min-confidence: 0.8
confidence: 0.8

depguard:
rules:
Expand All @@ -52,6 +52,12 @@ linters-settings:
- pkg: github.com/pkg/errors
desc: "Use 'errors' or 'fmt' instead of github.com/pkg/errors"

issues:
exclude-rules:
- linters:
- gci
source: "// \\+kubebuilder"

linters:
enable:
- goheader
Expand All @@ -71,3 +77,4 @@ linters:
- depguard
- errcheck
- errorlint
- gci
89 changes: 89 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,95 @@

<!-- next version -->

## 0.99.0

### 🛑 Breaking changes 🛑

- `operator`: change java instrumentation feature gate `operator.autoinstrumentation.java` into command line flag `--enable-java-instrumentation` (#2673, #2582)
- `operator`: remove featuregate `operator.autoinstrumentation.nodejs`. Use command line flag `--enable-nodejs-instrumentation` instead (#2674)
- `operator`: remove featuregate `operator.autoinstrumentation.go`. Use command line flag `--enable-go-instrumentation` instead (#2675)
- `target allocator`: Remove `operator.collector.rewritetargetallocator` feature flag (#2796)
- `target allocator`: Drop compatibility with older target allocator versions (#1907)
We've made a breaking change to the target allocator configuration in 0.93.0. This change removes operator
compatibility with target allocator versions older than that. Users running more recent target allocator versions
are unaffected.


### 🚀 New components 🚀

- `collector`: Enable reconciliation of Collector v1beta1 CRD. See [CRD changelog](./docs/crd-changelog.md) for detailed information. (#2620, #1907)
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/).


### 💡 Enhancements 💡

- `collector`: Changes metric port logic to use intermediary struct. (#2603)
- `collector`: Remove collector v1alpha1 defaulting and validating webhooks. (#2736)
The functionality was moved to the collector v1beta1 webhooks.

### 🧰 Bug fixes 🧰

- `auto-instrumentation`: Add attribute `service.instance.id` while pod is mutated. (#2679)
`service.instance.id` is expected to be `<namespace>.<podName>.<containerName>`

But while pod is created it may not have the `podName` yet at the podMutator webhooks.

This changed to use the env var `OTEL_RESOURCE_ATTRIBUTES_POD_NAME` which will be present at runtime.
`<namespace>.$(OTEL_RESOURCE_ATTRIBUTES_POD_NAME).<containerName>`

Making a valid and complete value for `service.instance.id` to be added.

- `collector`: Fixes a bug that would cause errant rollouts on a non-config related change. (#2899)
- `collector`: resolves a bug that would create a junk selector for the service by merging rather than overriding. (#2873)
- `target allocator`: Fix a metric relabel config unescaping bug (#2867)
If only metric relabel configs were present, without target relabel configs, unescaping wouldn't be applied, leading
to invalid Target Allocator configuration.


### Components

* [OpenTelemetry Collector - v0.99.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.99.0)
* [OpenTelemetry Contrib - v0.99.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.99.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/v1.2.0)
* [Node.JS - v0.49.1](https://github.com/open-telemetry/opentelemetry-js/releases/tag/experimental%2Fv0.49.1)
* [Python - v0.44b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.44b0)
* [Go - v0.12.0-alpha](https://github.com/open-telemetry/opentelemetry-go-instrumentation/releases/tag/v0.12.0-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.98.0

### 💡 Enhancements 💡

- `operator`: Add support for adding/extending otc-collector container ports. (#2763)
- `auto-instrumentation`: Support Java auto-instrumentation extensions. (#1785)

### 🧰 Bug fixes 🧰

- `target allocator`: Fix for keepequal/dropequal action (#2793)
- `collector`: Create automatically the RBAC permissions to manage replicasets when using the k8sattributesprocessor (#2823)
- `documentation`: The description for some fields was truncated in the documentation. (#2563)

### Components

* [OpenTelemetry Collector - v0.98.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.98.0)
* [OpenTelemetry Contrib - v0.98.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.98.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.49.1](https://github.com/open-telemetry/opentelemetry-js/releases/tag/experimental%2Fv0.49.1)
* [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.97.1

### 🧰 Bug fixes 🧰
Expand Down
25 changes: 19 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
endif
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

CRD_OPTIONS ?= "crd:generateEmbeddedObjectMeta=true,maxDescLen=200"
MANIFEST_DIR ?= config/crd/bases
# 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 @@ -143,6 +145,14 @@ add-operator-arg: manifests kustomize
add-image-targetallocator:
@$(MAKE) add-operator-arg OPERATOR_ARG=--target-allocator-image=$(TARGETALLOCATOR_IMG)

.PHONY: add-instrumentation-params
add-instrumentation-params:
@$(MAKE) add-operator-arg OPERATOR_ARG=--enable-go-instrumentation=true

.PHONY: add-multi-instrumentation-params
add-multi-instrumentation-params:
@$(MAKE) add-operator-arg OPERATOR_ARG=--enable-multi-instrumentation

.PHONY: add-image-opampbridge
add-image-opampbridge:
@$(MAKE) add-operator-arg OPERATOR_ARG=--operator-opamp-bridge-image=$(OPERATOROPAMPBRIDGE_IMG)
Expand Down Expand Up @@ -171,7 +181,7 @@ release-artifacts: set-image-controller
# Generate manifests e.g. CRD, RBAC etc.
.PHONY: manifests
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=${MANIFEST_DIR}

# Run tests
# setup-envtest uses KUBEBUILDER_ASSETS which points to a directory with binaries (api-server, etcd and kubectl)
Expand Down Expand Up @@ -377,7 +387,7 @@ CHAINSAW ?= $(LOCALBIN)/chainsaw

KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_TOOLS_VERSION ?= v0.14.0
GOLANGCI_LINT_VERSION ?= v1.54.0
GOLANGCI_LINT_VERSION ?= v1.57.2
KIND_VERSION ?= v0.20.0
CHAINSAW_VERSION ?= v0.1.7

Expand Down Expand Up @@ -475,8 +485,11 @@ bundle-push:
api-docs: crdoc kustomize
@{ \
set -e ;\
TMP_MANIFEST_DIR=$$(mktemp -d) ; \
cp -r config/crd/* $$TMP_MANIFEST_DIR; \
$(MAKE) CRD_OPTIONS=$(CRD_OPTIONS),maxDescLen=1200 MANIFEST_DIR=$$TMP_MANIFEST_DIR/bases manifests ;\
TMP_DIR=$$(mktemp -d) ; \
$(KUSTOMIZE) build config/crd -o $$TMP_DIR/crd-output.yaml ;\
$(KUSTOMIZE) build $$TMP_MANIFEST_DIR -o $$TMP_DIR/crd-output.yaml ;\
$(CRDOC) --resources $$TMP_DIR/crd-output.yaml --output docs/api.md ;\
}

Expand Down Expand Up @@ -516,8 +529,8 @@ chlog-insert-components:
@echo "* [Go - ${AUTO_INSTRUMENTATION_GO_VERSION}](https://github.com/open-telemetry/opentelemetry-go-instrumentation/releases/tag/${AUTO_INSTRUMENTATION_GO_VERSION})" >>components.md
@echo "* [ApacheHTTPD - ${AUTO_INSTRUMENTATION_APACHE_HTTPD_VERSION}](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv${AUTO_INSTRUMENTATION_APACHE_HTTPD_VERSION})" >>components.md
@echo "* [Nginx - ${AUTO_INSTRUMENTATION_NGINX_VERSION}](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv${AUTO_INSTRUMENTATION_NGINX_VERSION})" >>components.md
@sed -i '' '/<!-- next version -->/rcomponents.md' CHANGELOG.md
@sed -i '' '/<!-- next version -->/G' CHANGELOG.md
@sed -i '/<!-- next version -->/r ./components.md' CHANGELOG.md
@sed -i '/<!-- next version -->/G' CHANGELOG.md
@rm components.md

.PHONY: opm
Expand Down
Loading

0 comments on commit 787e7fe

Please sign in to comment.