Skip to content

Comments

Otel bump v0.143.0#2017

Draft
sky333999 wants to merge 22 commits intomainfrom
otel-bump-v0.143.0
Draft

Otel bump v0.143.0#2017
sky333999 wants to merge 22 commits intomainfrom
otel-bump-v0.143.0

Conversation

@sky333999
Copy link
Contributor

Description of the issue

Describe the problem or feature in addition to a link to the issues.

Description of changes

How does this change address the problem?

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

Describe what tests you have done.

Requirements

Before commiting your code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

Integration Tests

To run integration tests against this PR, add the ready for testing label.

@sky333999 sky333999 added the ready for testing Indicates this PR is ready for integration tests to run label Feb 12, 2026
Update CloudWatch Agent dependencies to use OpenTelemetry Collector
Contrib v0.143.0 from the amazon-contributing fork.

Changes:
- AWS fork components: Updated to v0.0.0-20260206202803-61da50e53977
  (latest commit from otel-bump-v0.143.0 branch)
- Upstream contrib components: Updated to v0.143.0
- Collector core stable APIs: Updated to v1.49.0
- Collector core experimental APIs: Updated to v0.143.0
- OTel SDK: Updated to v1.39.0
- Collector semconv: Updated to v0.128.0

This update includes upstream v0.143.0 changes and AWS-specific
customizations from the amazon-contributing fork.
Update target_allocator.go for otel-contrib v0.143.0 breaking changes:
- TargetAllocator field changed from pointer to configoptional.Optional
- promslog.AllowedLevel renamed to promslog.Level
- TLSSetting field renamed to TLS
- targetallocator package exposed via public API in AWS OTel contrib fork
…anges

- labels.Labels: len(ls)/range ls -> ls.Len()/ls.Range() (metrics_receiver.go)
- labels.Labels: []labels.Label{} -> labels.FromStrings() (metrics_receiver_test.go)
- scrape.Target.DiscoveredLabels: now requires *labels.Builder arg (metrics_type_handler.go)
- promslog.AllowedLevel -> promslog.Level with NewLevel() constructor (start.go, metrics_receiver_test.go)
- promslog.AllowedFormat -> promslog.Format (start.go, metrics_receiver_test.go)
- TLSSetting -> TLS on proxy Config (awsxray/translator.go)
- TLSSetting -> TLS + configoptional.Optional on GRPC/HTTP server configs (otlp/translator.go)
- configauth.Authentication -> configauth.Config + configoptional.Some (prometheusremotewrite/translator.go)
- TargetAllocator: pointer -> configoptional.Optional with HasValue()/Get() (prometheus/translator.go)
- GRPC/HTTP: pointer -> configoptional.Optional with HasValue()/Get()/None() (otlp/translator.go)
- Updated all corresponding test assertions
- MetricMetadata.Metric -> MetricMetadata.MetricFamily
- scrape.NewTarget: replace (labels, discoveredLabels, params) with
  (labels, scrapeConfig, tLabels, tgLabels)
- Remove unused url.Values params from test mocks
…ending_queue fields

- Set factories.Telemetry = otelconftelemetry.NewFactory() in
  defaultcomponents.Factories() (required by collector core v0.143.0)
- Remove obsolete 'blocking' and 'enabled' fields from sending_queue
  in 12 golden sample config YAML files. The queue config struct was
  replaced by queuebatch.Config which dropped these fields; queue
  enablement is now controlled via configoptional.Optional presence.
otlpreceiver.Config.GRPC and .HTTP are now configoptional.Optional[T]
initialized in the Default flavor by CreateDefaultConfig(). Default.Get()
returns nil, so the previous code using .Get() silently skipped endpoint
and TLS assignment.

Replaced .Get() with .GetOrInsertDefault() which promotes Default → Some
and returns a mutable pointer. Extracted TLS config into a shared variable
that defaults to None (zero value) when no cert/key files are provided.

Upstream PRs:
- open-telemetry/opentelemetry-collector#13044 (configoptional module)
- open-telemetry/opentelemetry-collector#13119 (otlpreceiver migration)
- open-telemetry/opentelemetry-collector#13252 (configgrpc TLS migration)
Prometheus v0.308.1 added an internal 'loaded' boolean to promconfig.Config.
GetScrapeConfigs() now returns an error if the config was not loaded through
promconfig.Load() or Reload(). Our translator manually copies GlobalConfig,
ScrapeConfigs, and TracingConfig from a parsed PromConfig, bypassing Load(),
so the loaded flag was never set.

Added cfg.PrometheusConfig.Reload() after the manual field copy. Reload()
runs the config through Load() internally, setting the loaded flag and
populating new default fields like ScrapeFallbackProtocol.

Upstream PR: prometheus/prometheus#15637
debugexporter.Config gained new QueueConfig defaults in v0.143.0
(QueueSize=1000, NumConsumers=10, FlushTimeout=200ms, etc.). The test
used a hardcoded struct literal that didn't include these fields.

