From 4bdf011465bf2ce8d971cbfb2591544308be5ab6 Mon Sep 17 00:00:00 2001 From: Faith Chikwekwe Date: Fri, 26 May 2023 05:58:20 -0400 Subject: [PATCH 1/5] Move core time parsing capabilities to coreinternal --- .chloggen/main.yaml | 20 ++++ exporter/signalfxexporter/go.mod | 1 + exporter/signalfxexporter/go.sum | 3 + internal/coreinternal/go.mod | 1 + internal/coreinternal/go.sum | 3 + internal/coreinternal/timeutils/parser.go | 98 +++++++++++++++++++ .../coreinternal/timeutils/parser_test.go | 63 ++++++++++++ pkg/stanza/go.mod | 2 +- pkg/stanza/operator/helper/time.go | 68 ++----------- pkg/stanza/operator/helper/time_test.go | 78 ++------------- processor/tailsamplingprocessor/go.mod | 1 + processor/tailsamplingprocessor/go.sum | 3 + receiver/signalfxreceiver/go.mod | 1 + receiver/signalfxreceiver/go.sum | 3 + testbed/go.mod | 1 + testbed/go.sum | 3 + 16 files changed, 218 insertions(+), 131 deletions(-) create mode 100755 .chloggen/main.yaml create mode 100644 internal/coreinternal/timeutils/parser.go create mode 100644 internal/coreinternal/timeutils/parser_test.go diff --git a/.chloggen/main.yaml b/.chloggen/main.yaml new file mode 100755 index 0000000000000..4c37f894fd3d6 --- /dev/null +++ b/.chloggen/main.yaml @@ -0,0 +1,20 @@ +# Use this changelog template to create an entry for release notes. +# If your change doesn't affect end users, such as a test fix or a tooling change, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'enhancement' + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: 'pkg/ottl' + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Adds new `Time` converter to convert a string to a Golang time struct based on a supplied format" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [22007] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: 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..31fafc00b684c --- /dev/null +++ b/internal/coreinternal/timeutils/parser.go @@ -0,0 +1,98 @@ +// 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 StrptimeToGo(layout string) (string, error) { + return strptime.ToNative(layout) +} + +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 interpretted 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()) + // 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/internal/coreinternal/timeutils/parser_test.go b/internal/coreinternal/timeutils/parser_test.go new file mode 100644 index 0000000000000..4f8bbe34b0c46 --- /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/go.mod b/pkg/stanza/go.mod index 0f34f26c9f282..9da61832c782e 100644 --- a/pkg/stanza/go.mod +++ b/pkg/stanza/go.mod @@ -9,7 +9,6 @@ require ( github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6 github.com/jpillora/backoff v1.0.0 github.com/json-iterator/go v1.1.12 - github.com/observiq/ctimefmt v1.0.0 github.com/observiq/nanojack v0.0.0-20201106172433-343928847ebc github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.79.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.79.0 @@ -43,6 +42,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 github.com/stretchr/objx v0.5.0 // indirect go.opencensus.io v0.24.0 // indirect diff --git a/pkg/stanza/operator/helper/time.go b/pkg/stanza/operator/helper/time.go index ac9e97dc330fd..dc68a65214da9 100644 --- a/pkg/stanza/operator/helper/time.go +++ b/pkg/stanza/operator/helper/time.go @@ -9,9 +9,9 @@ import ( "strings" "time" - 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" ) @@ -79,7 +79,7 @@ func (t *TimeParser) Validate() error { case NativeKey, GotimeKey: // ok case StrptimeKey: var err error - t.Layout, err = strptime.ToNative(t.Layout) + t.Layout, err = timeutils.StrptimeToGo(t.Layout) if err != nil { return errors.Wrap(err, "parse strptime layout") } @@ -147,19 +147,19 @@ 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) + 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 +167,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 +238,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= From 305bb447202dc9a64ced261558dec09f2e61c416 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 8 Jun 2023 13:43:01 -0600 Subject: [PATCH 2/5] Add clarifying comment --- pkg/stanza/operator/helper/time.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/stanza/operator/helper/time.go b/pkg/stanza/operator/helper/time.go index dc68a65214da9..e348ab3a54f8b 100644 --- a/pkg/stanza/operator/helper/time.go +++ b/pkg/stanza/operator/helper/time.go @@ -153,6 +153,7 @@ func (t *TimeParser) Parse(entry *entry.Entry) error { if err != nil { return err } + // timeutils.ParseGoTime calls timeutils.SetTimestampYear before returning the timeValue entry.Timestamp = timeValue case EpochKey: timeValue, err := t.parseEpochTime(value) From 7b45c7608d2dc34aa4b5d4fb0fb1d9bf56f841d4 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 8 Jun 2023 14:40:01 -0600 Subject: [PATCH 3/5] Apply suggestions from code review Co-authored-by: Curtis Robert <92119472+crobert-1@users.noreply.github.com> --- internal/coreinternal/timeutils/parser.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/coreinternal/timeutils/parser.go b/internal/coreinternal/timeutils/parser.go index 31fafc00b684c..72f9293941ad9 100644 --- a/internal/coreinternal/timeutils/parser.go +++ b/internal/coreinternal/timeutils/parser.go @@ -17,7 +17,7 @@ func StrptimeToGo(layout string) (string, error) { 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 + // 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) @@ -26,7 +26,7 @@ func GetLocation(location *string, layout *string) (*time.Location, error) { } if layout != nil && strings.HasSuffix(*layout, "Z") { - // If a timestamp ends with 'Z', it should be interpretted at Zulu (UTC) time + // If a timestamp ends with 'Z', it should be interpreted at Zulu (UTC) time return time.UTC, nil } @@ -86,8 +86,10 @@ func SetTimestampYear(t time.Time) time.Time { } 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. + // 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) } From de266b61e952d89329af166fa104aac6b580c0e5 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Thu, 8 Jun 2023 14:41:02 -0600 Subject: [PATCH 4/5] Replace StrptimeToGo with ParseStrptime --- internal/coreinternal/timeutils/parser.go | 10 +++++++--- internal/coreinternal/timeutils/parser_test.go | 2 +- pkg/stanza/go.mod | 2 +- pkg/stanza/operator/helper/time.go | 7 ++++--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/internal/coreinternal/timeutils/parser.go b/internal/coreinternal/timeutils/parser.go index 72f9293941ad9..7645224025081 100644 --- a/internal/coreinternal/timeutils/parser.go +++ b/internal/coreinternal/timeutils/parser.go @@ -11,8 +11,12 @@ import ( strptime "github.com/observiq/ctimefmt" ) -func StrptimeToGo(layout string) (string, error) { - return strptime.ToNative(layout) +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) { @@ -33,7 +37,7 @@ func GetLocation(location *string, layout *string) (*time.Location, error) { return time.Local, nil } -func ParseGoTime(layout string, value any, location *time.Location) (time.Time, error) { +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 diff --git a/internal/coreinternal/timeutils/parser_test.go b/internal/coreinternal/timeutils/parser_test.go index 4f8bbe34b0c46..7427a2e34d652 100644 --- a/internal/coreinternal/timeutils/parser_test.go +++ b/internal/coreinternal/timeutils/parser_test.go @@ -11,7 +11,7 @@ import ( ) func TestParseGoTimeBadLocation(t *testing.T) { - _, err := ParseGoTime(time.RFC822, "02 Jan 06 15:04 BST", time.UTC) + _, 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") } diff --git a/pkg/stanza/go.mod b/pkg/stanza/go.mod index 9da61832c782e..0f34f26c9f282 100644 --- a/pkg/stanza/go.mod +++ b/pkg/stanza/go.mod @@ -9,6 +9,7 @@ require ( github.com/influxdata/go-syslog/v3 v3.0.1-0.20210608084020-ac565dc76ba6 github.com/jpillora/backoff v1.0.0 github.com/json-iterator/go v1.1.12 + github.com/observiq/ctimefmt v1.0.0 github.com/observiq/nanojack v0.0.0-20201106172433-343928847ebc github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.79.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.79.0 @@ -42,7 +43,6 @@ 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 github.com/stretchr/objx v0.5.0 // indirect go.opencensus.io v0.24.0 // indirect diff --git a/pkg/stanza/operator/helper/time.go b/pkg/stanza/operator/helper/time.go index e348ab3a54f8b..07d672d632ac8 100644 --- a/pkg/stanza/operator/helper/time.go +++ b/pkg/stanza/operator/helper/time.go @@ -9,6 +9,7 @@ import ( "strings" "time" + strptime "github.com/observiq/ctimefmt" "go.opentelemetry.io/collector/confmap" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/timeutils" @@ -79,7 +80,7 @@ func (t *TimeParser) Validate() error { case NativeKey, GotimeKey: // ok case StrptimeKey: var err error - t.Layout, err = timeutils.StrptimeToGo(t.Layout) + t.Layout, err = strptime.ToNative(t.Layout) if err != nil { return errors.Wrap(err, "parse strptime layout") } @@ -149,11 +150,11 @@ func (t *TimeParser) Parse(entry *entry.Entry) error { } entry.Timestamp = timeutils.SetTimestampYear(timeValue) case GotimeKey: - timeValue, err := timeutils.ParseGoTime(t.Layout, value, t.location) + timeValue, err := timeutils.ParseGotime(t.Layout, value, t.location) if err != nil { return err } - // timeutils.ParseGoTime calls timeutils.SetTimestampYear before returning the timeValue + // timeutils.ParseGotime calls timeutils.SetTimestampYear before returning the timeValue entry.Timestamp = timeValue case EpochKey: timeValue, err := t.parseEpochTime(value) From 813d123e41dd805f25287f58f731d69e60bfea60 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Fri, 9 Jun 2023 10:14:44 -0600 Subject: [PATCH 5/5] remove changelog --- .chloggen/main.yaml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100755 .chloggen/main.yaml diff --git a/.chloggen/main.yaml b/.chloggen/main.yaml deleted file mode 100755 index 4c37f894fd3d6..0000000000000 --- a/.chloggen/main.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Use this changelog template to create an entry for release notes. -# If your change doesn't affect end users, such as a test fix or a tooling change, -# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. - -# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' -change_type: 'enhancement' - -# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) -component: 'pkg/ottl' - -# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: "Adds new `Time` converter to convert a string to a Golang time struct based on a supplied format" - -# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. -issues: [22007] - -# (Optional) One or more lines of additional information to render under the primary note. -# These lines will be padded with 2 spaces and then inserted directly into the document. -# Use pipe (|) for multiline entries. -subtext: