diff --git a/config/crd/bases/agent.githedgehog.com_agents.yaml b/config/crd/bases/agent.githedgehog.com_agents.yaml index 3446d0032..f6b388d14 100644 --- a/config/crd/bases/agent.githedgehog.com_agents.yaml +++ b/config/crd/bases/agent.githedgehog.com_agents.yaml @@ -318,8 +318,14 @@ spec: properties: address: type: string + httpheaders: + additionalProperties: + type: string + type: object intervalSeconds: type: integer + proxyURL: + type: string relabel: items: properties: diff --git a/go.mod b/go.mod index 6c16618c8..6bbf9f030 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/urfave/cli/v2 v2.27.7 github.com/vishvananda/netlink v1.3.1 go.githedgehog.com/fabric-bcm-ygot v0.6.0-4.6.0 - go.githedgehog.com/libmeta v0.3.0 + go.githedgehog.com/libmeta v0.4.0 golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa golang.org/x/sync v0.22.0 k8s.io/api v0.36.4 diff --git a/go.sum b/go.sum index 91532dcf6..757d3a192 100644 --- a/go.sum +++ b/go.sum @@ -279,8 +279,8 @@ github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGC github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= go.githedgehog.com/fabric-bcm-ygot v0.6.0-4.6.0 h1:RfknO2if5cfkd0AHay9J1zFMldgf1MhYmAd/jzZFT/I= go.githedgehog.com/fabric-bcm-ygot v0.6.0-4.6.0/go.mod h1:XWCdFbSbGP6nlg90c/922VblpHOTw07TCwx1yUHPkzc= -go.githedgehog.com/libmeta v0.3.0 h1:x1yisQG0iNmCqhO83WSdsB1ybbOVwTkQ5mwGptHY9Yc= -go.githedgehog.com/libmeta v0.3.0/go.mod h1:cULf4CObrT2p9CSiAQqkS89InQFgx1Gb+a6A+4dQORY= +go.githedgehog.com/libmeta v0.4.0 h1:JHwmt3SJwauPO3CqSyGe73bTpZ1CJaDovMw71Hd738w= +go.githedgehog.com/libmeta v0.4.0/go.mod h1:gS8lXwHatQnQZY17EHW++p4IWodfJgQeW7Gbo7E1htk= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 h1:7iP2uCb7sGddAr30RRS6xjKy7AZ2JtTOPA3oolgVSw8= diff --git a/vendor/go.githedgehog.com/libmeta/pkg/alloy/config.alloy.tmpl b/vendor/go.githedgehog.com/libmeta/pkg/alloy/config.alloy.tmpl index ba774b093..e12e63d15 100644 --- a/vendor/go.githedgehog.com/libmeta/pkg/alloy/config.alloy.tmpl +++ b/vendor/go.githedgehog.com/libmeta/pkg/alloy/config.alloy.tmpl @@ -131,6 +131,11 @@ prometheus.scrape "{{ $name }}" { {{ if $scrape.Address }}targets = [{ __address__ = "{{ $scrape.Address }}", }]{{ end }} {{ if $scrape.Self.Enable }}targets = prometheus.exporter.self.alloy.targets{{ end }} {{ if $scrape.Unix.Enable }}targets = prometheus.exporter.unix.host.targets{{ end }} + {{ if $scrape.ProxyURL }}proxy_url = "{{ $scrape.ProxyURL }}"{{ end }} + {{ if $scrape.HTTPHeaders }}http_headers = { + {{ range $k, $v := $scrape.HTTPHeaders }}"{{ $k }}" = ["{{ $v }}"], + {{ end }} + }{{ end }} forward_to = [ prometheus.relabel.{{ $name }}.receiver, diff --git a/vendor/go.githedgehog.com/libmeta/pkg/alloy/config.go b/vendor/go.githedgehog.com/libmeta/pkg/alloy/config.go index bdd7e2425..db442619b 100644 --- a/vendor/go.githedgehog.com/libmeta/pkg/alloy/config.go +++ b/vendor/go.githedgehog.com/libmeta/pkg/alloy/config.go @@ -32,9 +32,11 @@ type Config struct { type Scrape struct { IntervalSeconds uint `json:"intervalSeconds,omitempty"` - Address string `json:"address,omitempty"` - Self ScrapeSelf `json:"self,omitempty"` - Unix ScrapeUnix `json:"unix,omitempty"` + Address string `json:"address,omitempty"` + Self ScrapeSelf `json:"self,omitempty"` + Unix ScrapeUnix `json:"unix,omitempty"` + HTTPHeaders map[string]string `json:"httpheaders,omitempty"` + ProxyURL string `json:"proxyURL,omitempty"` Relabel []ScrapeRelabelRule `json:"relabel,omitempty"` } diff --git a/vendor/go.githedgehog.com/libmeta/pkg/alloy/zz_generated.deepcopy.go b/vendor/go.githedgehog.com/libmeta/pkg/alloy/zz_generated.deepcopy.go index f6e1d1b5e..844e84e6c 100644 --- a/vendor/go.githedgehog.com/libmeta/pkg/alloy/zz_generated.deepcopy.go +++ b/vendor/go.githedgehog.com/libmeta/pkg/alloy/zz_generated.deepcopy.go @@ -159,6 +159,13 @@ func (in *Scrape) DeepCopyInto(out *Scrape) { *out = *in out.Self = in.Self in.Unix.DeepCopyInto(&out.Unix) + if in.HTTPHeaders != nil { + in, out := &in.HTTPHeaders, &out.HTTPHeaders + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } if in.Relabel != nil { in, out := &in.Relabel, &out.Relabel *out = make([]ScrapeRelabelRule, len(*in)) diff --git a/vendor/modules.txt b/vendor/modules.txt index bd9e96125..a38bc5508 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -476,7 +476,7 @@ github.com/xrash/smetrics # go.githedgehog.com/fabric-bcm-ygot v0.6.0-4.6.0 ## explicit; go 1.24.0 go.githedgehog.com/fabric-bcm-ygot/pkg/oc -# go.githedgehog.com/libmeta v0.3.0 +# go.githedgehog.com/libmeta v0.4.0 ## explicit; go 1.25 go.githedgehog.com/libmeta/pkg/alloy go.githedgehog.com/libmeta/pkg/tmpl