Skip to content

Commit

Permalink
Merge branch 'main' into use-go-1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
VineethReddy02 committed Aug 30, 2022
2 parents 3c5699f + c900d0e commit 7b3347a
Show file tree
Hide file tree
Showing 36 changed files with 704 additions and 264 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publish-images.yaml
Expand Up @@ -27,6 +27,7 @@ jobs:
grep -v '\#' versions.txt | grep autoinstrumentation-java | awk -F= '{print "AUTO_INSTRUMENTATION_JAVA_VERSION="$2}' >> $GITHUB_ENV
grep -v '\#' versions.txt | grep autoinstrumentation-nodejs | awk -F= '{print "AUTO_INSTRUMENTATION_NODEJS_VERSION="$2}' >> $GITHUB_ENV
grep -v '\#' versions.txt | grep autoinstrumentation-python | awk -F= '{print "AUTO_INSTRUMENTATION_PYTHON_VERSION="$2}' >> $GITHUB_ENV
grep -v '\#' versions.txt | grep autoinstrumentation-dotnet | awk -F= '{print "AUTO_INSTRUMENTATION_DOTNET_VERSION="$2}' >> $GITHUB_ENV
echo "VERSION_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
echo "VERSION=$(git describe --tags | sed 's/^v//')" >> $GITHUB_ENV
Expand Down Expand Up @@ -79,6 +80,7 @@ jobs:
TARGETALLOCATOR_VERSION=${{ env.TARGETALLOCATOR_VERSION }}
AUTO_INSTRUMENTATION_JAVA_VERSION=${{ env.AUTO_INSTRUMENTATION_JAVA_VERSION }}
AUTO_INSTRUMENTATION_NODEJS_VERSION=${{ env.AUTO_INSTRUMENTATION_NODEJS_VERSION }}
AUTO_INSTRUMENTATION_PYTHON_VERSION=${{ env. AUTO_INSTRUMENTATION_PYTHON_VERSION }}
AUTO_INSTRUMENTATION_PYTHON_VERSION=${{ env.AUTO_INSTRUMENTATION_PYTHON_VERSION }}
AUTO_INSTRUMENTATION_DOTNET_VERSION=${{ env.AUTO_INSTRUMENTATION_DOTNET_VERSION }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
29 changes: 29 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,35 @@
Changes by Version
==================

0.58.0
-------------------
### 🧰 Bug fixes 🧰
* Fix unnecessary and incorrect reallocation ([#1041](https://github.com/open-telemetry/opentelemetry-operator/pull/1041), [@jaronoff97](https://github.com/jaronoff97))
#### OpenTelemetry Collector and Contrib
* [OpenTelemetry Collector - v0.58.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.58.0)
* [OpenTelemetry Contrib - v0.58.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.58.0)

0.57.2
-------------------
### 🚀 New components 🚀
* Support DotNet auto-instrumentation ([#976](https://github.com/open-telemetry/opentelemetry-operator/pull/976), [@avadhut123pisal](https://github.com/avadhut123pisal))
* Enable instrumentation injecting only core SDK config ([#1000](https://github.com/open-telemetry/opentelemetry-operator/pull/1000), [@bilbof](https://github.com/bilbof))
* Instrument TA with prometheus ([#1030](https://github.com/open-telemetry/opentelemetry-operator/pull/1030), [@jaronoff97](https://github.com/jaronoff97))
### 💡 Enhancements 💡
* Protect allocator maps behind mutex, create getter funcs for them ([#1040](https://github.com/open-telemetry/opentelemetry-operator/pull/1040), [@kristinapathak](https://github.com/kristinapathak))
* Simultaneously support versions v2 and v2beta2 of Autoscaling ([#1014](https://github.com/open-telemetry/opentelemetry-operator/pull/1014), [@kevinearls](https://github.com/kevinearls))
* Update the target allocator on any manifest change ([#1027](https://github.com/open-telemetry/opentelemetry-operator/pull/1027), [@jaronoff97](https://github.com/jaronoff97))
* chore(nodejs): update versions.txt to 0.31.0 ([#1015](https://github.com/open-telemetry/opentelemetry-operator/pull/1015), [@mat-rumian](https://github.com/mat-rumian))
* chore(nodejs): update to 0.31.0 ([#955](https://github.com/open-telemetry/opentelemetry-operator/pull/955), [@mat-rumian](https://github.com/mat-rumian))
* chore(operator): update python inst to 0.32b0 ([#1012](https://github.com/open-telemetry/opentelemetry-operator/pull/1012), [@ianmcnally](https://github.com/ianmcnally))
* Sort order of ports returned to fix flaky tests ([#1003](https://github.com/open-telemetry/opentelemetry-operator/pull/1003), [@kevinearls](https://github.com/kevinearls))
### 🧰 Bug fixes 🧰
* Resolve bug where TA doesn't allocate all targets ([#1039](https://github.com/open-telemetry/opentelemetry-operator/pull/1039), [@jaronoff97](https://github.com/jaronoff97))
* Fix the issue that target-level metadata labels were missing (#948) ([#949](https://github.com/open-telemetry/opentelemetry-operator/pull/949), [@CoderPoet](https://github.com/CoderPoet))
#### OpenTelemetry Collector and Contrib
* [OpenTelemetry Collector - v0.57.2](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.57.2)
* [OpenTelemetry Contrib - v0.57.2](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.57.2)

0.56.0
-------------------
### 💡 Enhancements 💡
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Expand Up @@ -51,7 +51,7 @@ endif
KUBE_VERSION ?= 1.24
KIND_CONFIG ?= kind-$(KUBE_VERSION).yaml

OPERATOR_SDK_VERSION ?= 1.22.1
OPERATOR_SDK_VERSION ?= 1.23.0

CERTMANAGER_VERSION ?= 1.8.0

Expand Down Expand Up @@ -234,7 +234,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.5
CONTROLLER_TOOLS_VERSION ?= v0.8.0
CONTROLLER_TOOLS_VERSION ?= v0.9.2


.PHONY: kustomize
Expand All @@ -244,12 +244,12 @@ kustomize: ## Download kustomize locally if necessary.
.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
$(CONTROLLER_GEN): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)

.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

CRDOC = $(shell pwd)/bin/crdoc
.PHONY: crdoc
Expand Down
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -226,9 +226,6 @@ The possible values for the annotation can be
* `"my-other-namespace/my-instrumentation"` - name and namespace of `Instrumentation` CR instance in another namespace.
* `"false"` - do not inject


>**Note:** For `DotNet` auto-instrumentation, by default, operator sets the `OTEL_DOTNET_AUTO_TRACES_ENABLED_INSTRUMENTATIONS` environment variable which specifies the list of traces source instrumentations you want to enable. The value that is set by default by the operator is all available instrumentations supported by the `openTelemery-dotnet-instrumentation` release consumed in the image, i.e. `AspNet,HttpClient,SqlClient`. This value can be overriden by configuring the environment variable explicitely.
#### Multi-container pods

If nothing else is specified, instrumentation is performed on the first container available in the pod spec.
Expand Down Expand Up @@ -320,6 +317,8 @@ The OpenTelemetry Operator *might* work on versions outside of the given range,

| OpenTelemetry Operator | Kubernetes | Cert-Manager |
|------------------------|----------------------|----------------------|
| v0.58.0 | v1.19 to v1.24 | v1 |
| v0.57.2 | v1.19 to v1.24 | v1 |
| v0.56.0 | v1.19 to v1.24 | v1 |
| v0.55.0 | v1.19 to v1.24 | v1 |
| v0.54.0 | v1.19 to v1.24 | v1 |
Expand All @@ -339,8 +338,7 @@ The OpenTelemetry Operator *might* work on versions outside of the given range,
| v0.41.0 | v1.20 to v1.22 | v1alpha2 |
| v0.40.0 | v1.20 to v1.22 | v1alpha2 |
| v0.39.0 | v1.20 to v1.22 | v1alpha2 |
| v0.38.0 | v1.20 to v1.22 | v1alpha2 |
| v0.37.1 | v1.20 to v1.22 | v1alpha2 |



## Contributing and Developing
Expand Down
30 changes: 6 additions & 24 deletions apis/v1alpha1/instrumentation_webhook.go
Expand Up @@ -27,14 +27,12 @@ import (
)

const (
AnnotationDefaultAutoInstrumentationJava = "instrumentation.opentelemetry.io/default-auto-instrumentation-java-image"
AnnotationDefaultAutoInstrumentationNodeJS = "instrumentation.opentelemetry.io/default-auto-instrumentation-nodejs-image"
AnnotationDefaultAutoInstrumentationPython = "instrumentation.opentelemetry.io/default-auto-instrumentation-python-image"
AnnotationDefaultAutoInstrumentationDotNet = "instrumentation.opentelemetry.io/default-auto-instrumentation-dotnet-image"
envPrefix = "OTEL_"
envSplunkPrefix = "SPLUNK_"
envOtelDotnetAutoTracesEnabledInstrumentations = "OTEL_DOTNET_AUTO_TRACES_ENABLED_INSTRUMENTATIONS"
defaultEnabledTracesInstrumentations = "AspNet,HttpClient,SqlClient"
AnnotationDefaultAutoInstrumentationJava = "instrumentation.opentelemetry.io/default-auto-instrumentation-java-image"
AnnotationDefaultAutoInstrumentationNodeJS = "instrumentation.opentelemetry.io/default-auto-instrumentation-nodejs-image"
AnnotationDefaultAutoInstrumentationPython = "instrumentation.opentelemetry.io/default-auto-instrumentation-python-image"
AnnotationDefaultAutoInstrumentationDotNet = "instrumentation.opentelemetry.io/default-auto-instrumentation-dotnet-image"
envPrefix = "OTEL_"
envSplunkPrefix = "SPLUNK_"
)

// log is for logging in this package.
Expand Down Expand Up @@ -80,13 +78,6 @@ func (r *Instrumentation) Default() {
r.Spec.DotNet.Image = val
}
}
// by default set all the available instrumentations for dotnet unless the env is already set
if !r.isEnvVarSet(envOtelDotnetAutoTracesEnabledInstrumentations) {
r.Spec.DotNet.Env = append(r.Spec.DotNet.Env, corev1.EnvVar{
Name: envOtelDotnetAutoTracesEnabledInstrumentations,
Value: defaultEnabledTracesInstrumentations,
})
}
}

// +kubebuilder:webhook:verbs=create;update,path=/validate-opentelemetry-io-v1alpha1-instrumentation,mutating=false,failurePolicy=fail,groups=opentelemetry.io,resources=instrumentations,versions=v1alpha1,name=vinstrumentationcreateupdate.kb.io,sideEffects=none,admissionReviewVersions=v1
Expand Down Expand Up @@ -155,12 +146,3 @@ func (in *Instrumentation) validateEnv(envs []corev1.EnvVar) error {
}
return nil
}

func (in *Instrumentation) isEnvVarSet(name string) bool {
for _, env := range in.Spec.DotNet.Env {
if env.Name == name {
return true
}
}
return false
}
32 changes: 0 additions & 32 deletions apis/v1alpha1/instrumentation_webhook_test.go
Expand Up @@ -18,7 +18,6 @@ import (
"testing"

"github.com/stretchr/testify/assert"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand All @@ -38,37 +37,6 @@ func TestInstrumentationDefaultingWebhook(t *testing.T) {
assert.Equal(t, "nodejs-img:1", inst.Spec.NodeJS.Image)
assert.Equal(t, "python-img:1", inst.Spec.Python.Image)
assert.Equal(t, "dotnet-img:1", inst.Spec.DotNet.Image)
assert.Equal(t, true, inst.isEnvVarSet(envOtelDotnetAutoTracesEnabledInstrumentations))
}

func TestInstrumentationDefaultingWebhookOtelDotNetTracesEnabledInstruEnvSet(t *testing.T) {
inst := &Instrumentation{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
AnnotationDefaultAutoInstrumentationJava: "java-img:1",
AnnotationDefaultAutoInstrumentationNodeJS: "nodejs-img:1",
AnnotationDefaultAutoInstrumentationPython: "python-img:1",
AnnotationDefaultAutoInstrumentationDotNet: "dotnet-img:1",
},
},
Spec: InstrumentationSpec{
DotNet: DotNet{
Env: []v1.EnvVar{
{
Name: envOtelDotnetAutoTracesEnabledInstrumentations,
Value: "AspNet,HttpClient",
},
},
},
},
}
inst.Default()
for _, env := range inst.Spec.DotNet.Env {
if env.Name == envOtelDotnetAutoTracesEnabledInstrumentations {
assert.Equal(t, "AspNet,HttpClient", env.Value)
break
}
}
}

func TestInstrumentationValidatingWebhook(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion autoinstrumentation/dotnet/version.txt
@@ -1 +1 @@
0.2.0-beta.1
0.3.0-beta.1
2 changes: 1 addition & 1 deletion autoinstrumentation/java/version.txt
@@ -1 +1 @@
1.16.0
1.17.0
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Expand Up @@ -6,7 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=opentelemetry-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.22.1
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.23.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

Expand Down
Expand Up @@ -33,11 +33,11 @@ metadata:
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
createdAt: "2020-12-16T13:37:00+00:00"
description: Provides the OpenTelemetry components, including the Collector
operators.operatorframework.io/builder: operator-sdk-v1.22.1
operators.operatorframework.io/builder: operator-sdk-v1.23.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: github.com/open-telemetry/opentelemetry-operator
support: OpenTelemetry Community
name: opentelemetry-operator.v0.56.0
name: opentelemetry-operator.v0.58.0
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -282,7 +282,7 @@ spec:
- args:
- --metrics-addr=127.0.0.1:8080
- --enable-leader-election
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.56.0
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.58.0
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -316,7 +316,7 @@ spec:
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=0
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.11.0
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0
name: kube-rbac-proxy
ports:
- containerPort: 8443
Expand Down Expand Up @@ -392,7 +392,7 @@ spec:
maturity: alpha
provider:
name: OpenTelemetry Community
version: 0.56.0
version: 0.58.0
webhookdefinitions:
- admissionReviewVersions:
- v1
Expand Down

0 comments on commit 7b3347a

Please sign in to comment.