Instead of switching to field-level assertions (which would hide future
default changes), build the expected config from CreateDefaultConfig()
and only override the 2 fields the translator sets (Verbosity,
SamplingThereafter). Full struct comparison is preserved.
Three default value changes in the PRW exporter golden test fixture:
- headers: {} → null (type changed to configopaque.MapList, no longer
  initialized to empty map)
- force_attempt_http2: true (new field in confighttp.ClientConfig,
  added in v0.132.0; matches Go http.DefaultTransport behavior)
- protobuf_message: prometheus.WriteRequest (new field controlling
  Remote Write v1 vs v2; default preserves existing v1 behavior)

All three changes are cosmetic/serialization — no functional impact.
filterprocessor.Config in v0.143.0 gained unexported ottl.Factory pointer
maps (resourceFunctions, dataPointFunctions, etc.) that are populated
during CreateDefaultConfig(). Two independently-created default configs
have identical map keys but different pointer addresses, making full
struct comparison via require.Equal always fail.

Compare all 6 exported config fields individually instead: ErrorMode,
Metrics, Logs, Spans, Traces, Profiles.
Prometheus v0.308.1 changed several default values in GlobalConfig and
ScrapeConfig (MetricNameValidationScheme, ScrapeNativeHistograms,
ScrapeProtocols, etc.). The test used hardcoded struct literals that
didn't include these new defaults.

Instead of updating struct literals or switching to field-level assertions,
load the expected config through promconfig.Load() using the same test
YAML. This populates all defaults identically to the translator's
Reload() path, preserving full struct comparison.

Behavioral note: MetricNameValidationScheme changed from 0 (zero value
string in v0.300.1, treated as UTF-8 at runtime) to 2 (explicit
UTF8Validation in v0.308.1). No actual behavior change — UTF-8 was
already the effective default.
Regenerated all tocwconfig golden files to match new serialized output
from OTel Collector v0.143.0 and Prometheus v0.308.1 component defaults.

Key change patterns (all cosmetic/serialization unless noted):
- exclude_service_attributes: false (new resourcetotelemetry field)
- profiles: {} (new filter/transform processor section)
- keep_alives_enabled: true (new HTTP server config field)
- cors/enforcement_policy/server_parameters: {} → null (serialization)
- tls: null (TLS field now explicitly serialized when absent)
- fail_on_missing_metadata: false (new k8s metadata field)
- force_attempt_http2: true (new confighttp.ClientConfig field)
- cloud.availability_zone: enabled: false (new resource attribute)
- New resource attributes for akamai/digitalocean cloud providers

⚠️ BEHAVIORAL CHANGE: max_staleness: 0s → 1h0m0s in cumulative-to-delta
processor. Metrics not seen for 1 hour will have state evicted. See
OTEL_BUMP_v0.143.0_SUMMARY.md for full impact analysis.
…figs

Prometheus v0.308.1 changed model.ValidationScheme from a string enum
(zero value fell through to UTF-8) to an int enum (zero value 0 =
UnsetValidation panics in IsValidLabelName). The 3 relabel.Config
structs created programmatically in relabelScrapeConfigs() and
metricNameRelabelConfigs bypass Prometheus's YAML unmarshaling +
ScrapeConfig.Validate() pipeline, leaving NameValidationScheme at
the zero value. This causes a panic in the scrape pool goroutine
when PopulateLabels calls relabel.ProcessBuilder on the custom configs.

Set NameValidationScheme: model.UTF8Validation on all 3 configs.
… metric names

The OTel v0.143.0 bump includes upstream commit 430ea5940 which graduated
the pkg.translator.prometheus.NormalizeName feature gate to Stable and
removed it from the code path. Previously, the CWA fork had reverted this
gate to Alpha (PR amazon-contributing/opentelemetry-collector-contrib#29),
which meant add_metric_suffixes: true (the factory default) was silently
ignored. With the gate removed, the setting now takes full effect, causing
type/unit suffixes to be appended to metric names exported to AMP
(e.g. CPU_USAGE_IDLE -> CPU_USAGE_IDLE_unit, my_gauge -> my_gauge_ratio).

Fix: explicitly set AddMetricSuffixes = false in the CWA PRW translator
to preserve backward-compatible metric naming. This is the upstream-
recommended migration path per opentelemetry-collector-contrib#26488.

Updated translator test expectation and 6 sample config golden files.
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity.

@github-actions github-actions bot added the Stale label Feb 23, 2026
The OTel contrib v0.143.0 bump rewrote the EKS detector in the
resourcedetectionprocessor with two detection paths: detectFromIMDS
(standard managed nodes) and detectFromAPI (fallback when IMDS is
unavailable, e.g. EKS Auto, Fargate).

The detectFromAPI path requires the Kubernetes node name to query the
node's providerID. It reads this from Config.NodeFromEnvVar, which was
previously unset, causing the API-only path to fail with 'can't get
K8s Instance Metadata; node name is empty'.

Set node_from_env_var: HOST_NAME in the embedded resource detection
config. HOST_NAME is already set in all CWAgent K8s deployments via
the Kubernetes downward API (spec.nodeName). On non-K8s environments,
the env var is empty and the EKS detector gracefully degrades.

Updated translator test and 6 golden YAML sample configs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for testing Indicates this PR is ready for integration tests to run Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant