Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion collector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ require (
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/bmatcuk/doublestar v1.3.4 // indirect
github.com/bmatcuk/doublestar/v4 v4.9.1 // indirect
github.com/boynux/squid-exporter v1.10.5-0.20230618153315-c1fae094e18e // indirect
github.com/buger/jsonparser v1.1.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions collector/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,6 @@ github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwj
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0=
github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
github.com/bmatcuk/doublestar/v4 v4.9.1 h1:X8jg9rRZmJd4yRy7ZeNDRnM+T3ZfHv15JiBJ/avrEXE=
github.com/bmatcuk/doublestar/v4 v4.9.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/boynux/squid-exporter v1.10.5-0.20230618153315-c1fae094e18e h1:C1vYe728vM2FpXaICJuDRt5zgGyRdMmUGYnVfM7WcLY=
Expand Down
1 change: 0 additions & 1 deletion extension/alloyengine/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ require (
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/bmatcuk/doublestar v1.3.4 // indirect
github.com/bmatcuk/doublestar/v4 v4.9.1 // indirect
github.com/boynux/squid-exporter v1.10.5-0.20230618153315-c1fae094e18e // indirect
github.com/buger/jsonparser v1.1.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions extension/alloyengine/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,6 @@ github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwj
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0=
github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
github.com/bmatcuk/doublestar/v4 v4.9.1 h1:X8jg9rRZmJd4yRy7ZeNDRnM+T3ZfHv15JiBJ/avrEXE=
github.com/bmatcuk/doublestar/v4 v4.9.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/boynux/squid-exporter v1.10.5-0.20230618153315-c1fae094e18e h1:C1vYe728vM2FpXaICJuDRt5zgGyRdMmUGYnVfM7WcLY=
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/s3 v1.89.0
github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.39.12
github.com/blang/semver/v4 v4.0.0
github.com/bmatcuk/doublestar v1.3.4
github.com/bmatcuk/doublestar/v4 v4.9.1
github.com/boynux/squid-exporter v1.10.5-0.20230618153315-c1fae094e18e
github.com/buger/jsonparser v1.1.1
github.com/burningalchemist/sql_exporter v0.0.0-20240103092044-466b38b6abc4
Expand Down Expand Up @@ -526,7 +526,6 @@ require (
github.com/beevik/ntp v1.3.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bmatcuk/doublestar/v4 v4.9.1 // indirect
github.com/caarlos0/env/v9 v9.0.0
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,6 @@ github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwj
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0=
github.com/bmatcuk/doublestar v1.3.4/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE=
github.com/bmatcuk/doublestar/v4 v4.9.1 h1:X8jg9rRZmJd4yRy7ZeNDRnM+T3ZfHv15JiBJ/avrEXE=
github.com/bmatcuk/doublestar/v4 v4.9.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/boynux/squid-exporter v1.10.5-0.20230618153315-c1fae094e18e h1:C1vYe728vM2FpXaICJuDRt5zgGyRdMmUGYnVfM7WcLY=
Expand Down
6 changes: 3 additions & 3 deletions internal/component/local/file_match/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path/filepath"
"time"

"github.com/bmatcuk/doublestar"
"github.com/bmatcuk/doublestar/v4"
"github.com/go-kit/log"

"github.com/grafana/alloy/internal/component/discovery"
Expand All @@ -23,14 +23,14 @@ type watch struct {
func (w *watch) getPaths() ([]discovery.Target, error) {
allMatchingPaths := make([]discovery.Target, 0)

matches, err := doublestar.Glob(w.getPath())
matches, err := doublestar.FilepathGlob(w.getPath())
if err != nil {
return nil, err
}
exclude := w.getExcludePath()
for _, m := range matches {
if exclude != "" {
if match, _ := doublestar.PathMatch(exclude, m); match {
if match, _ := doublestar.PathMatch(filepath.FromSlash(exclude), m); match {
continue
}
}
Expand Down
6 changes: 3 additions & 3 deletions internal/component/loki/source/file/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"iter"
"path/filepath"

"github.com/bmatcuk/doublestar"
"github.com/bmatcuk/doublestar/v4"
"github.com/go-kit/log"
"github.com/prometheus/common/model"

Expand Down Expand Up @@ -72,7 +72,7 @@ func (s *globResolver) Resolve(targets []discovery.Target) iter.Seq[resolvedTarg
targetPath, _ := target.Get(labelPath)
labels := target.NonReservedLabelSet()

matches, err := doublestar.Glob(targetPath)
matches, err := doublestar.FilepathGlob(targetPath)
if err != nil {
level.Error(s.logger).Log("msg", "failed to resolve target", "error", err)
continue
Expand All @@ -82,7 +82,7 @@ func (s *globResolver) Resolve(targets []discovery.Target) iter.Seq[resolvedTarg

for _, m := range matches {
if exclude != "" {
if match, _ := doublestar.PathMatch(exclude, m); match {
if match, _ := doublestar.PathMatch(filepath.FromSlash(exclude), m); match {
continue
}
}
Expand Down
Loading