Skip to content

Commit

Permalink
format type strings
Browse files Browse the repository at this point in the history
  • Loading branch information
rlankfo committed Apr 30, 2024
1 parent dc1828f commit 238119d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion internal/component/otelcol/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package auth
import (
"context"
"os"
"strings"

"github.com/grafana/alloy/internal/build"
"github.com/grafana/alloy/internal/component"
Expand Down Expand Up @@ -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,
},
})
Expand Down
6 changes: 5 additions & 1 deletion internal/component/otelcol/receiver/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"os"
"regexp"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 238119d

Please sign in to comment.