Skip to content
29 changes: 29 additions & 0 deletions .chloggen/move-otelconfig-and-metrics-to-internal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# 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: api

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Move config parsing and CRD metrics from apis to internal package

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

# (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: |
- Methods on `*Config` (package `apis/v1beta1`) converted to standalone functions in `internal/otelconfig`, now taking `*v1beta1.Config` as the first parameter:
- GetEnabledComponents, GetReceiverPorts, GetExporterPorts, GetExtensionPorts, GetReceiverAndExporterPorts, GetAllPorts, GetEnvironmentVariables, GetAllRbacRules, ApplyDefaults, GetLivenessProbe, GetReadinessProbe, GetStartupProbe, Yaml, NullObjects
- Methods on `*Service` converted to functions in `internal/otelconfig`:
- MetricsEndpoint, GetTelemetry
- ApplyDefaults → renamed to ServiceApplyDefaults
- Method on `*Telemetry` converted to function:
- ToAnyConfig → renamed to TelemetryToAnyConfig
- Functions moved from `apis/v1beta1` to `internal/metrics` with renames:
- BootstrapMetrics → Bootstrap
- NewMetrics(prv, ctx, cl) → New(ctx, prv, cl) (parameter reorder: ctx now first)
- Types moved out of `apis/v1beta1`:
- MetricsConfig, Telemetry → internal/otelconfig
- Metrics → internal/metrics
3 changes: 2 additions & 1 deletion apis/v1alpha1/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/conversion"

"github.com/open-telemetry/opentelemetry-operator/apis/v1beta1"
"github.com/open-telemetry/opentelemetry-operator/internal/otelconfig"
)

var _ conversion.Convertible = &OpenTelemetryCollector{}
Expand Down Expand Up @@ -301,7 +302,7 @@ func tov1alpha1Ports(in []v1beta1.PortsSpec) []PortsSpec {

func tov1alpha1(in v1beta1.OpenTelemetryCollector) (*OpenTelemetryCollector, error) {
c := in.DeepCopy()
configYaml, err := c.Spec.Config.Yaml()
configYaml, err := otelconfig.Yaml(&c.Spec.Config)
if err != nil {
return nil, err
}
Expand Down
Loading
Loading