Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions cmd/otel-allocator/internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ func TestLoadFromFile(t *testing.T) {
PromConfig: &promconfig.Config{
GlobalConfig: promconfig.GlobalConfig{
ScrapeInterval: model.Duration(60 * time.Second),
ScrapeProtocols: promconfig.DefaultScrapeProtocols,
ScrapeTimeout: model.Duration(10 * time.Second),
EvaluationInterval: model.Duration(60 * time.Second),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.Bool(false),
},
Runtime: promconfig.DefaultRuntimeConfig,
OTLPConfig: promconfig.DefaultOTLPConfig,
Expand All @@ -89,6 +89,7 @@ func TestLoadFromFile(t *testing.T) {
MetricNameEscapingScheme: model.AllowUTF8,
AlwaysScrapeClassicHistograms: ptr.Bool(false),
ConvertClassicHistogramsToNHCB: ptr.Bool(false),
ScrapeNativeHistograms: ptr.Bool(false),
MetricsPath: "/metrics",
Scheme: "http",
HTTPClientConfig: commonconfig.HTTPClientConfig{
Expand Down Expand Up @@ -161,6 +162,7 @@ func TestLoadFromFile(t *testing.T) {
ScrapeTimeout: model.Duration(10 * time.Second),
EvaluationInterval: model.Duration(60 * time.Second),
MetricNameValidationScheme: model.UTF8Validation,
ScrapeNativeHistograms: ptr.Bool(false),
},
Runtime: promconfig.DefaultRuntimeConfig,
OTLPConfig: promconfig.DefaultOTLPConfig,
Expand All @@ -176,6 +178,7 @@ func TestLoadFromFile(t *testing.T) {
MetricNameEscapingScheme: model.AllowUTF8,
AlwaysScrapeClassicHistograms: ptr.Bool(false),
ConvertClassicHistogramsToNHCB: ptr.Bool(false),
ScrapeNativeHistograms: ptr.Bool(false),
MetricsPath: "/metrics",
Scheme: "http",
HTTPClientConfig: commonconfig.HTTPClientConfig{
Expand Down Expand Up @@ -256,11 +259,11 @@ func TestLoadFromFile(t *testing.T) {
PromConfig: &promconfig.Config{
GlobalConfig: promconfig.GlobalConfig{
ScrapeInterval: model.Duration(60 * time.Second),
ScrapeProtocols: promconfig.DefaultScrapeProtocols,
ScrapeTimeout: model.Duration(10 * time.Second),
EvaluationInterval: model.Duration(60 * time.Second),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.Bool(false),
},
Runtime: promconfig.DefaultRuntimeConfig,
OTLPConfig: promconfig.DefaultOTLPConfig,
Expand All @@ -276,6 +279,7 @@ func TestLoadFromFile(t *testing.T) {
MetricNameEscapingScheme: model.AllowUTF8,
AlwaysScrapeClassicHistograms: ptr.Bool(false),
ConvertClassicHistogramsToNHCB: ptr.Bool(false),
ScrapeNativeHistograms: ptr.Bool(false),
MetricsPath: "/metrics",
Scheme: "http",
HTTPClientConfig: commonconfig.HTTPClientConfig{
Expand Down Expand Up @@ -345,8 +349,8 @@ func TestLoadFromFile(t *testing.T) {
PromConfig: &promconfig.Config{
GlobalConfig: promconfig.GlobalConfig{
ScrapeInterval: model.Duration(60 * time.Second),
ScrapeProtocols: promconfig.DefaultScrapeProtocols,
ScrapeTimeout: model.Duration(10 * time.Second),
ScrapeNativeHistograms: ptr.Bool(false),
EvaluationInterval: model.Duration(60 * time.Second),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
Expand All @@ -365,6 +369,7 @@ func TestLoadFromFile(t *testing.T) {
MetricNameEscapingScheme: model.AllowUTF8,
AlwaysScrapeClassicHistograms: ptr.Bool(false),
ConvertClassicHistogramsToNHCB: ptr.Bool(false),
ScrapeNativeHistograms: ptr.Bool(false),
MetricsPath: "/metrics",
Scheme: "http",
HTTPClientConfig: commonconfig.HTTPClientConfig{
Expand Down Expand Up @@ -458,8 +463,8 @@ func TestLoadFromFile(t *testing.T) {
PromConfig: &promconfig.Config{
GlobalConfig: promconfig.GlobalConfig{
ScrapeInterval: model.Duration(60 * time.Second),
ScrapeProtocols: promconfig.DefaultScrapeProtocols,
ScrapeTimeout: model.Duration(10 * time.Second),
ScrapeNativeHistograms: ptr.Bool(false),
EvaluationInterval: model.Duration(60 * time.Second),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
Expand All @@ -478,6 +483,7 @@ func TestLoadFromFile(t *testing.T) {
MetricNameEscapingScheme: model.AllowUTF8,
AlwaysScrapeClassicHistograms: ptr.Bool(false),
ConvertClassicHistogramsToNHCB: ptr.Bool(false),
ScrapeNativeHistograms: ptr.Bool(false),
MetricsPath: "/metrics",
Scheme: "http",
HTTPClientConfig: commonconfig.HTTPClientConfig{
Expand Down Expand Up @@ -571,7 +577,7 @@ func TestLoadFromFile(t *testing.T) {
PromConfig: &promconfig.Config{
GlobalConfig: promconfig.GlobalConfig{
ScrapeInterval: model.Duration(60 * time.Second),
ScrapeProtocols: promconfig.DefaultScrapeProtocols,
ScrapeNativeHistograms: ptr.Bool(false),
ScrapeTimeout: model.Duration(10 * time.Second),
EvaluationInterval: model.Duration(60 * time.Second),
MetricNameValidationScheme: model.UTF8Validation,
Expand All @@ -585,12 +591,13 @@ func TestLoadFromFile(t *testing.T) {
EnableCompression: true,
HonorTimestamps: true,
ScrapeInterval: model.Duration(60 * time.Second),
ScrapeProtocols: promconfig.DefaultScrapeProtocols,
ScrapeTimeout: model.Duration(10 * time.Second),
ScrapeProtocols: promconfig.DefaultScrapeProtocols,
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
AlwaysScrapeClassicHistograms: ptr.Bool(false),
ConvertClassicHistogramsToNHCB: ptr.Bool(false),
ScrapeNativeHistograms: ptr.Bool(false),
MetricsPath: "/metrics",
Scheme: "http",
HTTPClientConfig: commonconfig.HTTPClientConfig{
Expand Down
16 changes: 16 additions & 0 deletions cmd/otel-allocator/internal/watcher/promOperator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
{
JobName: "podMonitor/test/simple/0",
Expand All @@ -144,6 +145,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -226,6 +228,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -300,6 +303,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -393,6 +397,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
{
JobName: "podMonitor/test/valid-pm/0",
Expand All @@ -419,6 +424,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -512,6 +518,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
{
JobName: "podMonitor/test/valid-pm/0",
Expand All @@ -538,6 +545,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -613,6 +621,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -688,6 +697,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -756,6 +766,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -826,6 +837,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -900,6 +912,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -974,6 +987,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -1040,6 +1054,7 @@ func TestLoadConfig(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
},
Expand Down Expand Up @@ -1150,6 +1165,7 @@ func TestNamespaceLabelUpdate(t *testing.T) {
ConvertClassicHistogramsToNHCB: ptr.To(false),
MetricNameValidationScheme: model.UTF8Validation,
MetricNameEscapingScheme: model.AllowUTF8,
ScrapeNativeHistograms: ptr.To(false),
},
},
}
Expand Down
65 changes: 34 additions & 31 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ require (
github.com/openshift/api v0.0.0-20240124164020-e2ce40831f2e
github.com/operator-framework/api v0.37.0
github.com/operator-framework/operator-lib v0.19.0
github.com/prometheus-operator/prometheus-operator v0.86.1
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.86.1
github.com/prometheus-operator/prometheus-operator/pkg/client v0.86.1
github.com/prometheus-operator/prometheus-operator v0.87.1
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.87.1
github.com/prometheus-operator/prometheus-operator/pkg/client v0.87.1
github.com/prometheus/client_golang v1.23.2
github.com/prometheus/common v0.67.1
github.com/prometheus/prometheus v0.307.3
github.com/prometheus/common v0.67.4
github.com/prometheus/prometheus v0.308.1
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
go.opentelemetry.io/collector/featuregate v1.42.0
go.opentelemetry.io/collector/featuregate v1.45.0
go.opentelemetry.io/otel v1.38.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.38.0
go.opentelemetry.io/otel/exporters/prometheus v0.60.0
Expand All @@ -56,9 +56,9 @@ require (
)

require (
cloud.google.com/go/auth v0.16.5 // indirect
cloud.google.com/go/auth v0.17.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/compute/metadata v0.8.4 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.12.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect
Expand All @@ -80,9 +80,9 @@ require (
github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dennwc/varint v1.0.0 // indirect
github.com/digitalocean/godo v1.165.1 // indirect
github.com/digitalocean/godo v1.168.0 // indirect
github.com/distribution/reference v0.6.0
github.com/docker/docker v28.4.0+incompatible // indirect
github.com/docker/docker v28.5.2+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/edsrzf/mmap-go v1.2.0 // indirect
Expand Down Expand Up @@ -141,15 +141,15 @@ require (
github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/hashicorp/nomad/api v0.0.0-20250930071859-eaa0fe0e27af // indirect
github.com/hashicorp/serf v0.10.1 // indirect
github.com/hetznercloud/hcloud-go/v2 v2.25.1 // indirect
github.com/hetznercloud/hcloud-go/v2 v2.29.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ionos-cloud/sdk-go/v6 v6.3.4 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/linode/linodego v1.59.0 // indirect
github.com/linode/linodego v1.60.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/metalmatze/signal v0.0.0-20210307161603-1c9aa721a97a // indirect
Expand All @@ -170,7 +170,7 @@ require (
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus-community/prom-label-proxy v0.12.1 // indirect
github.com/prometheus/alertmanager v0.28.1 // indirect
github.com/prometheus/alertmanager v0.29.0 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.35 // indirect
Expand All @@ -195,15 +195,15 @@ require (
golang.org/x/exp v0.0.0-20251002181428-27f1f14c8bb9 // indirect
golang.org/x/mod v0.29.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/oauth2 v0.31.0 // indirect
golang.org/x/oauth2 v0.32.0 // indirect
golang.org/x/sync v0.18.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/term v0.37.0 // indirect
golang.org/x/text v0.31.0 // indirect
golang.org/x/time v0.13.0 // indirect
golang.org/x/tools v0.38.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/api v0.250.0 // indirect
google.golang.org/api v0.252.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250929231259-57b25ae835d4 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251006185510-65f7160b3a87 // indirect
google.golang.org/grpc v1.76.0 // indirect
Expand All @@ -218,28 +218,29 @@ require (
require gotest.tools/v3 v3.5.2

require (
github.com/aws/smithy-go v1.23.0
github.com/aws/smithy-go v1.23.2
github.com/goccy/go-yaml v1.18.0
go.opentelemetry.io/contrib/otelconf v0.18.0
)

require (
cel.dev/expr v0.24.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/aws/aws-sdk-go-v2 v1.39.2 // indirect
github.com/aws/aws-sdk-go-v2/config v1.31.12 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.18.16 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.9 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.9 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.9 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ec2 v1.254.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 // indirect
github.com/aws/aws-sdk-go-v2/service/lightsail v1.49.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.29.6 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.38.6 // indirect
github.com/aws/aws-sdk-go-v2 v1.39.6 // indirect
github.com/aws/aws-sdk-go-v2/config v1.31.17 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.18.21 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.13 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.13 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.13 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect
github.com/aws/aws-sdk-go-v2/service/ec2 v1.262.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ecs v1.67.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.13 // indirect
github.com/aws/aws-sdk-go-v2/service/lightsail v1.50.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.30.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.39.1 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
Expand All @@ -258,9 +259,11 @@ require (
github.com/google/btree v1.1.3 // indirect
github.com/google/cel-go v0.26.1 // indirect
github.com/gophercloud/gophercloud/v2 v2.8.0 // indirect
github.com/klauspost/compress v1.18.2 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/prometheus/client_golang/exp v0.0.0-20251212205219-7ba246a648ca // indirect
github.com/prometheus/otlptranslator v1.0.0 // indirect
github.com/prometheus/sigv4 v0.2.1 // indirect
github.com/prometheus/sigv4 v0.3.0 // indirect
github.com/stackitcloud/stackit-sdk-go/core v0.17.3 // indirect
github.com/stoewer/go-strcase v1.3.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.14.0 // indirect
Expand Down
Loading
Loading