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 3078
  • Loading branch information
Israel Blancas committed Dec 3, 2024
2 parents 6cc697e + bc34078 commit 807c87f
Show file tree
Hide file tree
Showing 58 changed files with 1,777 additions and 148 deletions.
11 changes: 4 additions & 7 deletions .chloggen/3446.yaml → .chloggen/fix-prometheus-rule-file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@
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: 'github action'

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Operator pod crashed if the Service Monitor for the operator metrics was created before by another operator pod.
note: Add new line character at the end of PrometheusRule file.

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

# (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: |
Operator fails when the pod is restarted and the Service Monitor for operator metrics was already created by another operator pod.
To fix this, the operator now sets the owner reference on the Service Monitor to itself and checks if the Service Monitor already exists.
subtext:
4 changes: 2 additions & 2 deletions .chloggen/3429.yaml → .chloggen/service-extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ change_type: enhancement
component: collector

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Create RBAC rules for the k8sobjects receiver automatically.
note: support for creating a service for extensions when ports are specified.

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

# (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.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-autoinstrumentation-nodejs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4

- name: Read version
run: echo VERSION=$(cat autoinstrumentation/nodejs/package.json | jq -r '.dependencies."@opentelemetry/sdk-node"') >> $GITHUB_ENV
run: echo VERSION=$(cat autoinstrumentation/nodejs/package.json | jq -r '.dependencies."@opentelemetry/auto-instrumentations-node"') >> $GITHUB_ENV

- name: Docker meta
id: meta
Expand Down
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,50 @@

<!-- next version -->

## 0.114.0

### 💡 Enhancements 💡

