diff --git a/internal/component/otelcol/auth/auth.go b/internal/component/otelcol/auth/auth.go index f81e7796fa..22a802f911 100644 --- a/internal/component/otelcol/auth/auth.go +++ b/internal/component/otelcol/auth/auth.go @@ -8,6 +8,7 @@ package auth import ( "context" "os" + "strings" "github.com/grafana/alloy/internal/build" "github.com/grafana/alloy/internal/component" @@ -165,10 +166,12 @@ func (a *Auth) Update(args component.Arguments) error { components = append(components, ext) } + cTypeStr := strings.ReplaceAll(a.opts.ID, ".", "_") + // Inform listeners that our handler changed. a.opts.OnStateChange(Exports{ Handler: Handler{ - ID: otelcomponent.NewID(otelcomponent.MustNewType(a.opts.ID)), + ID: otelcomponent.NewID(otelcomponent.MustNewType(cTypeStr)), Extension: ext, }, }) diff --git a/internal/component/otelcol/receiver/prometheus/prometheus.go b/internal/component/otelcol/receiver/prometheus/prometheus.go index f231f77f07..2567630d72 100644 --- a/internal/component/otelcol/receiver/prometheus/prometheus.go +++ b/internal/component/otelcol/receiver/prometheus/prometheus.go @@ -5,6 +5,7 @@ import ( "context" "os" "regexp" + "strings" "sync" "time" @@ -112,9 +113,12 @@ func (c *Component) Update(newConfig component.Arguments) error { gcInterval = 5 * time.Minute ) + + cTypeStr := strings.ReplaceAll(c.opts.ID, ".", "_") + settings := otelreceiver.CreateSettings{ - ID: otelcomponent.NewID(otelcomponent.MustNewType(c.opts.ID)), + ID: otelcomponent.NewID(otelcomponent.MustNewType(cTypeStr)), TelemetrySettings: otelcomponent.TelemetrySettings{ Logger: zapadapter.New(c.opts.Logger),