Skip to content

Commit

Permalink
Merge branch 'main' into feat/3086-allow-configuration-prometheus-cr
Browse files Browse the repository at this point in the history
  • Loading branch information
dexter0195 authored Feb 4, 2025
2 parents c7ec533 + 6782fdf commit b67ebef
Show file tree
Hide file tree
Showing 84 changed files with 23,909 additions and 428 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
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
component: target allocator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: add Python instrumentation of aiokafka, click
note: "Support camelcase matchLabels and matchExpressions in target allocator config"

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

# (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
18 changes: 12 additions & 6 deletions .chloggen/operator32.yaml → .chloggen/3452.yaml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# 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. operator, target allocator, github action)
component: operator
# 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: collector

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add support for Kubernetes `1.32`
note: Fix config handling with null values.

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

# (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: |
Fix the defaulting webhook error `src and dst must not be nil` caused by defaulting a known component with a null value:
e.g.
```yaml
receivers:
zipkin:
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
change_type: bug_fix

component: collector

note: Prevent mounting secrets to collector when TA is not deployed and mTLS feature gate is enabled

issues: [3456]

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: breaking
change_type: new_component

# 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: target allocator

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "change metric `opentelemetry_allocator_targets_remaining` type from counter to gauge"
note: Introduce TargetAllocator CRD

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

# (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: See the [CRD changelog](./docs/crd-changelog.md) for more information.
3 changes: 3 additions & 0 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,6 @@ jobs:

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

- name: Govulncheck
uses: golang/govulncheck-action@v1
78 changes: 78 additions & 0 deletions .github/workflows/publish-autoinstrumentation-php.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: "Publish PHP Auto-Instrumentation"

on:
push:
paths:
- 'autoinstrumentation/php/**'
- '.github/workflows/publish-autoinstrumentation-php.yaml'
branches:
- main
pull_request:
paths:
- 'autoinstrumentation/php/**'
- '.github/workflows/publish-autoinstrumentation-php.yaml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
publish:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Read version
run: echo "VERSION=$(cat autoinstrumentation/php/version.txt)" >> $GITHUB_ENV

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
otel/autoinstrumentation-php
ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-php
tags: |
type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log into Docker.io
uses: docker/login-action@v3
if: ${{ github.event_name == 'push' }}
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Package Registry
uses: docker/login-action@v3
if: ${{ github.event_name == 'push' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare files for docker image
run: pushd ./autoinstrumentation/php ; ./prepare_files_for_docker_image.sh --ext-ver ${{ env.VERSION }} --dest-dir ${PWD}/files_for_docker_image ; popd

- name: Build and push
uses: docker/build-push-action@v6
with:
context: autoinstrumentation/php
push: ${{ github.event_name == 'push' }}
build-args: SUB_DIR_WITH_FILES_FOR_DOCKER_IMAGE=files_for_docker_image
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
32 changes: 32 additions & 0 deletions .github/workflows/shellcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: shellcheck
on:
push:
branches:
- main
pull_request:
permissions: {}

jobs:
shellcheck:
name: shellcheck
runs-on: ubuntu-24.04
env:
VERSION: v0.10.0
steps:
- uses: actions/checkout@v4
- name: shellcheck ci scripts
uses: ludeeus/[email protected]
env:
SHELLCHECK_OPTS: -x -e SC2059 -e SC2086
with:
scandir: ".ci"
severity: warning
version: ${{ env.VERSION }}
- name: shellcheck hack scripts
uses: ludeeus/[email protected]
env:
SHELLCHECK_OPTS: -x -e SC2059 -e SC2086
with:
scandir: "hack"
severity: warning
version: ${{ env.VERSION }}
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

<!-- next version -->

## 0.117.0

### 🛑 Breaking changes 🛑

- `target allocator`: change metric `opentelemetry_allocator_targets_remaining` type from counter to gauge (#3578)

### 💡 Enhancements 💡

- `auto-instrumentation`: add Python instrumentation of aiokafka, click (#3611)
- `operator`: Add support for Kubernetes `1.32` (#3544)

### Components

* [OpenTelemetry Collector - v0.117.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.117.0)
* [OpenTelemetry Contrib - v0.117.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.117.0)
* [Java auto-instrumentation - v1.33.6](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.33.6)
* [.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.50b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.50b0)
* [Go - v0.19.0-alpha](https://github.com/open-telemetry/opentelemetry-go-instrumentation/releases/tag/v0.19.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.116.0

### 💡 Enhancements 💡
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Get CA certificates from alpine package repo
FROM alpine:3.20 as certificates
FROM alpine:3.21 as certificates

RUN apk --no-cache add ca-certificates

Expand Down
12 changes: 12 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,16 @@ resources:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: opentelemetry.io
kind: TargetAllocator
path: github.com/open-telemetry/opentelemetry-operator/apis/v1alpha1
version: v1alpha1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
version: "3"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ In addition to the [core responsibilities](https://github.com/open-telemetry/com
Approvers ([@open-telemetry/operator-approvers](https://github.com/orgs/open-telemetry/teams/operator-approvers)):

- [Tyler Helmuth](https://github.com/TylerHelmuth), Honeycomb
- [Yuri Oliveira Sa](https://github.com/yuriolisa), Red Hat
- [Yuri Oliveira Sa](https://github.com/yuriolisa), OllyGarden
- [Israel Blancas](https://github.com/iblancasa), Red Hat

Emeritus Approvers:
Expand Down
12 changes: 6 additions & 6 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Steps to release a new version of the OpenTelemetry Operator:
> [!WARNING]
> DO NOT BUMP JAVA PAST `1.X.X` AND DO NOT BUMP .NET PAST `1.2.0`. Upgrades past these versions will introduce breaking HTTP semantic convention changes.
1. Check if the compatible OpenShift versions are updated in the `Makefile`.
1. Update the bundle by running `make bundle VERSION=$VERSION`.
1. Update the bundle by running `make bundle reset VERSION=$VERSION`.
1. Change the compatibility matrix in the [compatibility doc](./docs/compatibility.md) file, using the OpenTelemetry Operator version to be released and the current latest Kubernetes version as the latest supported version. Remove the oldest entry.
1. Update release schedule table, by moving the current release manager to the end of the table with updated release version.
1. Add the changes to the changelog by running `make chlog-update VERSION=$VERSION`.
Expand Down Expand Up @@ -44,10 +44,10 @@ The operator should be released within a week after the [OpenTelemetry collector

| Version | Release manager |
|----------|-----------------|
| v0.117.0 | @iblancasa |
| v0.118.0 | @frzifus |
| v0.119.0 | @yuriolisa |
| v0.120.0 | @pavolloffay |
| v0.121.0 | @swiatekm |
| v0.118.0 | @iblancasa |
| v0.119.0 | @frzifus |
| v0.120.0 | @yuriolisa |
| v0.121.0 | @pavolloffay |
| v0.122.0 | @TylerHelmuth |
| v0.123.0 | @jaronoff97 |
| v0.124.0 | @swiatekm |
12 changes: 8 additions & 4 deletions apis/v1alpha1/targetallocator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ func init() {
SchemeBuilder.Register(&TargetAllocator{}, &TargetAllocatorList{})
}

//+kubebuilder:object:root=true
//+kubebuilder:storageversion
//+kubebuilder:subresource:status
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:printcolumn:name="Image",type="string",JSONPath=".status.image"
// +kubebuilder:printcolumn:name="Management",type="string",JSONPath=".spec.managementState",description="Management State"
// +operator-sdk:csv:customresourcedefinitions:displayName="Target Allocator"
// +operator-sdk:csv:customresourcedefinitions:resources={{Pod,v1},{Deployment,apps/v1},{ConfigMaps,v1},{Service,v1},{ServiceAccount,v1},{PodDisruptionBudget,policy/v1}}

// TargetAllocator is the Schema for the targetallocators API.
type TargetAllocator struct {
Expand All @@ -37,7 +41,7 @@ type TargetAllocator struct {
Status TargetAllocatorStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true
// +kubebuilder:object:root=true

// TargetAllocatorList contains a list of TargetAllocator.
type TargetAllocatorList struct {
Expand Down
7 changes: 3 additions & 4 deletions apis/v1alpha1/targetallocator_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ var (
_ admission.CustomDefaulter = &TargetAllocatorWebhook{}
)

// TODO: Uncomment this webhook after enabling the TargetAllocator controller
// //+kubebuilder:webhook:path=/mutate-opentelemetry-io-v1beta1-targetallocator,mutating=true,failurePolicy=fail,groups=opentelemetry.io,resources=targetallocators,verbs=create;update,versions=v1beta1,name=mtargetallocatorbeta.kb.io,sideEffects=none,admissionReviewVersions=v1
// //+kubebuilder:webhook:verbs=create;update,path=/validate-opentelemetry-io-v1beta1-targetallocator,mutating=false,failurePolicy=fail,groups=opentelemetry.io,resources=targetallocators,versions=v1beta1,name=vtargetallocatorcreateupdatebeta.kb.io,sideEffects=none,admissionReviewVersions=v1
// //+kubebuilder:webhook:verbs=delete,path=/validate-opentelemetry-io-v1beta1-targetallocator,mutating=false,failurePolicy=ignore,groups=opentelemetry.io,resources=targetallocators,versions=v1beta1,name=vtargetallocatordeletebeta.kb.io,sideEffects=none,admissionReviewVersions=v1
// +kubebuilder:webhook:path=/mutate-opentelemetry-io-v1beta1-targetallocator,mutating=true,failurePolicy=fail,groups=opentelemetry.io,resources=targetallocators,verbs=create;update,versions=v1beta1,name=mtargetallocatorbeta.kb.io,sideEffects=none,admissionReviewVersions=v1
// +kubebuilder:webhook:verbs=create;update,path=/validate-opentelemetry-io-v1beta1-targetallocator,mutating=false,failurePolicy=fail,groups=opentelemetry.io,resources=targetallocators,versions=v1beta1,name=vtargetallocatorcreateupdatebeta.kb.io,sideEffects=none,admissionReviewVersions=v1
// +kubebuilder:webhook:verbs=delete,path=/validate-opentelemetry-io-v1beta1-targetallocator,mutating=false,failurePolicy=ignore,groups=opentelemetry.io,resources=targetallocators,versions=v1beta1,name=vtargetallocatordeletebeta.kb.io,sideEffects=none,admissionReviewVersions=v1
// +kubebuilder:object:generate=false

type TargetAllocatorWebhook struct {
Expand Down
3 changes: 3 additions & 0 deletions apis/v1beta1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ func (c *Config) applyDefaultForComponentKinds(logger logr.Logger, componentKind
continue
}

if componentConf == nil {
componentConf = map[string]interface{}{}
}
if err := mergo.Merge(&mappedCfg, componentConf); err != nil {
return err
}
Expand Down
16 changes: 16 additions & 0 deletions apis/v1beta1/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ func TestNullObjects(t *testing.T) {
assert.Equal(t, []string{"connectors.spanmetrics:", "exporters.otlp.endpoint:", "extensions.health_check:", "processors.batch:", "receivers.otlp.protocols.grpc:", "receivers.otlp.protocols.http:"}, nullObjects)
}

func TestNullObjects_issue_3445(t *testing.T) {
collectorYaml, err := os.ReadFile("./testdata/issue-3452.yaml")
require.NoError(t, err)

collectorJson, err := yaml.YAMLToJSON(collectorYaml)
require.NoError(t, err)

cfg := &Config{}
err = json.Unmarshal(collectorJson, cfg)
require.NoError(t, err)

err = cfg.ApplyDefaults(logr.Discard())
require.NoError(t, err)
assert.Empty(t, cfg.nullObjects())
}

func TestConfigFiles_go_yaml(t *testing.T) {
files, err := os.ReadDir("./testdata")
require.NoError(t, err)
Expand Down
6 changes: 6 additions & 0 deletions apis/v1beta1/testdata/issue-3452.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
receivers:
zipkin:
service:
pipelines:
traces:
receivers: [zipkin]
15 changes: 15 additions & 0 deletions autoinstrumentation/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To build one auto-instrumentation image for php, please:
# - Download your php auto-instrumentation artefacts to `/autoinstrumentation` directory. This is required as when instrumenting the pod,
# one init container will be created to copy the files to your app's container.
# - Grant the necessary access to the files in the `/autoinstrumentation` directory.
# - Following environment variables are injected to the application container to enable the auto-instrumentation.
# PHP_INI_SCAN_DIR=:/otel-auto-instrumentation-php/php_ini_scan_dir
# OTEL_PHP_AUTOLOAD_ENABLED=true
# - For auto-instrumentation by container injection, the Linux command cp is
# used and must be availabe in the image.

FROM busybox

ARG SUB_DIR_WITH_FILES_FOR_DOCKER_IMAGE

COPY ${SUB_DIR_WITH_FILES_FOR_DOCKER_IMAGE} /autoinstrumentation/
Loading

0 comments on commit b67ebef

Please sign in to comment.