diff --git a/exporter/signalfxexporter/go.mod b/exporter/signalfxexporter/go.mod index 7ad1b58160a51..dc31b74fa60f3 100644 --- a/exporter/signalfxexporter/go.mod +++ b/exporter/signalfxexporter/go.mod @@ -52,6 +52,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/observiq/ctimefmt v1.0.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect diff --git a/exporter/signalfxexporter/go.sum b/exporter/signalfxexporter/go.sum index 0fd03d62a6bc9..4eef19615af71 100644 --- a/exporter/signalfxexporter/go.sum +++ b/exporter/signalfxexporter/go.sum @@ -660,6 +660,7 @@ github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfy github.com/Microsoft/hcsshim v0.9.7/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= +github.com/Mottl/ctimefmt v0.0.0-20190803144728-fd2ac23a585a/go.mod h1:eyj2WSIdoPMPs2eNTLpSmM6Nzqo4V80/d6jHpnJ1SAI= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -1800,6 +1801,8 @@ github.com/nishanths/predeclared v0.2.1/go.mod h1:HvkGJcA3naj4lOwnFXFDkFxVtSqQMB github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/observiq/ctimefmt v1.0.0 h1:r7vTJ+Slkrt9fZ67mkf+mA6zAdR5nGIJRMTzkUyvilk= +github.com/observiq/ctimefmt v1.0.0/go.mod h1:mxi62//WbSpG/roCO1c6MqZ7zQTvjVtYheqHN3eOjvc= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= diff --git a/internal/coreinternal/go.mod b/internal/coreinternal/go.mod index 7d56f6f67fbdd..da049b9466a86 100644 --- a/internal/coreinternal/go.mod +++ b/internal/coreinternal/go.mod @@ -5,6 +5,7 @@ go 1.19 require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/docker/go-connections v0.4.0 + github.com/observiq/ctimefmt v1.0.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.79.0 github.com/stretchr/testify v1.8.4 github.com/testcontainers/testcontainers-go v0.20.1 diff --git a/internal/coreinternal/go.sum b/internal/coreinternal/go.sum index d6ecc43106184..38ba293514763 100644 --- a/internal/coreinternal/go.sum +++ b/internal/coreinternal/go.sum @@ -7,6 +7,7 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/hcsshim v0.9.7 h1:mKNHW/Xvv1aFH87Jb6ERDzXTJTLPlmzfZ28VBFD/bfg= +github.com/Mottl/ctimefmt v0.0.0-20190803144728-fd2ac23a585a/go.mod h1:eyj2WSIdoPMPs2eNTLpSmM6Nzqo4V80/d6jHpnJ1SAI= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -245,6 +246,8 @@ github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= +github.com/observiq/ctimefmt v1.0.0 h1:r7vTJ+Slkrt9fZ67mkf+mA6zAdR5nGIJRMTzkUyvilk= +github.com/observiq/ctimefmt v1.0.0/go.mod h1:mxi62//WbSpG/roCO1c6MqZ7zQTvjVtYheqHN3eOjvc= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= diff --git a/internal/coreinternal/timeutils/parser.go b/internal/coreinternal/timeutils/parser.go new file mode 100644 index 0000000000000..7645224025081 --- /dev/null +++ b/internal/coreinternal/timeutils/parser.go @@ -0,0 +1,104 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package timeutils // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/timeutils" + +import ( + "fmt" + "strings" + "time" + + strptime "github.com/observiq/ctimefmt" +) + +func ParseStrptime(layout string, value any, location *time.Location) (time.Time, error) { + goLayout, err := strptime.ToNative(layout) + if err != nil { + return time.Time{}, err + } + return ParseGotime(goLayout, value, location) +} + +func GetLocation(location *string, layout *string) (*time.Location, error) { + if location != nil && *location != "" { + // If location is specified, it must be in the local timezone database + loc, err := time.LoadLocation(*location) + if err != nil { + return nil, fmt.Errorf("failed to load location %s: %w", *location, err) + } + return loc, nil + } + + if layout != nil && strings.HasSuffix(*layout, "Z") { + // If a timestamp ends with 'Z', it should be interpreted at Zulu (UTC) time + return time.UTC, nil + } + + return time.Local, nil +} + +func ParseGotime(layout string, value any, location *time.Location) (time.Time, error) { + timeValue, err := parseGotime(layout, value, location) + if err != nil { + return time.Time{}, err + } + return SetTimestampYear(timeValue), nil +} + +func parseGotime(layout string, value interface{}, location *time.Location) (time.Time, error) { + var str string + switch v := value.(type) { + case string: + str = v + case []byte: + str = string(v) + default: + return time.Time{}, fmt.Errorf("type %T cannot be parsed as a time", value) + } + + result, err := time.ParseInLocation(layout, str, location) + + // Depending on the timezone database, we may get a pseudo-matching timezone + // This is apparent when the zone is not "UTC", but the offset is still 0 + zone, offset := result.Zone() + if offset != 0 || zone == "UTC" { + return result, err + } + + // Manually look up the location based on the zone + loc, locErr := time.LoadLocation(zone) + if locErr != nil { + // can't correct offset, just return what we have + return result, fmt.Errorf("failed to load location %s: %w", zone, locErr) + } + + // Reparse the timestamp, with the location + resultLoc, locErr := time.ParseInLocation(layout, str, loc) + if locErr != nil { + // can't correct offset, just return original result + return result, err + } + + return resultLoc, locErr +} + +// SetTimestampYear sets the year of a timestamp to the current year. +// This is needed because year is missing from some time formats, such as rfc3164. +func SetTimestampYear(t time.Time) time.Time { + if t.Year() > 0 { + return t + } + n := Now() + d := time.Date(n.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), t.Location()) + // Assume the timestamp is from last year if its month and day are + // more than 7 days past the current date. + // i.e. If today is January 1, but the timestamp is February 1, it's safe + // to assume the timestamp is from last year. + if d.After(n.AddDate(0, 0, 7)) { + d = d.AddDate(-1, 0, 0) + } + return d +} + +// Allows tests to override with deterministic value +var Now = time.Now diff --git a/internal/coreinternal/timeutils/parser_test.go b/internal/coreinternal/timeutils/parser_test.go new file mode 100644 index 0000000000000..7427a2e34d652 --- /dev/null +++ b/internal/coreinternal/timeutils/parser_test.go @@ -0,0 +1,63 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package timeutils + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" +) + +func TestParseGoTimeBadLocation(t *testing.T) { + _, err := ParseGotime(time.RFC822, "02 Jan 06 15:04 BST", time.UTC) + require.Error(t, err) + require.Contains(t, err.Error(), "failed to load location BST") +} + +func Test_setTimestampYear(t *testing.T) { + t.Run("Normal", func(t *testing.T) { + Now = func() time.Time { + return time.Date(2020, 06, 16, 3, 31, 34, 525, time.UTC) + } + + noYear := time.Date(0, 06, 16, 3, 31, 34, 525, time.UTC) + yearAdded := SetTimestampYear(noYear) + expected := time.Date(2020, 06, 16, 3, 31, 34, 525, time.UTC) + require.Equal(t, expected, yearAdded) + }) + + t.Run("FutureOneDay", func(t *testing.T) { + Now = func() time.Time { + return time.Date(2020, 01, 16, 3, 31, 34, 525, time.UTC) + } + + noYear := time.Date(0, 01, 17, 3, 31, 34, 525, time.UTC) + yearAdded := SetTimestampYear(noYear) + expected := time.Date(2020, 01, 17, 3, 31, 34, 525, time.UTC) + require.Equal(t, expected, yearAdded) + }) + + t.Run("FutureEightDays", func(t *testing.T) { + Now = func() time.Time { + return time.Date(2020, 01, 16, 3, 31, 34, 525, time.UTC) + } + + noYear := time.Date(0, 01, 24, 3, 31, 34, 525, time.UTC) + yearAdded := SetTimestampYear(noYear) + expected := time.Date(2019, 01, 24, 3, 31, 34, 525, time.UTC) + require.Equal(t, expected, yearAdded) + }) + + t.Run("RolloverYear", func(t *testing.T) { + Now = func() time.Time { + return time.Date(2020, 01, 01, 3, 31, 34, 525, time.UTC) + } + + noYear := time.Date(0, 12, 31, 3, 31, 34, 525, time.UTC) + yearAdded := SetTimestampYear(noYear) + expected := time.Date(2019, 12, 31, 3, 31, 34, 525, time.UTC) + require.Equal(t, expected, yearAdded) + }) +} diff --git a/pkg/stanza/operator/helper/time.go b/pkg/stanza/operator/helper/time.go index ac9e97dc330fd..07d672d632ac8 100644 --- a/pkg/stanza/operator/helper/time.go +++ b/pkg/stanza/operator/helper/time.go @@ -12,6 +12,7 @@ import ( strptime "github.com/observiq/ctimefmt" "go.opentelemetry.io/collector/confmap" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/timeutils" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/errors" ) @@ -147,19 +148,20 @@ func (t *TimeParser) Parse(entry *entry.Entry) error { if !ok { return fmt.Errorf("native time.Time field required, but found %v of type %T", value, value) } - entry.Timestamp = setTimestampYear(timeValue) + entry.Timestamp = timeutils.SetTimestampYear(timeValue) case GotimeKey: - timeValue, err := t.parseGotime(value) + timeValue, err := timeutils.ParseGotime(t.Layout, value, t.location) if err != nil { return err } - entry.Timestamp = setTimestampYear(timeValue) + // timeutils.ParseGotime calls timeutils.SetTimestampYear before returning the timeValue + entry.Timestamp = timeValue case EpochKey: timeValue, err := t.parseEpochTime(value) if err != nil { return err } - entry.Timestamp = setTimestampYear(timeValue) + entry.Timestamp = timeutils.SetTimestampYear(timeValue) default: return fmt.Errorf("unsupported layout type: %s", t.LayoutType) } @@ -167,43 +169,6 @@ func (t *TimeParser) Parse(entry *entry.Entry) error { return nil } -func (t *TimeParser) parseGotime(value interface{}) (time.Time, error) { - var str string - switch v := value.(type) { - case string: - str = v - case []byte: - str = string(v) - default: - return time.Time{}, fmt.Errorf("type %T cannot be parsed as a time", value) - } - - result, err := time.ParseInLocation(t.Layout, str, t.location) - - // Depending on the timezone database, we may get a pseudo-matching timezone - // This is apparent when the zone is not "UTC", but the offset is still 0 - zone, offset := result.Zone() - if offset != 0 || zone == "UTC" { - return result, err - } - - // Manually look up the location based on the zone - loc, locErr := time.LoadLocation(zone) - if locErr != nil { - // can't correct offset, just return what we have - return result, fmt.Errorf("failed to load location %s: %w", zone, locErr) - } - - // Reparse the timestamp, with the location - resultLoc, locErr := time.ParseInLocation(t.Layout, str, loc) - if locErr != nil { - // can't correct offset, just return original result - return result, err - } - - return resultLoc, locErr -} - func (t *TimeParser) parseEpochTime(value interface{}) (time.Time, error) { stamp, err := getEpochStamp(t.Layout, value) if err != nil { @@ -275,22 +240,3 @@ var toTime = map[string]toTimeFunc{ "ns": func(ns int64) time.Time { return time.Unix(0, ns) }, } var subsecToNs = map[string]int64{"s.ms": 1e6, "s.us": 1e3, "s.ns": 1} - -// setTimestampYear sets the year of a timestamp to the current year. -// This is needed because year is missing from some time formats, such as rfc3164. -func setTimestampYear(t time.Time) time.Time { - if t.Year() > 0 { - return t - } - n := now() - d := time.Date(n.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), t.Nanosecond(), t.Location()) - // If the timestamp would be more than 7 days in the future using this year, - // assume it's from last year. - if d.After(n.AddDate(0, 0, 7)) { - d = d.AddDate(-1, 0, 0) - } - return d -} - -// Allows tests to override with deterministic value -var now = time.Now diff --git a/pkg/stanza/operator/helper/time_test.go b/pkg/stanza/operator/helper/time_test.go index beaea81587573..447a08786ed80 100644 --- a/pkg/stanza/operator/helper/time_test.go +++ b/pkg/stanza/operator/helper/time_test.go @@ -11,56 +11,11 @@ import ( "github.com/stretchr/testify/require" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/timeutils" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/operatortest" ) -func Test_setTimestampYear(t *testing.T) { - t.Run("Normal", func(t *testing.T) { - now = func() time.Time { - return time.Date(2020, 06, 16, 3, 31, 34, 525, time.UTC) - } - - noYear := time.Date(0, 06, 16, 3, 31, 34, 525, time.UTC) - yearAdded := setTimestampYear(noYear) - expected := time.Date(2020, 06, 16, 3, 31, 34, 525, time.UTC) - require.Equal(t, expected, yearAdded) - }) - - t.Run("FutureOneDay", func(t *testing.T) { - now = func() time.Time { - return time.Date(2020, 01, 16, 3, 31, 34, 525, time.UTC) - } - - noYear := time.Date(0, 01, 17, 3, 31, 34, 525, time.UTC) - yearAdded := setTimestampYear(noYear) - expected := time.Date(2020, 01, 17, 3, 31, 34, 525, time.UTC) - require.Equal(t, expected, yearAdded) - }) - - t.Run("FutureEightDays", func(t *testing.T) { - now = func() time.Time { - return time.Date(2020, 01, 16, 3, 31, 34, 525, time.UTC) - } - - noYear := time.Date(0, 01, 24, 3, 31, 34, 525, time.UTC) - yearAdded := setTimestampYear(noYear) - expected := time.Date(2019, 01, 24, 3, 31, 34, 525, time.UTC) - require.Equal(t, expected, yearAdded) - }) - - t.Run("RolloverYear", func(t *testing.T) { - now = func() time.Time { - return time.Date(2020, 01, 01, 3, 31, 34, 525, time.UTC) - } - - noYear := time.Date(0, 12, 31, 3, 31, 34, 525, time.UTC) - yearAdded := setTimestampYear(noYear) - expected := time.Date(2019, 12, 31, 3, 31, 34, 525, time.UTC) - require.Equal(t, expected, yearAdded) - }) -} - func TestIsZero(t *testing.T) { require.True(t, (&TimeParser{}).IsZero()) require.False(t, (&TimeParser{Layout: "strptime"}).IsZero()) @@ -76,7 +31,7 @@ func TestTimeParser(t *testing.T) { require.NoError(t, err) // override with deterministic value - now = func() time.Time { return time.Date(2020, 12, 16, 17, 0, 0, 0, mst) } + timeutils.Now = func() time.Time { return time.Date(2020, 12, 16, 17, 0, 0, 0, mst) } testCases := []struct { name string @@ -125,14 +80,14 @@ func TestTimeParser(t *testing.T) { { name: "kitchen", sample: "12:34PM", - expected: time.Date(now().Year(), 1, 1, 12, 34, 0, 0, time.Local), + expected: time.Date(timeutils.Now().Year(), 1, 1, 12, 34, 0, 0, time.Local), gotimeLayout: time.Kitchen, strptimeLayout: "%H:%M%p", }, { name: "kitchen-utc", sample: "12:34PM", - expected: time.Date(now().Year(), 1, 1, 12, 34, 0, 0, time.UTC), + expected: time.Date(timeutils.Now().Year(), 1, 1, 12, 34, 0, 0, time.UTC), gotimeLayout: time.Kitchen, strptimeLayout: "%H:%M%p", location: time.UTC.String(), @@ -140,7 +95,7 @@ func TestTimeParser(t *testing.T) { { name: "kitchen-location", sample: "12:34PM", - expected: time.Date(now().Year(), 1, 1, 12, 34, 0, 0, hst), + expected: time.Date(timeutils.Now().Year(), 1, 1, 12, 34, 0, 0, hst), gotimeLayout: time.Kitchen, strptimeLayout: "%H:%M%p", location: hst.String(), @@ -148,21 +103,21 @@ func TestTimeParser(t *testing.T) { { name: "kitchen-bytes", sample: []byte("12:34PM"), - expected: time.Date(now().Year(), 1, 1, 12, 34, 0, 0, time.Local), + expected: time.Date(timeutils.Now().Year(), 1, 1, 12, 34, 0, 0, time.Local), gotimeLayout: time.Kitchen, strptimeLayout: "%H:%M%p", }, { name: "debian-syslog", sample: "Jun 09 11:39:45", - expected: time.Date(now().Year(), time.June, 9, 11, 39, 45, 0, time.Local), + expected: time.Date(timeutils.Now().Year(), time.June, 9, 11, 39, 45, 0, time.Local), gotimeLayout: "Jan 02 15:04:05", strptimeLayout: "%b %d %H:%M:%S", }, { name: "debian-syslog-utc", sample: "Jun 09 11:39:45", - expected: time.Date(now().Year(), time.June, 9, 11, 39, 45, 0, time.UTC), + expected: time.Date(timeutils.Now().Year(), time.June, 9, 11, 39, 45, 0, time.UTC), gotimeLayout: "Jan 02 15:04:05", strptimeLayout: "%b %d %H:%M:%S", location: time.UTC.String(), @@ -170,7 +125,7 @@ func TestTimeParser(t *testing.T) { { name: "debian-syslog-location", sample: "Jun 09 11:39:45", - expected: time.Date(now().Year(), time.June, 9, 11, 39, 45, 0, hst), + expected: time.Date(timeutils.Now().Year(), time.June, 9, 11, 39, 45, 0, hst), gotimeLayout: "Jan 02 15:04:05", strptimeLayout: "%b %d %H:%M:%S", location: hst.String(), @@ -282,7 +237,7 @@ func TestTimeParser(t *testing.T) { { name: "puppet", sample: "Aug 4 03:26:02", - expected: time.Date(now().Year(), time.August, 4, 3, 26, 02, 0, time.Local), + expected: time.Date(timeutils.Now().Year(), time.August, 4, 3, 26, 02, 0, time.Local), gotimeLayout: "Jan _2 15:04:05", strptimeLayout: "%b %e %H:%M:%S", }, @@ -618,19 +573,6 @@ func TestSetInvalidLocation(t *testing.T) { require.Contains(t, err.Error(), "failed to load location "+"not_a_location") } -func TestParseGoTimeBadLocation(t *testing.T) { - tp := NewTimeParser() - tp.Location = "America/New_York" - - err := tp.setLocation() - require.NoError(t, err) - - tp.Layout = time.RFC822 - _, err = tp.parseGotime("02 Jan 06 15:04 BST") - require.Error(t, err) - require.Contains(t, err.Error(), "failed to load location BST") -} - func TestUnmarshalTimeConfig(t *testing.T) { operatortest.ConfigUnmarshalTests{ DefaultConfig: newHelpersConfig(), diff --git a/processor/tailsamplingprocessor/go.mod b/processor/tailsamplingprocessor/go.mod index 8f9690e4925d1..88a311b3d2dc4 100644 --- a/processor/tailsamplingprocessor/go.mod +++ b/processor/tailsamplingprocessor/go.mod @@ -34,6 +34,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/observiq/ctimefmt v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/exporter v0.79.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0012 // indirect diff --git a/processor/tailsamplingprocessor/go.sum b/processor/tailsamplingprocessor/go.sum index acd18962b161d..b012cb987cf3f 100644 --- a/processor/tailsamplingprocessor/go.sum +++ b/processor/tailsamplingprocessor/go.sum @@ -2,6 +2,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Mottl/ctimefmt v0.0.0-20190803144728-fd2ac23a585a/go.mod h1:eyj2WSIdoPMPs2eNTLpSmM6Nzqo4V80/d6jHpnJ1SAI= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= github.com/alecthomas/participle/v2 v2.0.0 h1:Fgrq+MbuSsJwIkw3fEj9h75vDP0Er5JzepJ0/HNHv0g= github.com/alecthomas/participle/v2 v2.0.0/go.mod h1:rAKZdJldHu8084ojcWevWAL8KmEU+AT+Olodb+WoN2Y= @@ -216,6 +217,8 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= +github.com/observiq/ctimefmt v1.0.0 h1:r7vTJ+Slkrt9fZ67mkf+mA6zAdR5nGIJRMTzkUyvilk= +github.com/observiq/ctimefmt v1.0.0/go.mod h1:mxi62//WbSpG/roCO1c6MqZ7zQTvjVtYheqHN3eOjvc= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= diff --git a/receiver/signalfxreceiver/go.mod b/receiver/signalfxreceiver/go.mod index 03a3e0a6e2bd7..4c29ed81d10b9 100644 --- a/receiver/signalfxreceiver/go.mod +++ b/receiver/signalfxreceiver/go.mod @@ -51,6 +51,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/observiq/ctimefmt v1.0.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.79.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.79.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.79.0 // indirect diff --git a/receiver/signalfxreceiver/go.sum b/receiver/signalfxreceiver/go.sum index 985cbcfb41ce5..496edf8e436d8 100644 --- a/receiver/signalfxreceiver/go.sum +++ b/receiver/signalfxreceiver/go.sum @@ -660,6 +660,7 @@ github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfy github.com/Microsoft/hcsshim v0.9.7/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= +github.com/Mottl/ctimefmt v0.0.0-20190803144728-fd2ac23a585a/go.mod h1:eyj2WSIdoPMPs2eNTLpSmM6Nzqo4V80/d6jHpnJ1SAI= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -1800,6 +1801,8 @@ github.com/nishanths/predeclared v0.2.1/go.mod h1:HvkGJcA3naj4lOwnFXFDkFxVtSqQMB github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/observiq/ctimefmt v1.0.0 h1:r7vTJ+Slkrt9fZ67mkf+mA6zAdR5nGIJRMTzkUyvilk= +github.com/observiq/ctimefmt v1.0.0/go.mod h1:mxi62//WbSpG/roCO1c6MqZ7zQTvjVtYheqHN3eOjvc= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= diff --git a/testbed/go.mod b/testbed/go.mod index 57aaea10de3b6..d5c3e8289dd0b 100644 --- a/testbed/go.mod +++ b/testbed/go.mod @@ -160,6 +160,7 @@ require ( github.com/mostynb/go-grpc-compression v1.1.18 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect + github.com/observiq/ctimefmt v1.0.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.79.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.79.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.79.0 // indirect diff --git a/testbed/go.sum b/testbed/go.sum index fe04073fc78ec..8031f35455865 100644 --- a/testbed/go.sum +++ b/testbed/go.sum @@ -690,6 +690,7 @@ github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfy github.com/Microsoft/hcsshim v0.9.7/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= +github.com/Mottl/ctimefmt v0.0.0-20190803144728-fd2ac23a585a/go.mod h1:eyj2WSIdoPMPs2eNTLpSmM6Nzqo4V80/d6jHpnJ1SAI= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -1956,6 +1957,8 @@ github.com/nishanths/predeclared v0.2.1/go.mod h1:HvkGJcA3naj4lOwnFXFDkFxVtSqQMB github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/observiq/ctimefmt v1.0.0 h1:r7vTJ+Slkrt9fZ67mkf+mA6zAdR5nGIJRMTzkUyvilk= +github.com/observiq/ctimefmt v1.0.0/go.mod h1:mxi62//WbSpG/roCO1c6MqZ7zQTvjVtYheqHN3eOjvc= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=