Skip to content

Commit

Permalink
use github.com/tjhop/slog-gokit
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiangreco committed Nov 28, 2024
1 parent efbb7f4 commit 7d01ee8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 82 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ require (
github.com/stretchr/testify v1.9.0
github.com/testcontainers/testcontainers-go v0.33.0
github.com/tilinna/clock v1.1.0
github.com/tjhop/slog-gokit v0.1.2
github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect
github.com/uber/jaeger-client-go v2.30.0+incompatible
github.com/vincent-petithory/dataurl v1.0.0
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1002,8 +1002,6 @@ github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5Nq
github.com/go-sql-driver/mysql v0.0.0-20180618115901-749ddf1598b4/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
Expand Down Expand Up @@ -1247,8 +1245,6 @@ github.com/grafana/loki/pkg/push v0.0.0-20240617182007-6c33561108ad h1:4XAhmVmKb
github.com/grafana/loki/pkg/push v0.0.0-20240617182007-6c33561108ad/go.mod h1:lJEF/Wh5MYlmBem6tOYAFObkLsuikfrEf8Iy9AdMPiQ=
github.com/grafana/loki/v3 v3.0.0-20240617182007-6c33561108ad h1:eaHz6gH7OM3LWGp1h2QZ+/wkeyjNspk3QwjD4YUWR5g=
github.com/grafana/loki/v3 v3.0.0-20240617182007-6c33561108ad/go.mod h1:fKBY3k60xjlGcIdbOaJiy3aWopF65FpQvQWczCp2SZ0=
github.com/grafana/mysqld_exporter v0.12.2-0.20231005125903-364b9c41e595 h1:I9sRknI5ajd8whPOX0nBDXy5B6xUfhItClMy+6R4oqE=
github.com/grafana/mysqld_exporter v0.12.2-0.20231005125903-364b9c41e595/go.mod h1:U8ifHC5pT2WuVTO7ki4KZmWLjfEKfktQiU3bh0J8scw=
github.com/grafana/mysqld_exporter v0.16.1-0.20241111085008-47b8ea9fab19 h1:JKMpcPPmhU198g3skPdSf2YvcgUKZ6bf3X1uTXnCZXU=
github.com/grafana/mysqld_exporter v0.16.1-0.20241111085008-47b8ea9fab19/go.mod h1:ctzLZ0vK3ow5JZmBfbS261ufC/4vtfuwFileKJea3kg=
github.com/grafana/node_exporter v0.18.1-grafana-r01.0.20231004161416-702318429731 h1:vyyIYY2sLpmgFIckJ1vSO/oYkvB0thDF6UiFYp5PThM=
Expand Down Expand Up @@ -2466,6 +2462,8 @@ github.com/tilinna/clock v1.1.0/go.mod h1:ZsP7BcY7sEEz7ktc0IVy8Us6boDrK8VradlKRU
github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg=
github.com/tinylib/msgp v1.2.4 h1:yLFeUGostXXSGW5vxfT5dXG/qzkn4schv2I7at5+hVU=
github.com/tinylib/msgp v1.2.4/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0=
github.com/tjhop/slog-gokit v0.1.2 h1:pmQI4SvU9h4gA0vIQsdhJQSqQg4mOmsPykG2/PM3j1I=
github.com/tjhop/slog-gokit v0.1.2/go.mod h1:8fhlcp8C8ELbg3GCyKv06tgt4B5sDq2P1r2DQAu1HuM=
github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI=
github.com/tklauser/go-sysconf v0.3.13 h1:GBUpcahXSpR2xN01jhkNAbTLRk2Yzgggk8IM08lq3r4=
github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0=
Expand Down
76 changes: 0 additions & 76 deletions internal/slogadapter/handler.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"os"

config_util "github.com/prometheus/common/config"
slgk "github.com/tjhop/slog-gokit"

"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/go-sql-driver/mysql"
"github.com/grafana/alloy/internal/slogadapter"
"github.com/grafana/alloy/internal/static/integrations"
integrations_v2 "github.com/grafana/alloy/internal/static/integrations/v2"
"github.com/grafana/alloy/internal/static/integrations/v2/metricsutils"
Expand Down Expand Up @@ -124,7 +124,7 @@ func New(log log.Logger, c *Config) (integrations.Integration, error) {
}

scrapers := GetScrapers(c)
logger := slog.New(slogadapter.GoKitHandler{Logger: log, Group: ""})
logger := slog.New(slgk.NewGoKitHandler(log, nil))
exporter := collector.New(context.Background(), string(dsn), scrapers, logger, collector.Config{
LockTimeout: c.LockWaitTimeout,
SlowLogFilter: c.LogSlowFilter,
Expand Down

0 comments on commit 7d01ee8

Please sign in to comment.