- `collector`: Create RBAC rules for the k8s_cluster receiver automatically. (#3427)
- `collector`: Create RBAC rules for the k8sobjects receiver automatically. (#3429)
- `collector`: Add a warning message when one created collector needs extra RBAC permissions and the service account doesn't have them. (#3432)
- `target allocator`: Added allocation_fallback_strategy option as fallback strategy for per-node allocation strategy, can be enabled with feature flag operator.targetallocator.fallbackstrategy (#3477)

If using per-node allocation strategy, targets that are not attached to a node will not
be allocated. As the per-node strategy is required when running as a daemonset, it is
not possible to assign some targets under a daemonset deployment.
Feature flag operator.targetallocator.fallbackstrategy has been added and results in consistent-hashing
being used as the fallback allocation strategy for "per-node" only at this time.

- `auto-instrumentation`: updated node auto-instrumentation dependencies to the latest version (#3476)

- auto-instrumentations-node to 0.53.0
- exporter-metrics-otlp-grpc to 0.55.0
- exporter-prometheus to 0.55.0

- `operator`: Replace references to gcr.io/kubebuilder/kube-rbac-proxy with quay.io/brancz/kube-rbac-proxy (#3485)

### 🧰 Bug fixes 🧰

- `operator`: Operator pod crashed if the Service Monitor for the operator metrics was created before by another operator pod. (#3446)

Operator fails when the pod is restarted and the Service Monitor for operator metrics was already created by another operator pod.
To fix this, the operator now sets the owner reference on the Service Monitor to itself and checks if the Service Monitor already exists.

- `auto-instrumentation`: Bump base memory requirements for python and go (#3479)

### Components

* [OpenTelemetry Collector - v0.114.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.114.0)
* [OpenTelemetry Contrib - v0.114.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.114.0)
* [Java auto-instrumentation - v1.33.5](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.33.5)
* [.NET auto-instrumentation - v1.2.0](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/tag/v1.2.0)
* [Node.JS - v0.53.0](https://github.com/open-telemetry/opentelemetry-js/releases/tag/experimental%2Fv0.53.0)
* [Python - v0.48b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.48b0)
* [Go - v0.17.0-alpha](https://github.com/open-telemetry/opentelemetry-go-instrumentation/releases/tag/v0.17.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.113.0

### 💡 Enhancements 💡
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ add-rbac-permissions-to-operator: manifests kustomize
# This folder is ignored by .gitignore
mkdir -p config/rbac/extra-permissions-operator
cp -r tests/e2e-automatic-rbac/extra-permissions-operator/* config/rbac/extra-permissions-operator
cd config/rbac && $(KUSTOMIZE) edit add patch --kind ClusterRole --name manager-role --path extra-permissions-operator/clusterresourcequotas.yaml
cd config/rbac && $(KUSTOMIZE) edit add patch --kind ClusterRole --name manager-role --path extra-permissions-operator/cronjobs.yaml
cd config/rbac && $(KUSTOMIZE) edit add patch --kind ClusterRole --name manager-role --path extra-permissions-operator/daemonsets.yaml
cd config/rbac && $(KUSTOMIZE) edit add patch --kind ClusterRole --name manager-role --path extra-permissions-operator/events.yaml
Expand Down
6 changes: 3 additions & 3 deletions 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.114.0 | @TylerHelmuth |
| v0.115.0 | @jaronoff97 |
| v0.116.0 | @swiatekm |
| v0.115.0 | @TylerHelmuth |
| v0.116.0 | @jaronoff97 |
| v0.117.0 | @iblancasa |
| v0.118.0 | @frzifus |
| v0.119.0 | @yuriolisa |
| v0.120.0 | @pavolloffay |
| v0.121.0 | @swiatekm |
8 changes: 4 additions & 4 deletions apis/v1alpha1/instrumentation_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ func (w InstrumentationWebhook) defaulter(r *Instrumentation) error {
if r.Spec.Python.Resources.Limits == nil {
r.Spec.Python.Resources.Limits = corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("500m"),
corev1.ResourceMemory: resource.MustParse("32Mi"),
corev1.ResourceMemory: resource.MustParse("64Mi"),
}
}
if r.Spec.Python.Resources.Requests == nil {
r.Spec.Python.Resources.Requests = corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("50m"),
corev1.ResourceMemory: resource.MustParse("32Mi"),
corev1.ResourceMemory: resource.MustParse("64Mi"),
}
}
if r.Spec.DotNet.Image == "" {
Expand All @@ -158,13 +158,13 @@ func (w InstrumentationWebhook) defaulter(r *Instrumentation) error {
if r.Spec.Go.Resources.Limits == nil {
r.Spec.Go.Resources.Limits = corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("500m"),
corev1.ResourceMemory: resource.MustParse("32Mi"),
corev1.ResourceMemory: resource.MustParse("64Mi"),
}
}
if r.Spec.Go.Resources.Requests == nil {
r.Spec.Go.Resources.Requests = corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("50m"),
corev1.ResourceMemory: resource.MustParse("32Mi"),
corev1.ResourceMemory: resource.MustParse("64Mi"),
}
}
if r.Spec.ApacheHttpd.Image == "" {
Expand Down
17 changes: 15 additions & 2 deletions apis/v1beta1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,12 @@ func (c *Config) getPortsForComponentKinds(logger logr.Logger, componentKinds ..
case KindProcessor:
continue
case KindExtension:
continue
retriever = extensions.ParserFor
if c.Extensions == nil {
cfg = AnyConfig{}
} else {
cfg = *c.Extensions
}
}
for componentName := range enabledComponents[componentKind] {
// TODO: Clean up the naming here and make it simpler to use a retriever.
Expand Down Expand Up @@ -380,10 +385,18 @@ func (c *Config) GetExporterPorts(logger logr.Logger) ([]corev1.ServicePort, err
return c.getPortsForComponentKinds(logger, KindExporter)
}

func (c *Config) GetAllPorts(logger logr.Logger) ([]corev1.ServicePort, error) {
func (c *Config) GetExtensionPorts(logger logr.Logger) ([]corev1.ServicePort, error) {
return c.getPortsForComponentKinds(logger, KindExtension)
}

func (c *Config) GetReceiverAndExporterPorts(logger logr.Logger) ([]corev1.ServicePort, error) {
return c.getPortsForComponentKinds(logger, KindReceiver, KindExporter)
}

func (c *Config) GetAllPorts(logger logr.Logger) ([]corev1.ServicePort, error) {
return c.getPortsForComponentKinds(logger, KindReceiver, KindExporter, KindExtension)
}

func (c *Config) GetEnvironmentVariables(logger logr.Logger) ([]corev1.EnvVar, error) {
return c.getEnvironmentVariablesForComponentKinds(logger, KindReceiver)
}
Expand Down
15 changes: 3 additions & 12 deletions autoinstrumentation/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,8 @@
"typescript": "^5.6.3"
},
"dependencies": {
"@opentelemetry/api": "1.9.0",
"@opentelemetry/auto-instrumentations-node": "0.52.0",
"@opentelemetry/exporter-metrics-otlp-grpc": "0.54.0",
"@opentelemetry/exporter-prometheus": "0.54.0",
"@opentelemetry/exporter-trace-otlp-grpc": "0.54.0",
"@opentelemetry/resource-detector-alibaba-cloud": "0.29.4",
"@opentelemetry/resource-detector-aws": "1.7.0",
"@opentelemetry/resource-detector-container": "0.5.0",
"@opentelemetry/resource-detector-gcp": "0.29.13",
"@opentelemetry/resources": "1.27.0",
"@opentelemetry/sdk-metrics": "1.27.0",
"@opentelemetry/sdk-node": "0.54.0"
"@opentelemetry/exporter-metrics-otlp-grpc": "0.55.0",
"@opentelemetry/auto-instrumentations-node": "0.53.0",
"@opentelemetry/exporter-prometheus": "0.55.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ metadata:
categories: Logging & Tracing,Monitoring
certified: "false"
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
createdAt: "2024-11-08T09:36:39Z"
createdAt: "2024-11-27T11:54:33Z"
description: Provides the OpenTelemetry components, including the Collector
operators.operatorframework.io/builder: operator-sdk-v1.29.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: github.com/open-telemetry/opentelemetry-operator
support: OpenTelemetry Community
name: opentelemetry-operator.v0.113.0
name: opentelemetry-operator.v0.114.0
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -483,7 +483,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.113.0
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.114.0
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -514,7 +514,7 @@ spec:
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=0
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
image: quay.io/brancz/kube-rbac-proxy:v0.13.1
name: kube-rbac-proxy
ports:
- containerPort: 8443
Expand Down Expand Up @@ -591,7 +591,7 @@ spec:
minKubeVersion: 1.23.0
provider:
name: OpenTelemetry Community
version: 0.113.0
version: 0.114.0
webhookdefinitions:
- admissionReviewVersions:
- v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ spec:
- expr: sum by (type) (opentelemetry_collector_connectors)
record: type:opentelemetry_collector_connectors:sum
- expr: sum by (type) (opentelemetry_collector_info)
record: type:opentelemetry_collector_info:sum
record: type:opentelemetry_collector_info:sum
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ metadata:
categories: Logging & Tracing,Monitoring
certified: "false"
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
createdAt: "2024-11-08T09:36:43Z"
createdAt: "2024-11-27T11:54:33Z"
description: Provides the OpenTelemetry components, including the Collector
operators.operatorframework.io/builder: operator-sdk-v1.29.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: github.com/open-telemetry/opentelemetry-operator
support: OpenTelemetry Community
name: opentelemetry-operator.v0.113.0
name: opentelemetry-operator.v0.114.0
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -487,7 +487,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.serviceAccountName
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.113.0
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.114.0
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -522,7 +522,7 @@ spec:
- --tls-private-key-file=/var/run/tls/server/tls.key
- --tls-cipher-suites=TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_RSA_WITH_AES_128_CBC_SHA256
- --tls-min-version=VersionTLS12
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
image: quay.io/brancz/kube-rbac-proxy:v0.13.1
name: kube-rbac-proxy
ports:
- containerPort: 8443
Expand Down Expand Up @@ -606,7 +606,7 @@ spec:
minKubeVersion: 1.23.0
provider:
name: OpenTelemetry Community
version: 0.113.0
version: 0.114.0
webhookdefinitions:
- admissionReviewVersions:
- v1alpha1
Expand Down
5 changes: 5 additions & 0 deletions cmd/otel-allocator/allocation/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ func (a *allocator) SetFilter(filter Filter) {
a.filter = filter
}

// SetFallbackStrategy sets the fallback strategy to use.
func (a *allocator) SetFallbackStrategy(strategy Strategy) {
a.strategy.SetFallbackStrategy(strategy)
}

// SetTargets accepts a list of targets that will be used to make
// load balancing decisions. This method should be called when there are
// new targets discovered or existing targets are shutdown.
Expand Down
2 changes: 2 additions & 0 deletions cmd/otel-allocator/allocation/consistent_hashing.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ func (s *consistentHashingStrategy) SetCollectors(collectors map[string]*Collect
s.consistentHasher = consistent.New(members, s.config)

}

func (s *consistentHashingStrategy) SetFallbackStrategy(fallbackStrategy Strategy) {}
2 changes: 2 additions & 0 deletions cmd/otel-allocator/allocation/least_weighted.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ func (s *leastWeightedStrategy) GetCollectorForTarget(collectors map[string]*Col
}

func (s *leastWeightedStrategy) SetCollectors(_ map[string]*Collector) {}

func (s *leastWeightedStrategy) SetFallbackStrategy(fallbackStrategy Strategy) {}
18 changes: 16 additions & 2 deletions cmd/otel-allocator/allocation/per_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,31 @@ const perNodeStrategyName = "per-node"
var _ Strategy = &perNodeStrategy{}

type perNodeStrategy struct {
collectorByNode map[string]*Collector
collectorByNode map[string]*Collector
fallbackStrategy Strategy
}

func newPerNodeStrategy() Strategy {
return &perNodeStrategy{
collectorByNode: make(map[string]*Collector),
collectorByNode: make(map[string]*Collector),
fallbackStrategy: nil,
}
}

func (s *perNodeStrategy) SetFallbackStrategy(fallbackStrategy Strategy) {
s.fallbackStrategy = fallbackStrategy
}

func (s *perNodeStrategy) GetName() string {
return perNodeStrategyName
}

func (s *perNodeStrategy) GetCollectorForTarget(collectors map[string]*Collector, item *target.Item) (*Collector, error) {
targetNodeName := item.GetNodeName()
if targetNodeName == "" && s.fallbackStrategy != nil {
return s.fallbackStrategy.GetCollectorForTarget(collectors, item)
}

collector, ok := s.collectorByNode[targetNodeName]
if !ok {
return nil, fmt.Errorf("could not find collector for node %s", targetNodeName)
Expand All @@ -54,4 +64,8 @@ func (s *perNodeStrategy) SetCollectors(collectors map[string]*Collector) {
s.collectorByNode[collector.NodeName] = collector
}
}

if s.fallbackStrategy != nil {
s.fallbackStrategy.SetCollectors(collectors)
}
}
Loading

0 comments on commit 807c87f

Please sign in to comment.