From edd8b8e0934752ad1a8bb72c43da0e93ed7bbe7e Mon Sep 17 00:00:00 2001 From: Piotr Gwizdala <17101802+thampiotr@users.noreply.github.com> Date: Mon, 23 Oct 2023 11:52:19 +0100 Subject: [PATCH] Switch flow mode to use new level package --- cmd/internal/flowmode/cluster_builder.go | 2 +- cmd/internal/flowmode/cmd_run.go | 2 +- cmd/internal/flowmode/resources_collector.go | 2 +- component/common/kubernetes/kubernetes.go | 2 +- component/common/loki/client/client.go | 2 +- component/common/loki/client/client_writeto.go | 2 +- .../common/loki/client/client_writeto_test.go | 2 +- component/common/loki/client/manager.go | 2 +- component/common/loki/positions/positions.go | 2 +- component/common/loki/wal/wal.go | 2 +- component/common/loki/wal/watcher.go | 2 +- component/common/loki/wal/watcher_test.go | 2 +- component/common/loki/wal/writer.go | 2 +- component/common/loki/wal/writer_test.go | 2 +- component/common/net/server.go | 2 +- .../consulagent/promtail_consulagent.go | 2 +- component/faro/receiver/exporters.go | 2 +- component/faro/receiver/handler.go | 2 +- component/faro/receiver/receiver.go | 2 +- component/faro/receiver/server.go | 2 +- component/faro/receiver/sourcemaps.go | 2 +- component/local/file/detector.go | 2 +- component/local/file/file.go | 2 +- component/local/file_match/file.go | 2 +- component/local/file_match/watch.go | 2 +- component/loki/echo/echo.go | 2 +- component/loki/process/stages/drop.go | 2 +- .../loki/process/stages/eventlogmessage.go | 2 +- component/loki/process/stages/extensions.go | 2 +- component/loki/process/stages/geoip.go | 2 +- component/loki/process/stages/json.go | 2 +- component/loki/process/stages/labels.go | 2 +- component/loki/process/stages/limit.go | 2 +- component/loki/process/stages/logfmt.go | 2 +- component/loki/process/stages/metric.go | 2 +- component/loki/process/stages/multiline.go | 2 +- component/loki/process/stages/output.go | 2 +- component/loki/process/stages/pack.go | 2 +- component/loki/process/stages/pipeline_test.go | 2 +- component/loki/process/stages/regex.go | 2 +- component/loki/process/stages/replace.go | 2 +- component/loki/process/stages/static_labels.go | 2 +- component/loki/process/stages/template.go | 2 +- component/loki/process/stages/tenant.go | 2 +- component/loki/process/stages/timestamp.go | 2 +- component/loki/relabel/relabel.go | 2 +- .../api/internal/lokipush/push_api_server.go | 2 +- .../source/aws_firehose/internal/handler.go | 2 +- .../source/azure_event_hubs/azure_event_hubs.go | 2 +- component/loki/source/cloudflare/cloudflare.go | 2 +- .../internal/cloudflaretarget/target.go | 2 +- component/loki/source/docker/docker.go | 2 +- .../docker/internal/dockertarget/target.go | 2 +- component/loki/source/docker/runner.go | 2 +- component/loki/source/file/decompresser.go | 2 +- component/loki/source/file/file.go | 2 +- component/loki/source/file/tailer.go | 2 +- component/loki/source/gcplog/gcplog.go | 2 +- .../gcplog/internal/gcplogtarget/pull_target.go | 2 +- .../gcplog/internal/gcplogtarget/push_target.go | 2 +- .../source/gelf/internal/target/gelftarget.go | 2 +- component/loki/source/heroku/heroku.go | 2 +- .../internal/herokutarget/herokutarget.go | 2 +- .../source/internal/kafkatarget/consumer.go | 2 +- .../source/internal/kafkatarget/kafkatarget.go | 2 +- .../internal/kafkatarget/target_syncer.go | 2 +- .../journal/internal/target/journaltarget.go | 2 +- component/loki/source/journal/journal_stub.go | 2 +- component/loki/source/kafka/kafka.go | 2 +- component/loki/source/kubernetes/kubernetes.go | 2 +- .../loki/source/kubernetes/kubetail/kubetail.go | 2 +- .../loki/source/kubernetes/kubetail/tailer.go | 2 +- .../kubernetes_events/event_controller.go | 2 +- .../kubernetes_events/kubernetes_events.go | 2 +- component/loki/source/podlogs/controller.go | 2 +- component/loki/source/podlogs/podlogs.go | 2 +- component/loki/source/podlogs/reconciler.go | 2 +- .../internal/syslogtarget/syslogtarget.go | 2 +- .../syslog/internal/syslogtarget/transport.go | 2 +- component/loki/source/syslog/syslog.go | 2 +- .../loki/source/windowsevent/component_stub.go | 2 +- component/mimir/rules/kubernetes/events.go | 2 +- component/mimir/rules/kubernetes/rules.go | 2 +- component/module/git/git.go | 2 +- component/module/module.go | 2 +- .../otelcol/connector/spanlogs/spanlogs.go | 2 +- .../exporter/loki/internal/convert/convert.go | 2 +- component/otelcol/exporter/otlp/otlp_test.go | 2 +- .../otelcol/exporter/otlphttp/otlphttp_test.go | 2 +- .../prometheus/internal/convert/convert.go | 2 +- component/otelcol/internal/scheduler/host.go | 2 +- .../otelcol/internal/scheduler/scheduler.go | 2 +- component/otelcol/processor/batch/batch_test.go | 2 +- .../otelcol/processor/discovery/discovery.go | 2 +- .../memorylimiter/memorylimiter_test.go | 2 +- .../processor/processortest/processortest.go | 2 +- .../tail_sampling/tail_sampling_test.go | 2 +- component/otelcol/receiver/loki/loki.go | 2 +- component/otelcol/receiver/otlp/otlp_test.go | 2 +- component/prometheus/exporter/exporter.go | 2 +- .../prometheus/operator/common/component.go | 2 +- .../prometheus/operator/common/crdmanager.go | 2 +- .../prometheus/receive_http/receive_http.go | 2 +- .../prometheus/remotewrite/remote_write.go | 2 +- component/prometheus/scrape/scrape.go | 2 +- component/pyroscope/ebpf/ebpf_linux.go | 2 +- component/pyroscope/ebpf/ebpf_placeholder.go | 2 +- component/pyroscope/scrape/manager.go | 2 +- component/pyroscope/scrape/scrape.go | 2 +- component/pyroscope/scrape/scrape_loop.go | 2 +- component/pyroscope/write/write.go | 2 +- component/remote/http/http.go | 2 +- component/remote/http/http_test.go | 2 +- component/remote/vault/refresher.go | 2 +- component/remote/vault/vault.go | 2 +- pkg/flow/flow.go | 2 +- pkg/flow/internal/controller/loader.go | 2 +- pkg/flow/internal/controller/node_component.go | 2 +- pkg/flow/internal/testcomponents/count.go | 2 +- pkg/flow/internal/testcomponents/passthrough.go | 2 +- pkg/flow/internal/testcomponents/sumation.go | 2 +- pkg/flow/internal/testcomponents/tick.go | 2 +- pkg/flow/logging/level/level.go | 13 +++++++++++++ pkg/flow/logging/options.go | 17 ----------------- pkg/flow/module.go | 2 +- service/cluster/cluster.go | 2 +- service/http/http.go | 2 +- 127 files changed, 138 insertions(+), 142 deletions(-) diff --git a/cmd/internal/flowmode/cluster_builder.go b/cmd/internal/flowmode/cluster_builder.go index f1bf9d5a3aef..f5529d8f2321 100644 --- a/cmd/internal/flowmode/cluster_builder.go +++ b/cmd/internal/flowmode/cluster_builder.go @@ -9,7 +9,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/service/cluster" "github.com/grafana/ckit/advertise" "github.com/hashicorp/go-discover" diff --git a/cmd/internal/flowmode/cmd_run.go b/cmd/internal/flowmode/cmd_run.go index 6ef916470d85..a4fafdca79cd 100644 --- a/cmd/internal/flowmode/cmd_run.go +++ b/cmd/internal/flowmode/cmd_run.go @@ -15,7 +15,6 @@ import ( "github.com/fatih/color" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/converter" convert_diag "github.com/grafana/agent/converter/diag" @@ -23,6 +22,7 @@ import ( "github.com/grafana/agent/pkg/config/instrumentation" "github.com/grafana/agent/pkg/flow" "github.com/grafana/agent/pkg/flow/logging" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/flow/tracing" "github.com/grafana/agent/pkg/usagestats" "github.com/grafana/agent/service" diff --git a/cmd/internal/flowmode/resources_collector.go b/cmd/internal/flowmode/resources_collector.go index 0591df9b55de..737d99bd86b5 100644 --- a/cmd/internal/flowmode/resources_collector.go +++ b/cmd/internal/flowmode/resources_collector.go @@ -5,7 +5,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/shirou/gopsutil/v3/net" "github.com/shirou/gopsutil/v3/process" diff --git a/component/common/kubernetes/kubernetes.go b/component/common/kubernetes/kubernetes.go index b94a84765eb8..a317fb58f11e 100644 --- a/component/common/kubernetes/kubernetes.go +++ b/component/common/kubernetes/kubernetes.go @@ -5,9 +5,9 @@ import ( "reflect" "github.com/go-kit/log" - "github.com/go-kit/log/level" commoncfg "github.com/grafana/agent/component/common/config" "github.com/grafana/agent/pkg/build" + "github.com/grafana/agent/pkg/flow/logging/level" promconfig "github.com/prometheus/common/config" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" diff --git a/component/common/loki/client/client.go b/component/common/loki/client/client.go index 72a09502ba04..15bec06f4be9 100644 --- a/component/common/loki/client/client.go +++ b/component/common/loki/client/client.go @@ -14,7 +14,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/dskit/backoff" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/config" diff --git a/component/common/loki/client/client_writeto.go b/component/common/loki/client/client_writeto.go index c0864ea6c3a2..33403882afa4 100644 --- a/component/common/loki/client/client_writeto.go +++ b/component/common/loki/client/client_writeto.go @@ -5,7 +5,7 @@ import ( "sync" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/tsdb/chunks" "github.com/prometheus/prometheus/tsdb/record" diff --git a/component/common/loki/client/client_writeto_test.go b/component/common/loki/client/client_writeto_test.go index 0e073d488bd8..f6c42b85bcc0 100644 --- a/component/common/loki/client/client_writeto_test.go +++ b/component/common/loki/client/client_writeto_test.go @@ -11,7 +11,7 @@ import ( "go.uber.org/atomic" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/component/common/loki/client/manager.go b/component/common/loki/client/manager.go index 2657c99857ea..0c7ee5a531bb 100644 --- a/component/common/loki/client/manager.go +++ b/component/common/loki/client/manager.go @@ -6,7 +6,7 @@ import ( "sync" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/grafana/agent/component/common/loki" diff --git a/component/common/loki/positions/positions.go b/component/common/loki/positions/positions.go index 19bee3bcba8d..eb6b72d3dd26 100644 --- a/component/common/loki/positions/positions.go +++ b/component/common/loki/positions/positions.go @@ -15,7 +15,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" yaml "gopkg.in/yaml.v2" ) diff --git a/component/common/loki/wal/wal.go b/component/common/loki/wal/wal.go index 67a6e83a8ea2..9e1999ec904e 100644 --- a/component/common/loki/wal/wal.go +++ b/component/common/loki/wal/wal.go @@ -5,7 +5,7 @@ import ( "os" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/tsdb/wlog" diff --git a/component/common/loki/wal/watcher.go b/component/common/loki/wal/watcher.go index 007648c808f1..a39137671295 100644 --- a/component/common/loki/wal/watcher.go +++ b/component/common/loki/wal/watcher.go @@ -10,7 +10,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/prometheus/tsdb/record" "github.com/prometheus/prometheus/tsdb/wlog" diff --git a/component/common/loki/wal/watcher_test.go b/component/common/loki/wal/watcher_test.go index d95b1ba2186f..1c008b19badd 100644 --- a/component/common/loki/wal/watcher_test.go +++ b/component/common/loki/wal/watcher_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/tsdb/record" diff --git a/component/common/loki/wal/writer.go b/component/common/loki/wal/writer.go index 80c105e9e3ad..929199529c5d 100644 --- a/component/common/loki/wal/writer.go +++ b/component/common/loki/wal/writer.go @@ -10,7 +10,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/tsdb/chunks" diff --git a/component/common/loki/wal/writer_test.go b/component/common/loki/wal/writer_test.go index a396fbce44c0..c8ef5d50dcc3 100644 --- a/component/common/loki/wal/writer_test.go +++ b/component/common/loki/wal/writer_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "github.com/stretchr/testify/require" diff --git a/component/common/net/server.go b/component/common/net/server.go index b374f333db87..7756cf1c6083 100644 --- a/component/common/net/server.go +++ b/component/common/net/server.go @@ -4,8 +4,8 @@ import ( "fmt" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/gorilla/mux" + "github.com/grafana/agent/pkg/flow/logging/level" dskit "github.com/grafana/dskit/server" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" diff --git a/component/discovery/consulagent/promtail_consulagent.go b/component/discovery/consulagent/promtail_consulagent.go index b40418741794..0cc56d0987c7 100644 --- a/component/discovery/consulagent/promtail_consulagent.go +++ b/component/discovery/consulagent/promtail_consulagent.go @@ -22,7 +22,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" consul "github.com/hashicorp/consul/api" conntrack "github.com/mwitkow/go-conntrack" "github.com/prometheus/client_golang/prometheus" diff --git a/component/faro/receiver/exporters.go b/component/faro/receiver/exporters.go index 731779372dde..a4709870118e 100644 --- a/component/faro/receiver/exporters.go +++ b/component/faro/receiver/exporters.go @@ -7,11 +7,11 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/go-logfmt/logfmt" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/faro/receiver/internal/payload" "github.com/grafana/agent/component/otelcol" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" diff --git a/component/faro/receiver/handler.go b/component/faro/receiver/handler.go index 40aad51ef179..fb8511e0bbde 100644 --- a/component/faro/receiver/handler.go +++ b/component/faro/receiver/handler.go @@ -8,8 +8,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/faro/receiver/internal/payload" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/rs/cors" "golang.org/x/time/rate" diff --git a/component/faro/receiver/receiver.go b/component/faro/receiver/receiver.go index 838d8827c5a8..2959d79fccfa 100644 --- a/component/faro/receiver/receiver.go +++ b/component/faro/receiver/receiver.go @@ -7,9 +7,9 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/go-sourcemap/sourcemap" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" ) func init() { diff --git a/component/faro/receiver/server.go b/component/faro/receiver/server.go index 16d756a780bc..446193f5fb47 100644 --- a/component/faro/receiver/server.go +++ b/component/faro/receiver/server.go @@ -7,8 +7,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/gorilla/mux" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/dskit/instrument" "github.com/grafana/dskit/middleware" "github.com/prometheus/client_golang/prometheus" diff --git a/component/faro/receiver/sourcemaps.go b/component/faro/receiver/sourcemaps.go index 49476c7efa4d..7f1183c27c27 100644 --- a/component/faro/receiver/sourcemaps.go +++ b/component/faro/receiver/sourcemaps.go @@ -15,9 +15,9 @@ import ( "text/template" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/go-sourcemap/sourcemap" "github.com/grafana/agent/component/faro/receiver/internal/payload" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/minio/pkg/wildcard" "github.com/prometheus/client_golang/prometheus" "github.com/vincent-petithory/dataurl" diff --git a/component/local/file/detector.go b/component/local/file/detector.go index ddde72248ac0..463d5fe23da8 100644 --- a/component/local/file/detector.go +++ b/component/local/file/detector.go @@ -9,7 +9,7 @@ import ( "github.com/fsnotify/fsnotify" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" ) // Detector is used to specify how changes to the file should be detected. diff --git a/component/local/file/file.go b/component/local/file/file.go index 1ec4ba7dc8d2..b231f718bf43 100644 --- a/component/local/file/file.go +++ b/component/local/file/file.go @@ -10,8 +10,8 @@ import ( "github.com/prometheus/client_golang/prometheus" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/river/rivertypes" ) diff --git a/component/local/file_match/file.go b/component/local/file_match/file.go index a3bdeeb15b6f..992df208ce8d 100644 --- a/component/local/file_match/file.go +++ b/component/local/file_match/file.go @@ -7,8 +7,8 @@ import ( "github.com/grafana/agent/component/discovery" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" ) func init() { diff --git a/component/local/file_match/watch.go b/component/local/file_match/watch.go index 5b8b650af982..2a78af1fa7cb 100644 --- a/component/local/file_match/watch.go +++ b/component/local/file_match/watch.go @@ -7,8 +7,8 @@ import ( "github.com/go-kit/log" "github.com/bmatcuk/doublestar" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/discovery" + "github.com/grafana/agent/pkg/flow/logging/level" ) // watch handles a single discovery.target for file watching. diff --git a/component/loki/echo/echo.go b/component/loki/echo/echo.go index bf40efeec86c..281bf7847d62 100644 --- a/component/loki/echo/echo.go +++ b/component/loki/echo/echo.go @@ -4,9 +4,9 @@ import ( "context" "sync" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/loki" + "github.com/grafana/agent/pkg/flow/logging/level" ) func init() { diff --git a/component/loki/process/stages/drop.go b/component/loki/process/stages/drop.go index b681364cbb2b..122d09eaa7ac 100644 --- a/component/loki/process/stages/drop.go +++ b/component/loki/process/stages/drop.go @@ -13,7 +13,7 @@ import ( "github.com/alecthomas/units" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" ) diff --git a/component/loki/process/stages/eventlogmessage.go b/component/loki/process/stages/eventlogmessage.go index 2a31023e2e6c..25a5bb67f5ca 100644 --- a/component/loki/process/stages/eventlogmessage.go +++ b/component/loki/process/stages/eventlogmessage.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" ) diff --git a/component/loki/process/stages/extensions.go b/component/loki/process/stages/extensions.go index d4ce94ede0a5..5bc0e772be91 100644 --- a/component/loki/process/stages/extensions.go +++ b/component/loki/process/stages/extensions.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/river" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" diff --git a/component/loki/process/stages/geoip.go b/component/loki/process/stages/geoip.go index 56a1dddcde82..47c86a7b7a9b 100644 --- a/component/loki/process/stages/geoip.go +++ b/component/loki/process/stages/geoip.go @@ -11,7 +11,7 @@ import ( "reflect" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/jmespath/go-jmespath" "github.com/oschwald/geoip2-golang" "github.com/oschwald/maxminddb-golang" diff --git a/component/loki/process/stages/json.go b/component/loki/process/stages/json.go index 5ae5f36b5936..838a46b4e21a 100644 --- a/component/loki/process/stages/json.go +++ b/component/loki/process/stages/json.go @@ -10,7 +10,7 @@ import ( "reflect" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/jmespath/go-jmespath" json "github.com/json-iterator/go" ) diff --git a/component/loki/process/stages/labels.go b/component/loki/process/stages/labels.go index 6a2c222d980d..b77b182315f6 100644 --- a/component/loki/process/stages/labels.go +++ b/component/loki/process/stages/labels.go @@ -11,7 +11,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" ) diff --git a/component/loki/process/stages/limit.go b/component/loki/process/stages/limit.go index 798ed314389f..307a29c296e3 100644 --- a/component/loki/process/stages/limit.go +++ b/component/loki/process/stages/limit.go @@ -6,7 +6,7 @@ import ( "fmt" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "golang.org/x/time/rate" diff --git a/component/loki/process/stages/logfmt.go b/component/loki/process/stages/logfmt.go index c3809b1829fb..6f290516b7e5 100644 --- a/component/loki/process/stages/logfmt.go +++ b/component/loki/process/stages/logfmt.go @@ -12,8 +12,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/go-logfmt/logfmt" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" ) diff --git a/component/loki/process/stages/metric.go b/component/loki/process/stages/metric.go index 27230a4e4d4c..dfe745133db8 100644 --- a/component/loki/process/stages/metric.go +++ b/component/loki/process/stages/metric.go @@ -9,8 +9,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/loki/process/metric" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" ) diff --git a/component/loki/process/stages/multiline.go b/component/loki/process/stages/multiline.go index 1ed81cf3b885..45a271aaf98a 100644 --- a/component/loki/process/stages/multiline.go +++ b/component/loki/process/stages/multiline.go @@ -13,8 +13,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/common/model" ) diff --git a/component/loki/process/stages/output.go b/component/loki/process/stages/output.go index ff55f20ca7be..efa2f2555cba 100644 --- a/component/loki/process/stages/output.go +++ b/component/loki/process/stages/output.go @@ -10,7 +10,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" ) diff --git a/component/loki/process/stages/pack.go b/component/loki/process/stages/pack.go index 98b40e2f9a34..0f680e7c389f 100644 --- a/component/loki/process/stages/pack.go +++ b/component/loki/process/stages/pack.go @@ -9,7 +9,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/loki/pkg/logqlmodel" json "github.com/json-iterator/go" "github.com/prometheus/client_golang/prometheus" diff --git a/component/loki/process/stages/pipeline_test.go b/component/loki/process/stages/pipeline_test.go index 7ec056955356..8e3b8047b037 100644 --- a/component/loki/process/stages/pipeline_test.go +++ b/component/loki/process/stages/pipeline_test.go @@ -13,8 +13,8 @@ import ( "github.com/grafana/agent/component/common/loki/client/fake" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/loki/pkg/logproto" util_log "github.com/grafana/loki/pkg/util/log" "github.com/grafana/river" diff --git a/component/loki/process/stages/regex.go b/component/loki/process/stages/regex.go index 20dd06f7e1c6..3575e0d11980 100644 --- a/component/loki/process/stages/regex.go +++ b/component/loki/process/stages/regex.go @@ -12,7 +12,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/mitchellh/mapstructure" "github.com/prometheus/common/model" ) diff --git a/component/loki/process/stages/replace.go b/component/loki/process/stages/replace.go index 745c0c45e853..027a04c41b94 100644 --- a/component/loki/process/stages/replace.go +++ b/component/loki/process/stages/replace.go @@ -14,7 +14,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" ) diff --git a/component/loki/process/stages/static_labels.go b/component/loki/process/stages/static_labels.go index 4a7449e2fef0..8ca9baeb27c0 100644 --- a/component/loki/process/stages/static_labels.go +++ b/component/loki/process/stages/static_labels.go @@ -11,7 +11,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" ) diff --git a/component/loki/process/stages/template.go b/component/loki/process/stages/template.go index e2953cf6b769..311185c170bd 100644 --- a/component/loki/process/stages/template.go +++ b/component/loki/process/stages/template.go @@ -13,7 +13,7 @@ import ( "github.com/Masterminds/sprig/v3" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" "golang.org/x/crypto/sha3" diff --git a/component/loki/process/stages/tenant.go b/component/loki/process/stages/tenant.go index 903adebfb9ef..3a66d0d52bef 100644 --- a/component/loki/process/stages/tenant.go +++ b/component/loki/process/stages/tenant.go @@ -6,7 +6,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" ) diff --git a/component/loki/process/stages/timestamp.go b/component/loki/process/stages/timestamp.go index 2ec87ed356d3..83ea240931bc 100644 --- a/component/loki/process/stages/timestamp.go +++ b/component/loki/process/stages/timestamp.go @@ -11,7 +11,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" lru "github.com/hashicorp/golang-lru" "github.com/prometheus/common/model" diff --git a/component/loki/relabel/relabel.go b/component/loki/relabel/relabel.go index 50fa15c9f06b..aed25ffd4c06 100644 --- a/component/loki/relabel/relabel.go +++ b/component/loki/relabel/relabel.go @@ -5,10 +5,10 @@ import ( "reflect" "sync" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/loki" flow_relabel "github.com/grafana/agent/component/common/relabel" + "github.com/grafana/agent/pkg/flow/logging/level" lru "github.com/hashicorp/golang-lru" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/component/loki/source/api/internal/lokipush/push_api_server.go b/component/loki/source/api/internal/lokipush/push_api_server.go index 9141ff2ed21f..b875023c3e76 100644 --- a/component/loki/source/api/internal/lokipush/push_api_server.go +++ b/component/loki/source/api/internal/lokipush/push_api_server.go @@ -10,11 +10,11 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/gorilla/mux" "github.com/grafana/agent/component/common/loki" fnet "github.com/grafana/agent/component/common/net" frelabel "github.com/grafana/agent/component/common/relabel" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/dskit/tenant" "github.com/grafana/loki/pkg/loghttp/push" "github.com/grafana/loki/pkg/logproto" diff --git a/component/loki/source/aws_firehose/internal/handler.go b/component/loki/source/aws_firehose/internal/handler.go index 9f034e446d36..8313f1a63e7a 100644 --- a/component/loki/source/aws_firehose/internal/handler.go +++ b/component/loki/source/aws_firehose/internal/handler.go @@ -14,7 +14,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/component/loki/source/azure_event_hubs/azure_event_hubs.go b/component/loki/source/azure_event_hubs/azure_event_hubs.go index befe5cc0f4d0..7f7f6437ffd4 100644 --- a/component/loki/source/azure_event_hubs/azure_event_hubs.go +++ b/component/loki/source/azure_event_hubs/azure_event_hubs.go @@ -7,12 +7,12 @@ import ( "sync" "github.com/IBM/sarama" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/loki" flow_relabel "github.com/grafana/agent/component/common/relabel" "github.com/grafana/agent/component/loki/source/azure_event_hubs/internal/parser" kt "github.com/grafana/agent/component/loki/source/internal/kafkatarget" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/dskit/flagext" "github.com/prometheus/common/model" diff --git a/component/loki/source/cloudflare/cloudflare.go b/component/loki/source/cloudflare/cloudflare.go index b14baa815bfc..f1435bfae6ef 100644 --- a/component/loki/source/cloudflare/cloudflare.go +++ b/component/loki/source/cloudflare/cloudflare.go @@ -8,11 +8,11 @@ import ( "sync" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" cft "github.com/grafana/agent/component/loki/source/cloudflare/internal/cloudflaretarget" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/river/rivertypes" "github.com/prometheus/common/model" ) diff --git a/component/loki/source/cloudflare/internal/cloudflaretarget/target.go b/component/loki/source/cloudflare/internal/cloudflaretarget/target.go index 7d1db02b8476..004565bfa7fe 100644 --- a/component/loki/source/cloudflare/internal/cloudflaretarget/target.go +++ b/component/loki/source/cloudflare/internal/cloudflaretarget/target.go @@ -14,9 +14,9 @@ import ( "github.com/buger/jsonparser" "github.com/cloudflare/cloudflare-go" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/dskit/backoff" "github.com/grafana/dskit/concurrency" "github.com/grafana/dskit/multierror" diff --git a/component/loki/source/docker/docker.go b/component/loki/source/docker/docker.go index 79c5b54fc0b7..3508500e97c8 100644 --- a/component/loki/source/docker/docker.go +++ b/component/loki/source/docker/docker.go @@ -11,13 +11,13 @@ import ( "github.com/docker/docker/client" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" flow_relabel "github.com/grafana/agent/component/common/relabel" "github.com/grafana/agent/component/discovery" dt "github.com/grafana/agent/component/loki/source/docker/internal/dockertarget" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/relabel" ) diff --git a/component/loki/source/docker/internal/dockertarget/target.go b/component/loki/source/docker/internal/dockertarget/target.go index 6c4a1a9edd9d..f1cca0fea325 100644 --- a/component/loki/source/docker/internal/dockertarget/target.go +++ b/component/loki/source/docker/internal/dockertarget/target.go @@ -18,9 +18,9 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/pkg/stdcopy" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/component/loki/source/docker/runner.go b/component/loki/source/docker/runner.go index 896c7237d8cc..b270cecf9b3d 100644 --- a/component/loki/source/docker/runner.go +++ b/component/loki/source/docker/runner.go @@ -7,10 +7,10 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" dt "github.com/grafana/agent/component/loki/source/docker/internal/dockertarget" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/runner" ) diff --git a/component/loki/source/file/decompresser.go b/component/loki/source/file/decompresser.go index d9fe39dae7bc..c70ec2b7b94b 100644 --- a/component/loki/source/file/decompresser.go +++ b/component/loki/source/file/decompresser.go @@ -19,9 +19,9 @@ import ( "unsafe" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/common/model" "go.uber.org/atomic" diff --git a/component/loki/source/file/file.go b/component/loki/source/file/file.go index 0c8d1b8d2c4f..1b5cbc62c8c5 100644 --- a/component/loki/source/file/file.go +++ b/component/loki/source/file/file.go @@ -9,11 +9,11 @@ import ( "sync" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" "github.com/grafana/agent/component/discovery" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/tail/watch" "github.com/prometheus/common/model" ) diff --git a/component/loki/source/file/tailer.go b/component/loki/source/file/tailer.go index b7f5a731567f..c05fcda166f6 100644 --- a/component/loki/source/file/tailer.go +++ b/component/loki/source/file/tailer.go @@ -12,9 +12,9 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/loki/pkg/logproto" "github.com/grafana/loki/pkg/util" "github.com/grafana/tail" diff --git a/component/loki/source/gcplog/gcplog.go b/component/loki/source/gcplog/gcplog.go index 9a0e61dc26c6..4dfbfee73522 100644 --- a/component/loki/source/gcplog/gcplog.go +++ b/component/loki/source/gcplog/gcplog.go @@ -6,7 +6,7 @@ import ( "strings" "sync" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/model/relabel" diff --git a/component/loki/source/gcplog/internal/gcplogtarget/pull_target.go b/component/loki/source/gcplog/internal/gcplogtarget/pull_target.go index 11ae8dddad97..9362aaadd515 100644 --- a/component/loki/source/gcplog/internal/gcplogtarget/pull_target.go +++ b/component/loki/source/gcplog/internal/gcplogtarget/pull_target.go @@ -13,7 +13,7 @@ import ( "cloud.google.com/go/pubsub" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/dskit/backoff" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/relabel" diff --git a/component/loki/source/gcplog/internal/gcplogtarget/push_target.go b/component/loki/source/gcplog/internal/gcplogtarget/push_target.go index f89cd89984b6..bd79ff676d73 100644 --- a/component/loki/source/gcplog/internal/gcplogtarget/push_target.go +++ b/component/loki/source/gcplog/internal/gcplogtarget/push_target.go @@ -13,8 +13,8 @@ import ( "net/http" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/gorilla/mux" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/relabel" diff --git a/component/loki/source/gelf/internal/target/gelftarget.go b/component/loki/source/gelf/internal/target/gelftarget.go index 90aaa31fb041..17e4c03ec9d7 100644 --- a/component/loki/source/gelf/internal/target/gelftarget.go +++ b/component/loki/source/gelf/internal/target/gelftarget.go @@ -14,7 +14,7 @@ import ( "github.com/grafana/agent/component/common/loki" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/go-gelf/v2/gelf" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/component/loki/source/heroku/heroku.go b/component/loki/source/heroku/heroku.go index 8bbbf21c0fda..afaf02e66dad 100644 --- a/component/loki/source/heroku/heroku.go +++ b/component/loki/source/heroku/heroku.go @@ -5,12 +5,12 @@ import ( "reflect" "sync" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/loki" fnet "github.com/grafana/agent/component/common/net" flow_relabel "github.com/grafana/agent/component/common/relabel" ht "github.com/grafana/agent/component/loki/source/heroku/internal/herokutarget" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/util" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" diff --git a/component/loki/source/heroku/internal/herokutarget/herokutarget.go b/component/loki/source/heroku/internal/herokutarget/herokutarget.go index 0d5a0fc37c69..83eaf31c0aaf 100644 --- a/component/loki/source/heroku/internal/herokutarget/herokutarget.go +++ b/component/loki/source/heroku/internal/herokutarget/herokutarget.go @@ -11,10 +11,10 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/gorilla/mux" "github.com/grafana/agent/component/common/loki" fnet "github.com/grafana/agent/component/common/net" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/loki/pkg/logproto" herokuEncoding "github.com/heroku/x/logplex/encoding" "github.com/prometheus/client_golang/prometheus" diff --git a/component/loki/source/internal/kafkatarget/consumer.go b/component/loki/source/internal/kafkatarget/consumer.go index 40eac7081ff7..7c438de5e32d 100644 --- a/component/loki/source/internal/kafkatarget/consumer.go +++ b/component/loki/source/internal/kafkatarget/consumer.go @@ -12,7 +12,7 @@ import ( "github.com/IBM/sarama" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/dskit/backoff" "github.com/grafana/loki/clients/pkg/promtail/targets/target" diff --git a/component/loki/source/internal/kafkatarget/kafkatarget.go b/component/loki/source/internal/kafkatarget/kafkatarget.go index b9c14f919742..2fee238944f0 100644 --- a/component/loki/source/internal/kafkatarget/kafkatarget.go +++ b/component/loki/source/internal/kafkatarget/kafkatarget.go @@ -10,8 +10,8 @@ import ( "github.com/IBM/sarama" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/loki/clients/pkg/promtail/targets/target" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/component/loki/source/internal/kafkatarget/target_syncer.go b/component/loki/source/internal/kafkatarget/target_syncer.go index 0355c6134329..1609688bcb36 100644 --- a/component/loki/source/internal/kafkatarget/target_syncer.go +++ b/component/loki/source/internal/kafkatarget/target_syncer.go @@ -13,7 +13,7 @@ import ( "github.com/IBM/sarama" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" promconfig "github.com/prometheus/common/config" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/labels" diff --git a/component/loki/source/journal/internal/target/journaltarget.go b/component/loki/source/journal/internal/target/journaltarget.go index 12b66f32f619..91dbc6580049 100644 --- a/component/loki/source/journal/internal/target/journaltarget.go +++ b/component/loki/source/journal/internal/target/journaltarget.go @@ -18,7 +18,7 @@ import ( "github.com/coreos/go-systemd/sdjournal" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" "github.com/prometheus/common/model" diff --git a/component/loki/source/journal/journal_stub.go b/component/loki/source/journal/journal_stub.go index fc5f9bf12082..59c6b90ec6cd 100644 --- a/component/loki/source/journal/journal_stub.go +++ b/component/loki/source/journal/journal_stub.go @@ -5,8 +5,8 @@ package journal import ( "context" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" ) func init() { diff --git a/component/loki/source/kafka/kafka.go b/component/loki/source/kafka/kafka.go index 4f2e2516c9f9..b8c14583fc96 100644 --- a/component/loki/source/kafka/kafka.go +++ b/component/loki/source/kafka/kafka.go @@ -5,12 +5,12 @@ import ( "sync" "github.com/IBM/sarama" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/config" "github.com/grafana/agent/component/common/loki" flow_relabel "github.com/grafana/agent/component/common/relabel" kt "github.com/grafana/agent/component/loki/source/internal/kafkatarget" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/dskit/flagext" "github.com/prometheus/common/model" ) diff --git a/component/loki/source/kubernetes/kubernetes.go b/component/loki/source/kubernetes/kubernetes.go index a7172fc6a156..859710dbc3e8 100644 --- a/component/loki/source/kubernetes/kubernetes.go +++ b/component/loki/source/kubernetes/kubernetes.go @@ -11,13 +11,13 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" commonk8s "github.com/grafana/agent/component/common/kubernetes" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" "github.com/grafana/agent/component/discovery" "github.com/grafana/agent/component/loki/source/kubernetes/kubetail" + "github.com/grafana/agent/pkg/flow/logging/level" "k8s.io/client-go/kubernetes" ) diff --git a/component/loki/source/kubernetes/kubetail/kubetail.go b/component/loki/source/kubernetes/kubetail/kubetail.go index e198754bbc2f..7f4c1984bb71 100644 --- a/component/loki/source/kubernetes/kubetail/kubetail.go +++ b/component/loki/source/kubernetes/kubetail/kubetail.go @@ -6,9 +6,9 @@ import ( "sync" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/runner" "k8s.io/client-go/kubernetes" ) diff --git a/component/loki/source/kubernetes/kubetail/tailer.go b/component/loki/source/kubernetes/kubetail/tailer.go index c0e55bdafd81..7b447db751e5 100644 --- a/component/loki/source/kubernetes/kubetail/tailer.go +++ b/component/loki/source/kubernetes/kubetail/tailer.go @@ -10,8 +10,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/runner" "github.com/grafana/dskit/backoff" "github.com/grafana/loki/pkg/logproto" diff --git a/component/loki/source/kubernetes_events/event_controller.go b/component/loki/source/kubernetes_events/event_controller.go index c161f01a288f..0f45c3dc62ae 100644 --- a/component/loki/source/kubernetes_events/event_controller.go +++ b/component/loki/source/kubernetes_events/event_controller.go @@ -10,9 +10,9 @@ import ( "github.com/cespare/xxhash/v2" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/runner" "github.com/grafana/loki/pkg/logproto" "github.com/prometheus/common/model" diff --git a/component/loki/source/kubernetes_events/kubernetes_events.go b/component/loki/source/kubernetes_events/kubernetes_events.go index a50c5abfacd3..e409f6aebcdc 100644 --- a/component/loki/source/kubernetes_events/kubernetes_events.go +++ b/component/loki/source/kubernetes_events/kubernetes_events.go @@ -12,11 +12,11 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/kubernetes" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/common/loki/positions" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/runner" "github.com/oklog/run" "k8s.io/client-go/rest" diff --git a/component/loki/source/podlogs/controller.go b/component/loki/source/podlogs/controller.go index 83cfe1a9b674..5aa86d0391a9 100644 --- a/component/loki/source/podlogs/controller.go +++ b/component/loki/source/podlogs/controller.go @@ -8,8 +8,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" monitoringv1alpha2 "github.com/grafana/agent/component/loki/source/podlogs/internal/apis/monitoring/v1alpha2" + "github.com/grafana/agent/pkg/flow/logging/level" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" diff --git a/component/loki/source/podlogs/podlogs.go b/component/loki/source/podlogs/podlogs.go index e66c2a9a5eec..f051b84856ed 100644 --- a/component/loki/source/podlogs/podlogs.go +++ b/component/loki/source/podlogs/podlogs.go @@ -10,7 +10,6 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/config" commonk8s "github.com/grafana/agent/component/common/kubernetes" @@ -18,6 +17,7 @@ import ( "github.com/grafana/agent/component/common/loki/positions" "github.com/grafana/agent/component/loki/source/kubernetes" "github.com/grafana/agent/component/loki/source/kubernetes/kubetail" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/oklog/run" kubeclient "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" diff --git a/component/loki/source/podlogs/reconciler.go b/component/loki/source/podlogs/reconciler.go index 978e96c019c1..fd6db061fa21 100644 --- a/component/loki/source/podlogs/reconciler.go +++ b/component/loki/source/podlogs/reconciler.go @@ -9,9 +9,9 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/loki/source/kubernetes/kubetail" monitoringv1alpha2 "github.com/grafana/agent/component/loki/source/podlogs/internal/apis/monitoring/v1alpha2" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/common/model" promlabels "github.com/prometheus/prometheus/model/labels" "github.com/prometheus/prometheus/model/relabel" diff --git a/component/loki/source/syslog/internal/syslogtarget/syslogtarget.go b/component/loki/source/syslog/internal/syslogtarget/syslogtarget.go index 375719e9fbbc..5e50f548a874 100644 --- a/component/loki/source/syslog/internal/syslogtarget/syslogtarget.go +++ b/component/loki/source/syslog/internal/syslogtarget/syslogtarget.go @@ -12,7 +12,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/influxdata/go-syslog/v3" "github.com/influxdata/go-syslog/v3/rfc5424" "github.com/prometheus/common/model" diff --git a/component/loki/source/syslog/internal/syslogtarget/transport.go b/component/loki/source/syslog/internal/syslogtarget/transport.go index 8d6911a493f7..cf12747a6b73 100644 --- a/component/loki/source/syslog/internal/syslogtarget/transport.go +++ b/component/loki/source/syslog/internal/syslogtarget/transport.go @@ -20,7 +20,7 @@ import ( "github.com/mwitkow/go-conntrack" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/influxdata/go-syslog/v3" "github.com/prometheus/common/config" "github.com/prometheus/prometheus/model/labels" diff --git a/component/loki/source/syslog/syslog.go b/component/loki/source/syslog/syslog.go index 26c610121df4..ba584dd3f122 100644 --- a/component/loki/source/syslog/syslog.go +++ b/component/loki/source/syslog/syslog.go @@ -5,11 +5,11 @@ import ( "reflect" "sync" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/loki" flow_relabel "github.com/grafana/agent/component/common/relabel" st "github.com/grafana/agent/component/loki/source/syslog/internal/syslogtarget" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/prometheus/model/relabel" ) diff --git a/component/loki/source/windowsevent/component_stub.go b/component/loki/source/windowsevent/component_stub.go index 5092baaa9bf1..440c9c1be424 100644 --- a/component/loki/source/windowsevent/component_stub.go +++ b/component/loki/source/windowsevent/component_stub.go @@ -5,7 +5,7 @@ package windowsevent import ( "context" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/component" ) diff --git a/component/mimir/rules/kubernetes/events.go b/component/mimir/rules/kubernetes/events.go index b3b9a6d994a6..02e8cf2c03da 100644 --- a/component/mimir/rules/kubernetes/events.go +++ b/component/mimir/rules/kubernetes/events.go @@ -7,7 +7,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/hashicorp/go-multierror" promv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/prometheus/prometheus/model/rulefmt" diff --git a/component/mimir/rules/kubernetes/rules.go b/component/mimir/rules/kubernetes/rules.go index b39d623b84b9..16deaaa74b42 100644 --- a/component/mimir/rules/kubernetes/rules.go +++ b/component/mimir/rules/kubernetes/rules.go @@ -7,8 +7,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" mimirClient "github.com/grafana/agent/pkg/mimir/client" "github.com/grafana/dskit/instrument" promListers "github.com/prometheus-operator/prometheus-operator/pkg/client/listers/monitoring/v1" diff --git a/component/module/git/git.go b/component/module/git/git.go index 060cf2ce369e..bd4ec21bdf04 100644 --- a/component/module/git/git.go +++ b/component/module/git/git.go @@ -9,10 +9,10 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/module" "github.com/grafana/agent/component/module/git/internal/vcs" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/service/cluster" "github.com/grafana/agent/service/http" otel_service "github.com/grafana/agent/service/otel" diff --git a/component/module/module.go b/component/module/module.go index 53e886721e65..7995fdbca5c9 100644 --- a/component/module/module.go +++ b/component/module/module.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" ) // ModuleComponent holds the common properties for module components. diff --git a/component/otelcol/connector/spanlogs/spanlogs.go b/component/otelcol/connector/spanlogs/spanlogs.go index 2dbbab2b2086..78ee77c849ff 100644 --- a/component/otelcol/connector/spanlogs/spanlogs.go +++ b/component/otelcol/connector/spanlogs/spanlogs.go @@ -5,11 +5,11 @@ import ( "context" "fmt" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/internal/fanoutconsumer" "github.com/grafana/agent/component/otelcol/internal/lazyconsumer" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/river" ) diff --git a/component/otelcol/exporter/loki/internal/convert/convert.go b/component/otelcol/exporter/loki/internal/convert/convert.go index e1f8edbb6ec1..99d4e2b086c7 100644 --- a/component/otelcol/exporter/loki/internal/convert/convert.go +++ b/component/otelcol/exporter/loki/internal/convert/convert.go @@ -13,8 +13,8 @@ import ( "sync" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" + "github.com/grafana/agent/pkg/flow/logging/level" loki_translator "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki" "github.com/prometheus/client_golang/prometheus" "go.opentelemetry.io/collector/consumer" diff --git a/component/otelcol/exporter/otlp/otlp_test.go b/component/otelcol/exporter/otlp/otlp_test.go index fa7e76900ffa..9c256ab94ba2 100644 --- a/component/otelcol/exporter/otlp/otlp_test.go +++ b/component/otelcol/exporter/otlp/otlp_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/exporter/otlp" "github.com/grafana/agent/pkg/flow/componenttest" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/util" "github.com/grafana/dskit/backoff" "github.com/grafana/river" diff --git a/component/otelcol/exporter/otlphttp/otlphttp_test.go b/component/otelcol/exporter/otlphttp/otlphttp_test.go index 3687278bfb53..64e6328b2fb5 100644 --- a/component/otelcol/exporter/otlphttp/otlphttp_test.go +++ b/component/otelcol/exporter/otlphttp/otlphttp_test.go @@ -8,10 +8,10 @@ import ( "testing" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/exporter/otlphttp" "github.com/grafana/agent/pkg/flow/componenttest" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/util" "github.com/grafana/dskit/backoff" "github.com/grafana/river" diff --git a/component/otelcol/exporter/prometheus/internal/convert/convert.go b/component/otelcol/exporter/prometheus/internal/convert/convert.go index 69569cec5f11..ef76e73337fc 100644 --- a/component/otelcol/exporter/prometheus/internal/convert/convert.go +++ b/component/otelcol/exporter/prometheus/internal/convert/convert.go @@ -18,7 +18,7 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/model/exemplar" diff --git a/component/otelcol/internal/scheduler/host.go b/component/otelcol/internal/scheduler/host.go index 377210660762..e1754b7f7f48 100644 --- a/component/otelcol/internal/scheduler/host.go +++ b/component/otelcol/internal/scheduler/host.go @@ -2,7 +2,7 @@ package scheduler import ( "github.com/go-kit/log" - "github.com/go-kit/log/level" + "github.com/grafana/agent/pkg/flow/logging/level" otelcomponent "go.opentelemetry.io/collector/component" otelextension "go.opentelemetry.io/collector/extension" diff --git a/component/otelcol/internal/scheduler/scheduler.go b/component/otelcol/internal/scheduler/scheduler.go index 4715b8aa04fd..30052fb446e7 100644 --- a/component/otelcol/internal/scheduler/scheduler.go +++ b/component/otelcol/internal/scheduler/scheduler.go @@ -9,8 +9,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" otelcomponent "go.opentelemetry.io/collector/component" "go.uber.org/multierr" ) diff --git a/component/otelcol/processor/batch/batch_test.go b/component/otelcol/processor/batch/batch_test.go index ce5371b4dc67..d411dbd68a5f 100644 --- a/component/otelcol/processor/batch/batch_test.go +++ b/component/otelcol/processor/batch/batch_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/internal/fakeconsumer" "github.com/grafana/agent/component/otelcol/processor/batch" "github.com/grafana/agent/pkg/flow/componenttest" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/util" "github.com/grafana/dskit/backoff" "github.com/grafana/river" diff --git a/component/otelcol/processor/discovery/discovery.go b/component/otelcol/processor/discovery/discovery.go index 989712355199..bbc65ec6e424 100644 --- a/component/otelcol/processor/discovery/discovery.go +++ b/component/otelcol/processor/discovery/discovery.go @@ -6,12 +6,12 @@ import ( "fmt" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/discovery" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/internal/fanoutconsumer" "github.com/grafana/agent/component/otelcol/internal/lazyconsumer" + "github.com/grafana/agent/pkg/flow/logging/level" promsdconsumer "github.com/grafana/agent/pkg/traces/promsdprocessor/consumer" "github.com/grafana/river" ) diff --git a/component/otelcol/processor/memorylimiter/memorylimiter_test.go b/component/otelcol/processor/memorylimiter/memorylimiter_test.go index d113e2a10b36..952b0da7e25e 100644 --- a/component/otelcol/processor/memorylimiter/memorylimiter_test.go +++ b/component/otelcol/processor/memorylimiter/memorylimiter_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/internal/fakeconsumer" "github.com/grafana/agent/component/otelcol/processor/memorylimiter" "github.com/grafana/agent/pkg/flow/componenttest" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/util" "github.com/grafana/dskit/backoff" "github.com/grafana/river" diff --git a/component/otelcol/processor/processortest/processortest.go b/component/otelcol/processor/processortest/processortest.go index c2b29cee4064..3153e662c656 100644 --- a/component/otelcol/processor/processortest/processortest.go +++ b/component/otelcol/processor/processortest/processortest.go @@ -6,11 +6,11 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/internal/fakeconsumer" "github.com/grafana/agent/pkg/flow/componenttest" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/dskit/backoff" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/pdata/plog" diff --git a/component/otelcol/processor/tail_sampling/tail_sampling_test.go b/component/otelcol/processor/tail_sampling/tail_sampling_test.go index 3693e8600ec8..89912137a812 100644 --- a/component/otelcol/processor/tail_sampling/tail_sampling_test.go +++ b/component/otelcol/processor/tail_sampling/tail_sampling_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/internal/fakeconsumer" "github.com/grafana/agent/pkg/flow/componenttest" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/util" "github.com/grafana/dskit/backoff" "github.com/grafana/river" diff --git a/component/otelcol/receiver/loki/loki.go b/component/otelcol/receiver/loki/loki.go index a46296e3f5ba..1ee008165abf 100644 --- a/component/otelcol/receiver/loki/loki.go +++ b/component/otelcol/receiver/loki/loki.go @@ -8,11 +8,11 @@ import ( "sync" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/common/loki" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/internal/fanoutconsumer" + "github.com/grafana/agent/pkg/flow/logging/level" loki_translator "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/loki" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/plog" diff --git a/component/otelcol/receiver/otlp/otlp_test.go b/component/otelcol/receiver/otlp/otlp_test.go index f1004eaedf66..38d6ab54a464 100644 --- a/component/otelcol/receiver/otlp/otlp_test.go +++ b/component/otelcol/receiver/otlp/otlp_test.go @@ -8,11 +8,11 @@ import ( "testing" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/otelcol" "github.com/grafana/agent/component/otelcol/internal/fakeconsumer" "github.com/grafana/agent/component/otelcol/receiver/otlp" "github.com/grafana/agent/pkg/flow/componenttest" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/util" "github.com/grafana/dskit/backoff" "github.com/grafana/river" diff --git a/component/prometheus/exporter/exporter.go b/component/prometheus/exporter/exporter.go index 74e41ce46815..984b5d040a56 100644 --- a/component/prometheus/exporter/exporter.go +++ b/component/prometheus/exporter/exporter.go @@ -9,9 +9,9 @@ import ( "strings" "sync" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/discovery" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/integrations" http_service "github.com/grafana/agent/service/http" "github.com/prometheus/common/model" diff --git a/component/prometheus/operator/common/component.go b/component/prometheus/operator/common/component.go index cc3e44768c57..f6b6499e9845 100644 --- a/component/prometheus/operator/common/component.go +++ b/component/prometheus/operator/common/component.go @@ -8,9 +8,9 @@ import ( "sync" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/prometheus/operator" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/service/cluster" "gopkg.in/yaml.v3" ) diff --git a/component/prometheus/operator/common/crdmanager.go b/component/prometheus/operator/common/crdmanager.go index fe75e5714b47..c6046ef70b5a 100644 --- a/component/prometheus/operator/common/crdmanager.go +++ b/component/prometheus/operator/common/crdmanager.go @@ -10,9 +10,9 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/prometheus" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/service/cluster" "github.com/grafana/agent/service/http" "github.com/grafana/ckit/shard" diff --git a/component/prometheus/receive_http/receive_http.go b/component/prometheus/receive_http/receive_http.go index 526488ce7fd6..5d7923a353ce 100644 --- a/component/prometheus/receive_http/receive_http.go +++ b/component/prometheus/receive_http/receive_http.go @@ -7,11 +7,11 @@ import ( "reflect" "sync" - "github.com/go-kit/log/level" "github.com/gorilla/mux" "github.com/grafana/agent/component" fnet "github.com/grafana/agent/component/common/net" agentprom "github.com/grafana/agent/component/prometheus" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/util" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/prometheus/storage" diff --git a/component/prometheus/remotewrite/remote_write.go b/component/prometheus/remotewrite/remote_write.go index 40bcc20f495e..94254c4b12b9 100644 --- a/component/prometheus/remotewrite/remote_write.go +++ b/component/prometheus/remotewrite/remote_write.go @@ -19,9 +19,9 @@ import ( "github.com/grafana/agent/component/prometheus" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/pkg/build" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/metrics/wal" "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/storage" diff --git a/component/prometheus/scrape/scrape.go b/component/prometheus/scrape/scrape.go index 1501f0ace870..06ee45715e46 100644 --- a/component/prometheus/scrape/scrape.go +++ b/component/prometheus/scrape/scrape.go @@ -8,12 +8,12 @@ import ( "time" "github.com/alecthomas/units" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" component_config "github.com/grafana/agent/component/common/config" "github.com/grafana/agent/component/discovery" "github.com/grafana/agent/component/prometheus" "github.com/grafana/agent/pkg/build" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/service/cluster" "github.com/grafana/agent/service/http" client_prometheus "github.com/prometheus/client_golang/prometheus" diff --git a/component/pyroscope/ebpf/ebpf_linux.go b/component/pyroscope/ebpf/ebpf_linux.go index 6bdbe02d8ccf..722b9f1a25ad 100644 --- a/component/pyroscope/ebpf/ebpf_linux.go +++ b/component/pyroscope/ebpf/ebpf_linux.go @@ -10,9 +10,9 @@ import ( "sync" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/component/pyroscope" + "github.com/grafana/agent/pkg/flow/logging/level" ebpfspy "github.com/grafana/pyroscope/ebpf" "github.com/grafana/pyroscope/ebpf/pprof" "github.com/grafana/pyroscope/ebpf/sd" diff --git a/component/pyroscope/ebpf/ebpf_placeholder.go b/component/pyroscope/ebpf/ebpf_placeholder.go index 1c03214dbd39..59a54d9f4b20 100644 --- a/component/pyroscope/ebpf/ebpf_placeholder.go +++ b/component/pyroscope/ebpf/ebpf_placeholder.go @@ -5,8 +5,8 @@ package ebpf import ( "context" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" ) func init() { diff --git a/component/pyroscope/scrape/manager.go b/component/pyroscope/scrape/manager.go index 6d370131c70c..016f66b437b4 100644 --- a/component/pyroscope/scrape/manager.go +++ b/component/pyroscope/scrape/manager.go @@ -6,8 +6,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/pyroscope" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/prometheus/prometheus/discovery/targetgroup" ) diff --git a/component/pyroscope/scrape/scrape.go b/component/pyroscope/scrape/scrape.go index 34e4cd65e4a9..cd807fbb8b24 100644 --- a/component/pyroscope/scrape/scrape.go +++ b/component/pyroscope/scrape/scrape.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/pyroscope" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/service/cluster" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/discovery/targetgroup" diff --git a/component/pyroscope/scrape/scrape_loop.go b/component/pyroscope/scrape/scrape_loop.go index a8600a5a62a1..5abb3fd801f3 100644 --- a/component/pyroscope/scrape/scrape_loop.go +++ b/component/pyroscope/scrape/scrape_loop.go @@ -11,8 +11,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/pyroscope" + "github.com/grafana/agent/pkg/flow/logging/level" commonconfig "github.com/prometheus/common/config" "github.com/prometheus/prometheus/discovery/targetgroup" "github.com/prometheus/prometheus/util/pool" diff --git a/component/pyroscope/write/write.go b/component/pyroscope/write/write.go index e596dd1c60db..e92c7dfb1706 100644 --- a/component/pyroscope/write/write.go +++ b/component/pyroscope/write/write.go @@ -8,8 +8,8 @@ import ( "time" "github.com/bufbuild/connect-go" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/pyroscope" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/oklog/run" commonconfig "github.com/prometheus/common/config" "github.com/prometheus/common/model" diff --git a/component/remote/http/http.go b/component/remote/http/http.go index 897a10033892..3966a63c6522 100644 --- a/component/remote/http/http.go +++ b/component/remote/http/http.go @@ -11,10 +11,10 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" common_config "github.com/grafana/agent/component/common/config" "github.com/grafana/agent/pkg/build" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/river/rivertypes" prom_config "github.com/prometheus/common/config" ) diff --git a/component/remote/http/http_test.go b/component/remote/http/http_test.go index 144a542e16e4..f8ef2214394f 100644 --- a/component/remote/http/http_test.go +++ b/component/remote/http/http_test.go @@ -9,9 +9,9 @@ import ( "testing" "time" - "github.com/go-kit/log/level" http_component "github.com/grafana/agent/component/remote/http" "github.com/grafana/agent/pkg/flow/componenttest" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/util" "github.com/grafana/dskit/backoff" "github.com/grafana/river" diff --git a/component/remote/vault/refresher.go b/component/remote/vault/refresher.go index d3689886de43..ef669410c833 100644 --- a/component/remote/vault/refresher.go +++ b/component/remote/vault/refresher.go @@ -7,8 +7,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" vault "github.com/hashicorp/vault/api" "github.com/prometheus/client_golang/prometheus" ) diff --git a/component/remote/vault/vault.go b/component/remote/vault/vault.go index ab0be8d1ff3b..5b8e347cde66 100644 --- a/component/remote/vault/vault.go +++ b/component/remote/vault/vault.go @@ -7,8 +7,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/river/rivertypes" "github.com/oklog/run" diff --git a/pkg/flow/flow.go b/pkg/flow/flow.go index 9b4d43be73b9..9b2294718f61 100644 --- a/pkg/flow/flow.go +++ b/pkg/flow/flow.go @@ -50,10 +50,10 @@ import ( "fmt" "sync" - "github.com/go-kit/log/level" "github.com/grafana/agent/pkg/flow/internal/controller" "github.com/grafana/agent/pkg/flow/internal/worker" "github.com/grafana/agent/pkg/flow/logging" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/flow/tracing" "github.com/grafana/agent/service" "github.com/prometheus/client_golang/prometheus" diff --git a/pkg/flow/internal/controller/loader.go b/pkg/flow/internal/controller/loader.go index 9544f60534e6..e32a5a6de9f9 100644 --- a/pkg/flow/internal/controller/loader.go +++ b/pkg/flow/internal/controller/loader.go @@ -8,9 +8,9 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/pkg/flow/internal/dag" "github.com/grafana/agent/pkg/flow/internal/worker" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/flow/tracing" "github.com/grafana/agent/service" "github.com/grafana/dskit/backoff" diff --git a/pkg/flow/internal/controller/node_component.go b/pkg/flow/internal/controller/node_component.go index 9481fd1f5b5b..e86ac1af3dd6 100644 --- a/pkg/flow/internal/controller/node_component.go +++ b/pkg/flow/internal/controller/node_component.go @@ -13,9 +13,9 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/pkg/flow/logging" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/flow/tracing" "github.com/grafana/river/ast" "github.com/grafana/river/vm" diff --git a/pkg/flow/internal/testcomponents/count.go b/pkg/flow/internal/testcomponents/count.go index 88e37af793ce..5f6d5afb9fd2 100644 --- a/pkg/flow/internal/testcomponents/count.go +++ b/pkg/flow/internal/testcomponents/count.go @@ -7,8 +7,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" "go.uber.org/atomic" ) diff --git a/pkg/flow/internal/testcomponents/passthrough.go b/pkg/flow/internal/testcomponents/passthrough.go index eaa0a175d825..2dc48fee4720 100644 --- a/pkg/flow/internal/testcomponents/passthrough.go +++ b/pkg/flow/internal/testcomponents/passthrough.go @@ -5,8 +5,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" ) func init() { diff --git a/pkg/flow/internal/testcomponents/sumation.go b/pkg/flow/internal/testcomponents/sumation.go index 88995733e9d9..5d5258158456 100644 --- a/pkg/flow/internal/testcomponents/sumation.go +++ b/pkg/flow/internal/testcomponents/sumation.go @@ -4,8 +4,8 @@ import ( "context" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" "go.uber.org/atomic" ) diff --git a/pkg/flow/internal/testcomponents/tick.go b/pkg/flow/internal/testcomponents/tick.go index 65ed86fd9d2c..c33b9d3972a0 100644 --- a/pkg/flow/internal/testcomponents/tick.go +++ b/pkg/flow/internal/testcomponents/tick.go @@ -7,8 +7,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" ) func init() { diff --git a/pkg/flow/logging/level/level.go b/pkg/flow/logging/level/level.go index 3f49d784b845..01730c032667 100644 --- a/pkg/flow/logging/level/level.go +++ b/pkg/flow/logging/level/level.go @@ -5,6 +5,7 @@ import ( "log/slog" "github.com/go-kit/log" + gokitlevel "github.com/go-kit/log/level" "github.com/grafana/agent/pkg/flow/logging" ) @@ -32,6 +33,18 @@ func Debug(logger log.Logger) log.Logger { return toLevel(logger, "debug", slog.LevelDebug) } +func NewFilter(next log.Logger, options ...gokitlevel.Option) log.Logger { + return gokitlevel.NewFilter(next, options...) +} + +func AllowDebug() gokitlevel.Option { + return gokitlevel.AllowDebug() +} + +func AllowInfo() gokitlevel.Option { + return gokitlevel.AllowInfo() +} + func toLevel(logger log.Logger, level string, slogLevel slog.Level) log.Logger { switch l := logger.(type) { case logging.EnabledAware: diff --git a/pkg/flow/logging/options.go b/pkg/flow/logging/options.go index d32b7ac87360..9780c892374e 100644 --- a/pkg/flow/logging/options.go +++ b/pkg/flow/logging/options.go @@ -6,7 +6,6 @@ import ( "log/slog" "math" - "github.com/go-kit/log/level" "github.com/grafana/agent/component/common/loki" "github.com/grafana/river" ) @@ -68,22 +67,6 @@ func (ll *Level) UnmarshalText(text []byte) error { return nil } -// Filter returns a go-kit logging filter from the level. -func (ll Level) Filter() level.Option { - switch ll { - case LevelDebug: - return level.AllowDebug() - case LevelInfo: - return level.AllowInfo() - case LevelWarn: - return level.AllowWarn() - case LevelError: - return level.AllowError() - default: - return level.AllowAll() - } -} - type slogLevel Level func (l slogLevel) Level() slog.Level { diff --git a/pkg/flow/module.go b/pkg/flow/module.go index 10aa353ee882..ec97aab093d5 100644 --- a/pkg/flow/module.go +++ b/pkg/flow/module.go @@ -6,11 +6,11 @@ import ( "path" "sync" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" "github.com/grafana/agent/pkg/flow/internal/controller" "github.com/grafana/agent/pkg/flow/internal/worker" "github.com/grafana/agent/pkg/flow/logging" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/flow/tracing" "github.com/grafana/river/scanner" "github.com/prometheus/client_golang/prometheus" diff --git a/service/cluster/cluster.go b/service/cluster/cluster.go index 908dbdc6c18f..cf95165ea321 100644 --- a/service/cluster/cluster.go +++ b/service/cluster/cluster.go @@ -14,8 +14,8 @@ import ( "time" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/grafana/agent/component" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/service" http_service "github.com/grafana/agent/service/http" "github.com/grafana/ckit" diff --git a/service/http/http.go b/service/http/http.go index 25d3e204e5a1..cf703f942474 100644 --- a/service/http/http.go +++ b/service/http/http.go @@ -14,10 +14,10 @@ import ( "sync" "github.com/go-kit/log" - "github.com/go-kit/log/level" "github.com/gorilla/mux" "github.com/grafana/agent/component" "github.com/grafana/agent/pkg/flow" + "github.com/grafana/agent/pkg/flow/logging/level" "github.com/grafana/agent/pkg/server" "github.com/grafana/agent/service" "github.com/grafana/ckit/memconn"