Skip to content

Commit 3ab9168

Browse files
committed
Merge branch 'feature/3149' of github.com:iblancasa/opentelemetry-operator into feature/3149
2 parents b8056d1 + e6880dd commit 3ab9168

37 files changed

+1174
-228
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: 'bug_fix'
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action)
5+
component: auto-instrumentation
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: "Fix file copy for NGINX auto-instrumentation for non-root workloads."
9+
10+
# One or more tracking issues related to the change
11+
issues: [2726]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext:

.chloggen/extract-resources-ns.yaml

-13
This file was deleted.

CHANGELOG.md

+25
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
<!-- next version -->
44

5+
## 0.107.0
6+
7+
### 💡 Enhancements 💡
8+
9+
- `instrumentation`: introduced ability to set Otel resource attributes based on annotations for instrumentation (#2181)
10+
11+
resource.opentelemetry.io/your-key: "your-value"
12+
13+
14+
### 🧰 Bug fixes 🧰
15+
16+
- `collector`: Fix example for labels-filter startup parameter --label. (#3201)
17+
18+
### Components
19+
20+
* [OpenTelemetry Collector - v0.107.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.107.0)
21+
* [OpenTelemetry Contrib - v0.107.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.107.0)
22+
* [Java auto-instrumentation - v1.33.5](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/tag/v1.33.5)
23+
* [.NET auto-instrumentation - v1.2.0](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/tag/v1.2.0)
24+
* [Node.JS - v0.52.1](https://github.com/open-telemetry/opentelemetry-js/releases/tag/experimental%2Fv0.52.1)
25+
* [Python - v0.47b0](https://github.com/open-telemetry/opentelemetry-python-contrib/releases/tag/v0.47b0)
26+
* [Go - v0.14.0-alpha](https://github.com/open-telemetry/opentelemetry-go-instrumentation/releases/tag/v0.14.0-alpha)
27+
* [ApacheHTTPD - 1.0.4](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.4)
28+
* [Nginx - 1.0.4](https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/tag/webserver%2Fv1.0.4)
29+
530
## 0.106.0
631

732
### 🧰 Bug fixes 🧰

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ The OpenTelemetry Operator _might_ work on versions outside of the given range,
758758

759759
| OpenTelemetry Operator | Kubernetes | Cert-Manager | Prometheus-Operator |
760760
|------------------------|----------------| ------------ |---------------------|
761+
| v0.107.0 | v1.23 to v1.30 | v1 | v0.75.0 |
761762
| v0.106.0 | v1.23 to v1.30 | v1 | v0.75.0 |
762763
| v0.105.0 | v1.23 to v1.30 | v1 | v0.74.0 |
763764
| v0.104.0 | v1.23 to v1.30 | v1 | v0.74.0 |
@@ -780,7 +781,6 @@ The OpenTelemetry Operator _might_ work on versions outside of the given range,
780781
| v0.87.0 | v1.23 to v1.28 | v1 | v0.68.0 |
781782
| v0.86.0 | v1.23 to v1.28 | v1 | v0.68.0 |
782783
| v0.85.0 | v1.19 to v1.28 | v1 | v0.67.1 |
783-
| v0.84.0 | v1.19 to v1.28 | v1 | v0.67.1 |
784784

785785
## Contributing and Developing
786786

RELEASE.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ In order to have more people comfortable with the release process, and in order
4242

4343
The operator should be released within a week after the [OpenTelemetry collector release](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/release.md#release-schedule).
4444

45-
| Version | Release manager |
46-
|----------|-----------------|
47-
| v0.107.0 | @TylerHelmuth |
48-
| v0.108.0 | @jaronoff97 |
49-
| v0.109.0 | @swiatekm |
50-
| v0.110.0 | @frzifus |
51-
| v0.111.0 | @yuriolisa |
52-
| v0.112.0 | @pavolloffay |
45+
| Version | Release manager |
46+
|-----------|-----------------|
47+
| v0.108.0 | @TylerHelmuth |
48+
| v0.109.0 | @jaronoff97 |
49+
| v0.110.0 | @swiatekm |
50+
| v0.111.0 | @frzifus |
51+
| v0.112.0 | @yuriolisa |
52+
| v0.113.0 | @pavolloffay |

autoinstrumentation/java/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.33.5
1+
2.7.0

bundle/community/manifests/opentelemetry-operator.clusterserviceversion.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ metadata:
9999
categories: Logging & Tracing,Monitoring
100100
certified: "false"
101101
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
102-
createdAt: "2024-08-07T08:29:24Z"
102+
createdAt: "2024-08-14T11:18:29Z"
103103
description: Provides the OpenTelemetry components, including the Collector
104104
operators.operatorframework.io/builder: operator-sdk-v1.29.0
105105
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
106106
repository: github.com/open-telemetry/opentelemetry-operator
107107
support: OpenTelemetry Community
108-
name: opentelemetry-operator.v0.106.0
108+
name: opentelemetry-operator.v0.107.0
109109
namespace: placeholder
110110
spec:
111111
apiservicedefinitions: {}
@@ -504,7 +504,7 @@ spec:
504504
valueFrom:
505505
fieldRef:
506506
fieldPath: spec.serviceAccountName
507-
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.106.0
507+
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.107.0
508508
livenessProbe:
509509
httpGet:
510510
path: /healthz
@@ -612,7 +612,7 @@ spec:
612612
minKubeVersion: 1.23.0
613613
provider:
614614
name: OpenTelemetry Community
615-
version: 0.106.0
615+
version: 0.107.0
616616
webhookdefinitions:
617617
- admissionReviewVersions:
618618
- v1alpha1

bundle/openshift/manifests/opentelemetry-operator.clusterserviceversion.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ metadata:
9999
categories: Logging & Tracing,Monitoring
100100
certified: "false"
101101
containerImage: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
102-
createdAt: "2024-08-07T08:29:28Z"
102+
createdAt: "2024-08-14T11:18:33Z"
103103
description: Provides the OpenTelemetry components, including the Collector
104104
operators.operatorframework.io/builder: operator-sdk-v1.29.0
105105
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
106106
repository: github.com/open-telemetry/opentelemetry-operator
107107
support: OpenTelemetry Community
108-
name: opentelemetry-operator.v0.106.0
108+
name: opentelemetry-operator.v0.107.0
109109
namespace: placeholder
110110
spec:
111111
apiservicedefinitions: {}
@@ -508,7 +508,7 @@ spec:
508508
valueFrom:
509509
fieldRef:
510510
fieldPath: spec.serviceAccountName
511-
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.106.0
511+
image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.107.0
512512
livenessProbe:
513513
httpGet:
514514
path: /healthz
@@ -616,7 +616,7 @@ spec:
616616
minKubeVersion: 1.23.0
617617
provider:
618618
name: OpenTelemetry Community
619-
version: 0.106.0
619+
version: 0.107.0
620620
webhookdefinitions:
621621
- admissionReviewVersions:
622622
- v1alpha1

go.mod

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.22.0
55
retract v1.51.0
66

77
require (
8-
dario.cat/mergo v1.0.0
8+
dario.cat/mergo v1.0.1
99
github.com/Masterminds/semver/v3 v3.2.1
1010
github.com/buraksezer/consistent v0.10.0
1111
github.com/cespare/xxhash/v2 v2.3.0
@@ -24,13 +24,13 @@ require (
2424
github.com/prometheus-operator/prometheus-operator v0.75.0
2525
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.75.2
2626
github.com/prometheus-operator/prometheus-operator/pkg/client v0.75.2
27-
github.com/prometheus/client_golang v1.19.1
27+
github.com/prometheus/client_golang v1.20.0
2828
github.com/prometheus/common v0.55.0
2929
github.com/prometheus/prometheus v0.54.0
3030
github.com/shirou/gopsutil v3.21.11+incompatible
3131
github.com/spf13/pflag v1.0.5
3232
github.com/stretchr/testify v1.9.0
33-
go.opentelemetry.io/collector/featuregate v1.12.0
33+
go.opentelemetry.io/collector/featuregate v1.13.0
3434
go.opentelemetry.io/otel v1.28.0
3535
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.28.0
3636
go.opentelemetry.io/otel/exporters/prometheus v0.50.0
@@ -152,6 +152,7 @@ require (
152152
github.com/jmespath/go-jmespath v0.4.0 // indirect
153153
github.com/josharian/intern v1.0.0 // indirect
154154
github.com/jpillora/backoff v1.0.0 // indirect
155+
github.com/klauspost/compress v1.17.9 // indirect
155156
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
156157
github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b // indirect
157158
github.com/kylelemons/godebug v1.1.0 // indirect

go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
3636
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
3737
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
3838
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
39-
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
40-
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
39+
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
40+
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
4141
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
4242
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww=
4343
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0=
@@ -545,8 +545,8 @@ github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O
545545
github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
546546
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
547547
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
548-
github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
549-
github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
548+
github.com/prometheus/client_golang v1.20.0 h1:jBzTZ7B099Rg24tny+qngoynol8LtVYlA2bqx3vEloI=
549+
github.com/prometheus/client_golang v1.20.0/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
550550
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
551551
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
552552
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -638,8 +638,8 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
638638
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
639639
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
640640
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
641-
go.opentelemetry.io/collector/featuregate v1.12.0 h1:l5WbV2vMQd2bL8ubfGrbKNtZaeJRckE12CTHvRe47Tw=
642-
go.opentelemetry.io/collector/featuregate v1.12.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U=
641+
go.opentelemetry.io/collector/featuregate v1.13.0 h1:rc84eCf5hesXQ8/bP6Zc15wqthbomfLBHmox5tT7AwM=
642+
go.opentelemetry.io/collector/featuregate v1.13.0/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U=
643643
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=
644644
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=
645645
go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=

internal/components/component.go

+47-9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import (
2323
"github.com/go-logr/logr"
2424
corev1 "k8s.io/api/core/v1"
2525
"k8s.io/apimachinery/pkg/util/intstr"
26+
27+
"github.com/open-telemetry/opentelemetry-operator/internal/naming"
2628
)
2729

2830
var (
@@ -32,28 +34,64 @@ var (
3234
PortNotFoundErr = errors.New("port should not be empty")
3335
)
3436

37+
// PortParser is a function that returns a list of servicePorts given a config of type T.
38+
type PortParser[T any] func(logger logr.Logger, name string, o *Option, config T) ([]corev1.ServicePort, error)
39+
3540
type PortRetriever interface {
3641
GetPortNum() (int32, error)
3742
GetPortNumOrDefault(logr.Logger, int32) int32
3843
}
3944

40-
type PortBuilderOption func(*corev1.ServicePort)
45+
type Option struct {
46+
protocol corev1.Protocol
47+
appProtocol *string
48+
targetPort intstr.IntOrString
49+
nodePort int32
50+
name string
51+
port int32
52+
}
53+
54+
func NewOption(name string, port int32) *Option {
55+
return &Option{
56+
name: name,
57+
port: port,
58+
}
59+
}
60+
61+
func (o *Option) Apply(opts ...PortBuilderOption) {
62+
for _, opt := range opts {
63+
opt(o)
64+
}
65+
}
66+
67+
func (o *Option) GetServicePort() *corev1.ServicePort {
68+
return &corev1.ServicePort{
69+
Name: naming.PortName(o.name, o.port),
70+
Port: o.port,
71+
Protocol: o.protocol,
72+
AppProtocol: o.appProtocol,
73+
TargetPort: o.targetPort,
74+
NodePort: o.nodePort,
75+
}
76+
}
77+
78+
type PortBuilderOption func(*Option)
4179

4280
func WithTargetPort(targetPort int32) PortBuilderOption {
43-
return func(servicePort *corev1.ServicePort) {
44-
servicePort.TargetPort = intstr.FromInt32(targetPort)
81+
return func(opt *Option) {
82+
opt.targetPort = intstr.FromInt32(targetPort)
4583
}
4684
}
4785

4886
func WithAppProtocol(proto *string) PortBuilderOption {
49-
return func(servicePort *corev1.ServicePort) {
50-
servicePort.AppProtocol = proto
87+
return func(opt *Option) {
88+
opt.appProtocol = proto
5189
}
5290
}
5391

5492
func WithProtocol(proto corev1.Protocol) PortBuilderOption {
55-
return func(servicePort *corev1.ServicePort) {
56-
servicePort.Protocol = proto
93+
return func(opt *Option) {
94+
opt.protocol = proto
5795
}
5896
}
5997

@@ -92,9 +130,9 @@ func PortFromEndpoint(endpoint string) (int32, error) {
92130
return int32(port), err
93131
}
94132

95-
type ParserRetriever func(string) ComponentPortParser
133+
type ParserRetriever func(string) Parser
96134

97-
type ComponentPortParser interface {
135+
type Parser interface {
98136
// Ports returns the service ports parsed based on the component's configuration where name is the component's name
99137
// of the form "name" or "type/name"
100138
Ports(logger logr.Logger, name string, config interface{}) ([]corev1.ServicePort, error)

internal/components/exporters/helpers.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import (
1919
)
2020

2121
// registry holds a record of all known receiver parsers.
22-
var registry = make(map[string]components.ComponentPortParser)
22+
var registry = make(map[string]components.Parser)
2323

2424
// Register adds a new parser builder to the list of known builders.
25-
func Register(name string, p components.ComponentPortParser) {
25+
func Register(name string, p components.Parser) {
2626
registry[name] = p
2727
}
2828

@@ -33,16 +33,16 @@ func IsRegistered(name string) bool {
3333
}
3434

3535
// ParserFor returns a parser builder for the given exporter name.
36-
func ParserFor(name string) components.ComponentPortParser {
36+
func ParserFor(name string) components.Parser {
3737
if parser, ok := registry[components.ComponentType(name)]; ok {
3838
return parser
3939
}
4040
// We want the default for exporters to fail silently.
41-
return components.NewNopParser(components.ComponentType(name), components.UnsetPort)
41+
return components.NewGenericParser[any](components.ComponentType(name), components.UnsetPort, nil)
4242
}
4343

4444
var (
45-
componentParsers = []components.ComponentPortParser{
45+
componentParsers = []components.Parser{
4646
components.NewSinglePortParser("prometheus", 8888),
4747
}
4848
)

0 commit comments

Comments
 (0)