From 7a00beb19ee49f2aae009e407ff621399302133a Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 19 Sep 2023 10:54:19 -0400 Subject: [PATCH 01/43] feat: add honeycomb marker exporter structure --- exporter/honeycombmarkerexporter/Makefile | 1 + exporter/honeycombmarkerexporter/config.go | 35 ++++++++++++ .../honeycombmarkerexporter/config_test.go | 55 +++++++++++++++++++ exporter/honeycombmarkerexporter/factory.go | 51 +++++++++++++++++ .../honeycombmarkerexporter/factory_test.go | 36 ++++++++++++ .../internal/logs_exporter.go | 36 ++++++++++++ .../internal/metadata.yaml | 7 +++ .../testdata/config.yaml | 5 ++ versions.yaml | 1 + 9 files changed, 227 insertions(+) create mode 100644 exporter/honeycombmarkerexporter/Makefile create mode 100644 exporter/honeycombmarkerexporter/config.go create mode 100644 exporter/honeycombmarkerexporter/config_test.go create mode 100644 exporter/honeycombmarkerexporter/factory.go create mode 100644 exporter/honeycombmarkerexporter/factory_test.go create mode 100644 exporter/honeycombmarkerexporter/internal/logs_exporter.go create mode 100644 exporter/honeycombmarkerexporter/internal/metadata.yaml create mode 100644 exporter/honeycombmarkerexporter/testdata/config.yaml diff --git a/exporter/honeycombmarkerexporter/Makefile b/exporter/honeycombmarkerexporter/Makefile new file mode 100644 index 000000000000..ded7a36092dc --- /dev/null +++ b/exporter/honeycombmarkerexporter/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/exporter/honeycombmarkerexporter/config.go b/exporter/honeycombmarkerexporter/config.go new file mode 100644 index 000000000000..5f7923e5e1f2 --- /dev/null +++ b/exporter/honeycombmarkerexporter/config.go @@ -0,0 +1,35 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package honeycombexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter" + +import ( + "fmt" + + "go.opentelemetry.io/collector/component" +) + +// Config defines configuration for the Honeycomb Marker exporter. +type Config struct { + APIKey string `mapstructure:"api_key"` + APIURL string `mapstructure:"api_url"` + Presets presets `mapstructure:"presets"` +} + +type presets struct { + K8sEvents bool `mapstructure:"k8s_events"` +} + +func (cfg *Config) Validate() error { + if cfg.APIKey == "" { + return fmt.Errorf("invalid API Key") + } + + if cfg.APIURL == "" { + return fmt.Errorf("invalid URL") + } + + return nil +} + +var _ component.Config = (*Config)(nil) diff --git a/exporter/honeycombmarkerexporter/config_test.go b/exporter/honeycombmarkerexporter/config_test.go new file mode 100644 index 000000000000..b1e6e72aaeee --- /dev/null +++ b/exporter/honeycombmarkerexporter/config_test.go @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: Apache-2.0 + +package honeycombexporter + +import ( + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" +) + +func TestLoadConfig(t *testing.T) { + t.Parallel() + + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml")) + require.NoError(t, err) + + defaultCfg := CreateDefaultConfig() + + tests := []struct { + id component.ID + expected component.Config + }{ + + { + id: component.NewIDWithName("honeycomb", ""), + expected: defaultCfg, + }, + } + + for _, tt := range tests { + t.Run(tt.id.String(), func(t *testing.T) { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + + sub, err := cm.Sub(tt.id.String()) + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + assert.NoError(t, component.ValidateConfig(cfg)) + assert.Equal(t, tt.expected, cfg) + }) + } +} + +func withDefaultConfig(fns ...func(*Config)) *Config { + cfg := CreateDefaultConfig().(*Config) + for _, fn := range fns { + fn(cfg) + } + return cfg +} diff --git a/exporter/honeycombmarkerexporter/factory.go b/exporter/honeycombmarkerexporter/factory.go new file mode 100644 index 000000000000..7b4229921019 --- /dev/null +++ b/exporter/honeycombmarkerexporter/factory.go @@ -0,0 +1,51 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package honeycombexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterhelper" + + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter/internal/metadata" +) + +func NewFactory() exporter.Factory { + return exporter.NewFactory( + metadata.Type, + CreateDefaultConfig, + exporter.WithLogs(createLogsExporter, component.StabilityLevelDevelopment), + exporter.WithTraces(createTracesExporter, component.StabilityLevelDevelopment), + exporter.WithMetrics(createMetricsExporter, component.StabilityLevelDevelopment), + ) +} + +func CreateDefaultConfig() component.Config { + return &Config{ + APIKey: "", + APIURL: "", + Presets: true, + } +} + +func createLogsExporter( + ctx context.Context, + set exporter.CreateSettings, + cfg component.Config, +) (exporter.Logs, error) { + cf := cfg.(*Config) + + exporter := newLogsExporter(set.Logger, cf) + + return exporterhelper.NewLogsExporter( + ctx, + set, + cfg, + exporter.pushLogsData, + exporterhelper.WithStart(exporter.start), + exporterhelper.WithShutdown(exporter.shutdown), + ) +} diff --git a/exporter/honeycombmarkerexporter/factory_test.go b/exporter/honeycombmarkerexporter/factory_test.go new file mode 100644 index 000000000000..a1746d41988d --- /dev/null +++ b/exporter/honeycombmarkerexporter/factory_test.go @@ -0,0 +1,36 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package honeycombexporter + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/exporter/exportertest" +) + +const defaultURL = `https://api.example.com/v1` + +func TestCreateDefaultConfig(t *testing.T) { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + assert.NotNil(t, cfg, "failed to create default config") + assert.NoError(t, componenttest.CheckConfigStruct(cfg)) +} + +func TestFactory_CreateLogsExporter(t *testing.T) { + factory := NewFactory() + cfg := withDefaultConfig(func(cfg *Config) { + cfg.APIURL = defaultURL + }) + params := exportertest.NewNopCreateSettings() + exporter, err := factory.CreateLogsExporter(context.Background(), params, cfg) + require.NoError(t, err) + require.NotNil(t, exporter) + + require.NoError(t, exporter.Shutdown(context.TODO())) +} diff --git a/exporter/honeycombmarkerexporter/internal/logs_exporter.go b/exporter/honeycombmarkerexporter/internal/logs_exporter.go new file mode 100644 index 000000000000..c0f5a159bab4 --- /dev/null +++ b/exporter/honeycombmarkerexporter/internal/logs_exporter.go @@ -0,0 +1,36 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package honeycombexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pdata/plog" + "go.uber.org/zap" +) + +type honeycombLogsExporter struct { + logger *zap.Logger +} + +func newLogsExporter(logger *zap.Logger, _ *Config) *honeycombLogsExporter { + logsExp := &honeycombLogsExporter{ + logger: logger, + } + return logsExp +} + +func (e *honeycombLogsExporter) start(_ context.Context, _ component.Host) error { + + return nil +} + +func (e *honeycombLogsExporter) shutdown(_ context.Context) error { + return nil +} + +func (e *honeycombLogsExporter) pushLogsData(_ context.Context, _ plog.Logs) error { + return nil +} diff --git a/exporter/honeycombmarkerexporter/internal/metadata.yaml b/exporter/honeycombmarkerexporter/internal/metadata.yaml new file mode 100644 index 000000000000..b99b8c6186b8 --- /dev/null +++ b/exporter/honeycombmarkerexporter/internal/metadata.yaml @@ -0,0 +1,7 @@ +type: honeycomb + +status: + class: exporter + stability: + development: [logs] + distributions: [] \ No newline at end of file diff --git a/exporter/honeycombmarkerexporter/testdata/config.yaml b/exporter/honeycombmarkerexporter/testdata/config.yaml new file mode 100644 index 000000000000..7e6688cd8f14 --- /dev/null +++ b/exporter/honeycombmarkerexporter/testdata/config.yaml @@ -0,0 +1,5 @@ +honeycomb: + apikey: + apiurl: http://localhost:8080/ + presets: + diff --git a/versions.yaml b/versions.yaml index 9d2df0b06b52..f70f2a2c8db1 100644 --- a/versions.yaml +++ b/versions.yaml @@ -38,6 +38,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlemanagedprometheusexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudpubsubexporter + - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/influxdbexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/instanaexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter From c2d6549a7ca6b7c1bc795170486ee2b99c075f1b Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Thu, 21 Sep 2023 13:18:31 -0400 Subject: [PATCH 02/43] fix: remove start and stop --- exporter/honeycombmarkerexporter/factory.go | 6 ++---- .../{internal => }/logs_exporter.go | 12 +----------- 2 files changed, 3 insertions(+), 15 deletions(-) rename exporter/honeycombmarkerexporter/{internal => }/logs_exporter.go (62%) diff --git a/exporter/honeycombmarkerexporter/factory.go b/exporter/honeycombmarkerexporter/factory.go index 7b4229921019..a31f423b60fd 100644 --- a/exporter/honeycombmarkerexporter/factory.go +++ b/exporter/honeycombmarkerexporter/factory.go @@ -25,7 +25,7 @@ func NewFactory() exporter.Factory { func CreateDefaultConfig() component.Config { return &Config{ - APIKey: "", + APIKey: "", // default to prod APIURL: "", Presets: true, } @@ -44,8 +44,6 @@ func createLogsExporter( ctx, set, cfg, - exporter.pushLogsData, - exporterhelper.WithStart(exporter.start), - exporterhelper.WithShutdown(exporter.shutdown), + exporter.exportLogs, ) } diff --git a/exporter/honeycombmarkerexporter/internal/logs_exporter.go b/exporter/honeycombmarkerexporter/logs_exporter.go similarity index 62% rename from exporter/honeycombmarkerexporter/internal/logs_exporter.go rename to exporter/honeycombmarkerexporter/logs_exporter.go index c0f5a159bab4..e4f5a735e33d 100644 --- a/exporter/honeycombmarkerexporter/internal/logs_exporter.go +++ b/exporter/honeycombmarkerexporter/logs_exporter.go @@ -6,7 +6,6 @@ package honeycombexporter // import "github.com/open-telemetry/opentelemetry-col import ( "context" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/plog" "go.uber.org/zap" ) @@ -22,15 +21,6 @@ func newLogsExporter(logger *zap.Logger, _ *Config) *honeycombLogsExporter { return logsExp } -func (e *honeycombLogsExporter) start(_ context.Context, _ component.Host) error { - - return nil -} - -func (e *honeycombLogsExporter) shutdown(_ context.Context) error { - return nil -} - -func (e *honeycombLogsExporter) pushLogsData(_ context.Context, _ plog.Logs) error { +func (e *honeycombLogsExporter) exportLogs(_ context.Context, _ plog.Logs) error { return nil } From 3a213184f63b5444d2e3edaaa478e6512a231a46 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Mon, 25 Sep 2023 10:51:24 -0400 Subject: [PATCH 03/43] feat: add honeycomb marker exporter --- .github/CODEOWNERS | 1 + .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + .github/ISSUE_TEMPLATE/feature_request.yaml | 1 + .github/ISSUE_TEMPLATE/other.yaml | 1 + exporter/honeycombmarkerexporter/README.md | 19 +++++++++++++++++++ exporter/honeycombmarkerexporter/factory.go | 8 +++++--- 6 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 exporter/honeycombmarkerexporter/README.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a1e0f268eedb..d12cb35b0456 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -61,6 +61,7 @@ exporter/fileexporter/ @open-te exporter/googlecloudexporter/ @open-telemetry/collector-contrib-approvers @aabmass @dashpole @jsuereth @punya @damemi @psx95 exporter/googlecloudpubsubexporter/ @open-telemetry/collector-contrib-approvers @alexvanboxel exporter/googlemanagedprometheusexporter/ @open-telemetry/collector-contrib-approvers @aabmass @dashpole @jsuereth @punya @damemi @psx95 +exporter/honeycombexporter/ @open-telemetry/collector-contrib-approvers @fchikwekwe @TylerHelmuth exporter/influxdbexporter/ @open-telemetry/collector-contrib-approvers @jacobmarble exporter/instanaexporter/ @open-telemetry/collector-contrib-approvers @jpkrohling @hickeyma exporter/kafkaexporter/ @open-telemetry/collector-contrib-approvers @pavolloffay @MovieStoreGuy diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index ba8a7262457f..b6a308b95edd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -54,6 +54,7 @@ body: - exporter/googlecloud - exporter/googlecloudpubsub - exporter/googlemanagedprometheus + - exporter/honeycombexporter - exporter/influxdb - exporter/instana - exporter/kafka diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index ab4e48d597af..8631f48ee6c1 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -48,6 +48,7 @@ body: - exporter/googlecloud - exporter/googlecloudpubsub - exporter/googlemanagedprometheus + - exporter/honeycombexporter - exporter/influxdb - exporter/instana - exporter/kafka diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index fcedebf81983..646dc588d643 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -48,6 +48,7 @@ body: - exporter/googlecloud - exporter/googlecloudpubsub - exporter/googlemanagedprometheus + - exporter/honeycombexporter - exporter/influxdb - exporter/instana - exporter/kafka diff --git a/exporter/honeycombmarkerexporter/README.md b/exporter/honeycombmarkerexporter/README.md new file mode 100644 index 000000000000..989f2112a1c5 --- /dev/null +++ b/exporter/honeycombmarkerexporter/README.md @@ -0,0 +1,19 @@ +@@ -0,0 +1,18 @@ +# Honeycomb Marker Exporter + +This exporter supports sending creating markers and sending them to the Honeycomb Markers API. + +The following configuration options are supported: + +* `api_key` (Required): This is the API key (also called Write Key) for your Honeycomb account. +* `api_url` (Required): You can set the hostname to send marker data to. +* `presets` (Required): This exporter will only allow preset configurations to start. + Example: + +```yaml +exporters: + honeycomb: + api_key: "my-api-key" + api_url: "https://api.testhost.io" + presets: True +``` \ No newline at end of file diff --git a/exporter/honeycombmarkerexporter/factory.go b/exporter/honeycombmarkerexporter/factory.go index a31f423b60fd..96f3245f7346 100644 --- a/exporter/honeycombmarkerexporter/factory.go +++ b/exporter/honeycombmarkerexporter/factory.go @@ -25,9 +25,11 @@ func NewFactory() exporter.Factory { func CreateDefaultConfig() component.Config { return &Config{ - APIKey: "", // default to prod - APIURL: "", - Presets: true, + APIKey: "", + APIURL: "", + Presets: presets{ + K8sEvents: true, + }, } } From 8a1393f6b0938dd6b915ad6c9dae878c32e4c31e Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Mon, 25 Sep 2023 11:55:32 -0400 Subject: [PATCH 04/43] feat: add generated files for component --- exporter/honeycombmarkerexporter/doc.go | 7 +++++++ .../internal/metadata/generated_status.go | 12 ++++++++++++ .../{internal => }/metadata.yaml | 0 3 files changed, 19 insertions(+) create mode 100644 exporter/honeycombmarkerexporter/doc.go create mode 100644 exporter/honeycombmarkerexporter/internal/metadata/generated_status.go rename exporter/honeycombmarkerexporter/{internal => }/metadata.yaml (100%) diff --git a/exporter/honeycombmarkerexporter/doc.go b/exporter/honeycombmarkerexporter/doc.go new file mode 100644 index 000000000000..4d67c2f71e79 --- /dev/null +++ b/exporter/honeycombmarkerexporter/doc.go @@ -0,0 +1,7 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:generate mdatagen metadata.yaml + +// Package honeycombmarkerexporter exports marker data to Honeycomb. +package honeycombexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter" diff --git a/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go b/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go new file mode 100644 index 000000000000..7845d060b6f5 --- /dev/null +++ b/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go @@ -0,0 +1,12 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metadata + +import ( + "go.opentelemetry.io/collector/component" +) + +const ( + Type = "honeycomb" + LogsStability = component.StabilityLevelDevelopment +) diff --git a/exporter/honeycombmarkerexporter/internal/metadata.yaml b/exporter/honeycombmarkerexporter/metadata.yaml similarity index 100% rename from exporter/honeycombmarkerexporter/internal/metadata.yaml rename to exporter/honeycombmarkerexporter/metadata.yaml From a82ba30633bb0a5ce67894da4d99f132b72e9b24 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Mon, 25 Sep 2023 12:32:13 -0400 Subject: [PATCH 05/43] doc: add changelog --- .chloggen/feat_marker-exporter.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 .chloggen/feat_marker-exporter.yaml diff --git a/.chloggen/feat_marker-exporter.yaml b/.chloggen/feat_marker-exporter.yaml new file mode 100755 index 000000000000..b531cdf0dc1e --- /dev/null +++ b/.chloggen/feat_marker-exporter.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'new_component' + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: 'honeycombmarkerexporter' + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "This component will export markers to be consumed by the Honeycomb Markers API to highlight user events based initially on preset configurations." + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [26653] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] From 09a44385e8c6018dfaee45a594b2ef430da75860 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Fri, 29 Sep 2023 11:35:00 -0400 Subject: [PATCH 06/43] fix: remove presets and allow configurable markers and rules --- exporter/honeycombmarkerexporter/config.go | 38 ++++++++++++++++--- .../testdata/config.yaml | 7 +++- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/exporter/honeycombmarkerexporter/config.go b/exporter/honeycombmarkerexporter/config.go index 5f7923e5e1f2..55ed30154afd 100644 --- a/exporter/honeycombmarkerexporter/config.go +++ b/exporter/honeycombmarkerexporter/config.go @@ -11,13 +11,41 @@ import ( // Config defines configuration for the Honeycomb Marker exporter. type Config struct { - APIKey string `mapstructure:"api_key"` - APIURL string `mapstructure:"api_url"` - Presets presets `mapstructure:"presets"` + // APIKey is the authentication token associated with the Honeycomb account. + APIKey string `mapstructure:"api_key"` + + // API URL to use (defaults to https://api.honeycomb.io) + APIURL string `mapstructure:"api_url"` + + // Markers is the list of markers to create + Markers []marker `mapstructure:"markers"` } -type presets struct { - K8sEvents bool `mapstructure:"k8s_events"` +type marker struct { + // MarkerType defines the type of marker. Markers with the same type appear in Honeycomb with the same color + MarkerType string `mapstructure:"type"` + + // MarkerColor is the color of the marker. Will only be used if the MarkerType does not already exist. + MarkerColor string `mapstructure:"color"` + + // MessageField is the attribute that will be used as the message. + // If necessary the value will be converted to a string. + MessageField string `mapstructure:"message_field"` + + // UrlField is the attribute that will be used as the url. + // If necessary the value will be converted to a string. + UrlField string `mapstructure:"url_field"` + + // Rules are the OTTL rules that determine when a piece of telemetry should be turned into a Marker + Rules Rules `mapstructure:"rules"` +} + +type Rules struct { + // ResourceConditions is the list of ottlresource conditions that determine a match + ResourceConditions []string `mapstructure:"resource_conditions"` + + // LogConditions is the list of ottllog conditions that determine a match + LogConditions []string `mapstructure:"log_conditions"` } func (cfg *Config) Validate() error { diff --git a/exporter/honeycombmarkerexporter/testdata/config.yaml b/exporter/honeycombmarkerexporter/testdata/config.yaml index 7e6688cd8f14..d61019481e5e 100644 --- a/exporter/honeycombmarkerexporter/testdata/config.yaml +++ b/exporter/honeycombmarkerexporter/testdata/config.yaml @@ -1,5 +1,10 @@ honeycomb: apikey: apiurl: http://localhost:8080/ - presets: + markers: + { + markertype: "type1", + messagefield: "test message", + urlfield: "http://localhost:8080/", + rules: } From cdf882a5dbb03a9f4db5d06356457ffbfb0991a4 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Mon, 2 Oct 2023 11:43:05 -0400 Subject: [PATCH 07/43] fix: fix config examples and README to use configurable markers --- exporter/honeycombmarkerexporter/README.md | 33 +++++++++++++++++-- exporter/honeycombmarkerexporter/factory.go | 16 ++++++--- .../testdata/config.yaml | 16 ++++++--- 3 files changed, 54 insertions(+), 11 deletions(-) diff --git a/exporter/honeycombmarkerexporter/README.md b/exporter/honeycombmarkerexporter/README.md index 989f2112a1c5..96eb2e76e47d 100644 --- a/exporter/honeycombmarkerexporter/README.md +++ b/exporter/honeycombmarkerexporter/README.md @@ -7,7 +7,14 @@ The following configuration options are supported: * `api_key` (Required): This is the API key (also called Write Key) for your Honeycomb account. * `api_url` (Required): You can set the hostname to send marker data to. -* `presets` (Required): This exporter will only allow preset configurations to start. +* `markers` (Required): This specifies the exact configuration to create an event marker. + * `markertype`: Specifies the marker type. Markers with the same type will appear in the same color in Honeycomb. MarkerType or MarkerColor should be set. + * `markercolor`: Specifies the marker color. Will only be used if MarkerType is not set. + * `messagefield`: This is the attribute that will be used as the message. If necessary the value will be converted to a string. + * `urlfield`: This is the attribute that will be used as the url. If necessary the value will be converted to a string. + * `rules`: This is a list of OTTL rules that determine when to create an event marker. + * `resourceconditions`: A list of ottlresource conditions that determine a match + * `logconditions`: A list of ottllog conditions that determine a match Example: ```yaml @@ -15,5 +22,27 @@ exporters: honeycomb: api_key: "my-api-key" api_url: "https://api.testhost.io" - presets: True + markers: + - markertype: "fooType", + messagefield: "test message", + urlfield: "https://api.testhost.io", + rules: + - resourceconditions: + - "ResourceCondition1" + - "ResourceCondition2" + - logconditions: + - "LogCondition1" + - "LogCondition2" + - markertype: "barType", + messagefield: "another test message", + urlfield: "https://api.testhost.io", + rules: + - resourceconditions: + - "ResourceCondition1" + - "ResourceCondition2" + - logconditions: + - "LogCondition1" + - "LogCondition2" + + ``` \ No newline at end of file diff --git a/exporter/honeycombmarkerexporter/factory.go b/exporter/honeycombmarkerexporter/factory.go index 96f3245f7346..acf8efb5a0a3 100644 --- a/exporter/honeycombmarkerexporter/factory.go +++ b/exporter/honeycombmarkerexporter/factory.go @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper" - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter/internal/metadata" ) func NewFactory() exporter.Factory { @@ -18,8 +18,6 @@ func NewFactory() exporter.Factory { metadata.Type, CreateDefaultConfig, exporter.WithLogs(createLogsExporter, component.StabilityLevelDevelopment), - exporter.WithTraces(createTracesExporter, component.StabilityLevelDevelopment), - exporter.WithMetrics(createMetricsExporter, component.StabilityLevelDevelopment), ) } @@ -27,8 +25,16 @@ func CreateDefaultConfig() component.Config { return &Config{ APIKey: "", APIURL: "", - Presets: presets{ - K8sEvents: true, + Markers: []marker{ + { + MarkerType: "", + MessageField: "", + UrlField: "", + Rules: Rules{ + ResourceConditions: []string{}, + LogConditions: []string{}, + }, + }, }, } } diff --git a/exporter/honeycombmarkerexporter/testdata/config.yaml b/exporter/honeycombmarkerexporter/testdata/config.yaml index d61019481e5e..743c2fdc7e7f 100644 --- a/exporter/honeycombmarkerexporter/testdata/config.yaml +++ b/exporter/honeycombmarkerexporter/testdata/config.yaml @@ -2,9 +2,17 @@ honeycomb: apikey: apiurl: http://localhost:8080/ markers: - { - markertype: "type1", + - markertype: "type1", messagefield: "test message", urlfield: "http://localhost:8080/", - rules: } - + rules: + - resourceconditions: + - "ResourceCondition1" + - "ResourceCondition2" + - logconditions: + - "LogCondition1" + - "LogCondition2" + - markertype: "type2", + messagefield: "another test message", + urlfield: "http://localhost:8080/", + rules: From 537b227536746dca3f6b7e630e88c8e351b0ef18 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 3 Oct 2023 11:49:37 -0400 Subject: [PATCH 08/43] fix: parse logs through transform processor parser funcs --- exporter/common/config.go | 37 ++++ exporter/common/functions.go | 19 ++ exporter/common/logs.go | 117 +++++++++++ exporter/common/metrics.go | 225 +++++++++++++++++++++ exporter/common/processor.go | 164 +++++++++++++++ exporter/common/traces.go | 167 +++++++++++++++ exporter/functions.go | 15 ++ exporter/honeycombmarkerexporter/config.go | 29 +++ 8 files changed, 773 insertions(+) create mode 100644 exporter/common/config.go create mode 100644 exporter/common/functions.go create mode 100644 exporter/common/logs.go create mode 100644 exporter/common/metrics.go create mode 100644 exporter/common/processor.go create mode 100644 exporter/common/traces.go create mode 100644 exporter/functions.go diff --git a/exporter/common/config.go b/exporter/common/config.go new file mode 100644 index 000000000000..2747ac11d4db --- /dev/null +++ b/exporter/common/config.go @@ -0,0 +1,37 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" + +import ( + "fmt" + "strings" +) + +type ContextID string + +const ( + Resource ContextID = "resource" + Scope ContextID = "scope" + Span ContextID = "span" + SpanEvent ContextID = "spanevent" + Metric ContextID = "metric" + DataPoint ContextID = "datapoint" + Log ContextID = "log" +) + +func (c *ContextID) UnmarshalText(text []byte) error { + str := ContextID(strings.ToLower(string(text))) + switch str { + case Resource, Scope, Span, SpanEvent, Metric, DataPoint, Log: + *c = str + return nil + default: + return fmt.Errorf("unknown context %v", str) + } +} + +type ContextStatements struct { + Context ContextID `mapstructure:"context"` + Statements []string `mapstructure:"statements"` +} diff --git a/exporter/common/functions.go b/exporter/common/functions.go new file mode 100644 index 000000000000..2d0a02b06102 --- /dev/null +++ b/exporter/common/functions.go @@ -0,0 +1,19 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" + +import ( + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlresource" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottlfuncs" +) + +func ResourceFunctions() map[string]ottl.Factory[ottlresource.TransformContext] { + return ottlfuncs.StandardFuncs[ottlresource.TransformContext]() +} + +func ScopeFunctions() map[string]ottl.Factory[ottlscope.TransformContext] { + return ottlfuncs.StandardFuncs[ottlscope.TransformContext]() +} diff --git a/exporter/common/logs.go b/exporter/common/logs.go new file mode 100644 index 000000000000..7af9031d5011 --- /dev/null +++ b/exporter/common/logs.go @@ -0,0 +1,117 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/plog" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottllog" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlresource" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope" +) + +var _ consumer.Logs = &logStatements{} + +type logStatements struct { + ottl.Statements[ottllog.TransformContext] +} + +func (l logStatements) Capabilities() consumer.Capabilities { + return consumer.Capabilities{ + MutatesData: true, + } +} + +func (l logStatements) ConsumeLogs(ctx context.Context, ld plog.Logs) error { + for i := 0; i < ld.ResourceLogs().Len(); i++ { + rlogs := ld.ResourceLogs().At(i) + for j := 0; j < rlogs.ScopeLogs().Len(); j++ { + slogs := rlogs.ScopeLogs().At(j) + logs := slogs.LogRecords() + for k := 0; k < logs.Len(); k++ { + tCtx := ottllog.NewTransformContext(logs.At(k), slogs.Scope(), rlogs.Resource()) + err := l.Execute(ctx, tCtx) + if err != nil { + return err + } + } + } + } + return nil +} + +type LogParserCollection struct { + parserCollection + logParser ottl.Parser[ottllog.TransformContext] +} + +type LogParserCollectionOption func(*LogParserCollection) error + +func WithLogParser(functions map[string]ottl.Factory[ottllog.TransformContext]) LogParserCollectionOption { + return func(lp *LogParserCollection) error { + logParser, err := ottllog.NewParser(functions, lp.settings) + if err != nil { + return err + } + lp.logParser = logParser + return nil + } +} + +func WithLogErrorMode(errorMode ottl.ErrorMode) LogParserCollectionOption { + return func(lp *LogParserCollection) error { + lp.errorMode = errorMode + return nil + } +} + +func NewLogParserCollection(settings component.TelemetrySettings, options ...LogParserCollectionOption) (*LogParserCollection, error) { + rp, err := ottlresource.NewParser(ResourceFunctions(), settings) + if err != nil { + return nil, err + } + sp, err := ottlscope.NewParser(ScopeFunctions(), settings) + if err != nil { + return nil, err + } + lpc := &LogParserCollection{ + parserCollection: parserCollection{ + settings: settings, + resourceParser: rp, + scopeParser: sp, + }, + } + + for _, op := range options { + err := op(lpc) + if err != nil { + return nil, err + } + } + + return lpc, nil +} + +func (pc LogParserCollection) ParseContextStatements(contextStatements ContextStatements) (consumer.Logs, error) { + switch contextStatements.Context { + case Log: + parsedStatements, err := pc.logParser.ParseStatements(contextStatements.Statements) + if err != nil { + return nil, err + } + lStatements := ottllog.NewStatements(parsedStatements, pc.settings, ottllog.WithErrorMode(pc.errorMode)) + return logStatements{lStatements}, nil + default: + statements, err := pc.parseCommonContextStatements(contextStatements) + if err != nil { + return nil, err + } + return statements, nil + } +} diff --git a/exporter/common/metrics.go b/exporter/common/metrics.go new file mode 100644 index 000000000000..becce3132cae --- /dev/null +++ b/exporter/common/metrics.go @@ -0,0 +1,225 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/pmetric" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottldatapoint" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlmetric" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlresource" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope" +) + +var _ consumer.Metrics = &metricStatements{} + +type metricStatements struct { + ottl.Statements[ottlmetric.TransformContext] +} + +func (m metricStatements) Capabilities() consumer.Capabilities { + return consumer.Capabilities{ + MutatesData: true, + } +} + +func (m metricStatements) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { + for i := 0; i < md.ResourceMetrics().Len(); i++ { + rmetrics := md.ResourceMetrics().At(i) + for j := 0; j < rmetrics.ScopeMetrics().Len(); j++ { + smetrics := rmetrics.ScopeMetrics().At(j) + metrics := smetrics.Metrics() + for k := 0; k < metrics.Len(); k++ { + tCtx := ottlmetric.NewTransformContext(metrics.At(k), smetrics.Metrics(), smetrics.Scope(), rmetrics.Resource()) + err := m.Execute(ctx, tCtx) + if err != nil { + return err + } + } + } + } + return nil +} + +var _ consumer.Metrics = &dataPointStatements{} + +type dataPointStatements struct { + ottl.Statements[ottldatapoint.TransformContext] +} + +func (d dataPointStatements) Capabilities() consumer.Capabilities { + return consumer.Capabilities{ + MutatesData: true, + } +} + +func (d dataPointStatements) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { + for i := 0; i < md.ResourceMetrics().Len(); i++ { + rmetrics := md.ResourceMetrics().At(i) + for j := 0; j < rmetrics.ScopeMetrics().Len(); j++ { + smetrics := rmetrics.ScopeMetrics().At(j) + metrics := smetrics.Metrics() + for k := 0; k < metrics.Len(); k++ { + metric := metrics.At(k) + var err error + //exhaustive:enforce + switch metric.Type() { + case pmetric.MetricTypeSum: + err = d.handleNumberDataPoints(ctx, metric.Sum().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource()) + case pmetric.MetricTypeGauge: + err = d.handleNumberDataPoints(ctx, metric.Gauge().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource()) + case pmetric.MetricTypeHistogram: + err = d.handleHistogramDataPoints(ctx, metric.Histogram().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource()) + case pmetric.MetricTypeExponentialHistogram: + err = d.handleExponetialHistogramDataPoints(ctx, metric.ExponentialHistogram().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource()) + case pmetric.MetricTypeSummary: + err = d.handleSummaryDataPoints(ctx, metric.Summary().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource()) + } + if err != nil { + return err + } + } + } + } + return nil +} + +func (d dataPointStatements) handleNumberDataPoints(ctx context.Context, dps pmetric.NumberDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error { + for i := 0; i < dps.Len(); i++ { + tCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, metrics, is, resource) + err := d.Execute(ctx, tCtx) + if err != nil { + return err + } + } + return nil +} + +func (d dataPointStatements) handleHistogramDataPoints(ctx context.Context, dps pmetric.HistogramDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error { + for i := 0; i < dps.Len(); i++ { + tCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, metrics, is, resource) + err := d.Execute(ctx, tCtx) + if err != nil { + return err + } + } + return nil +} + +func (d dataPointStatements) handleExponetialHistogramDataPoints(ctx context.Context, dps pmetric.ExponentialHistogramDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error { + for i := 0; i < dps.Len(); i++ { + tCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, metrics, is, resource) + err := d.Execute(ctx, tCtx) + if err != nil { + return err + } + } + return nil +} + +func (d dataPointStatements) handleSummaryDataPoints(ctx context.Context, dps pmetric.SummaryDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error { + for i := 0; i < dps.Len(); i++ { + tCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, metrics, is, resource) + err := d.Execute(ctx, tCtx) + if err != nil { + return err + } + } + return nil +} + +type MetricParserCollection struct { + parserCollection + metricParser ottl.Parser[ottlmetric.TransformContext] + dataPointParser ottl.Parser[ottldatapoint.TransformContext] +} + +type MetricParserCollectionOption func(*MetricParserCollection) error + +func WithMetricParser(functions map[string]ottl.Factory[ottlmetric.TransformContext]) MetricParserCollectionOption { + return func(mp *MetricParserCollection) error { + metricParser, err := ottlmetric.NewParser(functions, mp.settings) + if err != nil { + return err + } + mp.metricParser = metricParser + return nil + } +} + +func WithDataPointParser(functions map[string]ottl.Factory[ottldatapoint.TransformContext]) MetricParserCollectionOption { + return func(mp *MetricParserCollection) error { + dataPointParser, err := ottldatapoint.NewParser(functions, mp.settings) + if err != nil { + return err + } + mp.dataPointParser = dataPointParser + return nil + } +} + +func WithMetricErrorMode(errorMode ottl.ErrorMode) MetricParserCollectionOption { + return func(mp *MetricParserCollection) error { + mp.errorMode = errorMode + return nil + } +} + +func NewMetricParserCollection(settings component.TelemetrySettings, options ...MetricParserCollectionOption) (*MetricParserCollection, error) { + rp, err := ottlresource.NewParser(ResourceFunctions(), settings) + if err != nil { + return nil, err + } + sp, err := ottlscope.NewParser(ScopeFunctions(), settings) + if err != nil { + return nil, err + } + mpc := &MetricParserCollection{ + parserCollection: parserCollection{ + settings: settings, + resourceParser: rp, + scopeParser: sp, + }, + } + + for _, op := range options { + err := op(mpc) + if err != nil { + return nil, err + } + } + + return mpc, nil +} + +func (pc MetricParserCollection) ParseContextStatements(contextStatements ContextStatements) (consumer.Metrics, error) { + switch contextStatements.Context { + case Metric: + parseStatements, err := pc.metricParser.ParseStatements(contextStatements.Statements) + if err != nil { + return nil, err + } + mStatements := ottlmetric.NewStatements(parseStatements, pc.settings, ottlmetric.WithErrorMode(pc.errorMode)) + return metricStatements{mStatements}, nil + case DataPoint: + parsedStatements, err := pc.dataPointParser.ParseStatements(contextStatements.Statements) + if err != nil { + return nil, err + } + dpStatements := ottldatapoint.NewStatements(parsedStatements, pc.settings, ottldatapoint.WithErrorMode(pc.errorMode)) + return dataPointStatements{dpStatements}, nil + default: + statements, err := pc.parseCommonContextStatements(contextStatements) + if err != nil { + return nil, err + } + return statements, nil + } +} diff --git a/exporter/common/processor.go b/exporter/common/processor.go new file mode 100644 index 000000000000..56e658b96d40 --- /dev/null +++ b/exporter/common/processor.go @@ -0,0 +1,164 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" + +import ( + "context" + "fmt" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlresource" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope" +) + +var _ consumer.Traces = &resourceStatements{} +var _ consumer.Metrics = &resourceStatements{} +var _ consumer.Logs = &resourceStatements{} +var _ baseContext = &resourceStatements{} + +type resourceStatements struct { + ottl.Statements[ottlresource.TransformContext] +} + +func (r resourceStatements) Capabilities() consumer.Capabilities { + return consumer.Capabilities{ + MutatesData: true, + } +} + +func (r resourceStatements) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { + for i := 0; i < td.ResourceSpans().Len(); i++ { + rspans := td.ResourceSpans().At(i) + tCtx := ottlresource.NewTransformContext(rspans.Resource()) + err := r.Execute(ctx, tCtx) + if err != nil { + return err + } + } + return nil +} + +func (r resourceStatements) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { + for i := 0; i < md.ResourceMetrics().Len(); i++ { + rmetrics := md.ResourceMetrics().At(i) + tCtx := ottlresource.NewTransformContext(rmetrics.Resource()) + err := r.Execute(ctx, tCtx) + if err != nil { + return err + } + } + return nil +} + +func (r resourceStatements) ConsumeLogs(ctx context.Context, ld plog.Logs) error { + for i := 0; i < ld.ResourceLogs().Len(); i++ { + rlogs := ld.ResourceLogs().At(i) + tCtx := ottlresource.NewTransformContext(rlogs.Resource()) + err := r.Execute(ctx, tCtx) + if err != nil { + return err + } + } + return nil +} + +var _ consumer.Traces = &scopeStatements{} +var _ consumer.Metrics = &scopeStatements{} +var _ consumer.Logs = &scopeStatements{} +var _ baseContext = &scopeStatements{} + +type scopeStatements struct { + ottl.Statements[ottlscope.TransformContext] +} + +func (s scopeStatements) Capabilities() consumer.Capabilities { + return consumer.Capabilities{ + MutatesData: true, + } +} + +func (s scopeStatements) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { + for i := 0; i < td.ResourceSpans().Len(); i++ { + rspans := td.ResourceSpans().At(i) + for j := 0; j < rspans.ScopeSpans().Len(); j++ { + sspans := rspans.ScopeSpans().At(j) + tCtx := ottlscope.NewTransformContext(sspans.Scope(), rspans.Resource()) + err := s.Execute(ctx, tCtx) + if err != nil { + return err + } + } + } + return nil +} + +func (s scopeStatements) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { + for i := 0; i < md.ResourceMetrics().Len(); i++ { + rmetrics := md.ResourceMetrics().At(i) + for j := 0; j < rmetrics.ScopeMetrics().Len(); j++ { + smetrics := rmetrics.ScopeMetrics().At(j) + tCtx := ottlscope.NewTransformContext(smetrics.Scope(), rmetrics.Resource()) + err := s.Execute(ctx, tCtx) + if err != nil { + return err + } + } + } + return nil +} + +func (s scopeStatements) ConsumeLogs(ctx context.Context, ld plog.Logs) error { + for i := 0; i < ld.ResourceLogs().Len(); i++ { + rlogs := ld.ResourceLogs().At(i) + for j := 0; j < rlogs.ScopeLogs().Len(); j++ { + slogs := rlogs.ScopeLogs().At(j) + tCtx := ottlscope.NewTransformContext(slogs.Scope(), rlogs.Resource()) + err := s.Execute(ctx, tCtx) + if err != nil { + return err + } + } + } + return nil +} + +type parserCollection struct { + settings component.TelemetrySettings + resourceParser ottl.Parser[ottlresource.TransformContext] + scopeParser ottl.Parser[ottlscope.TransformContext] + errorMode ottl.ErrorMode +} + +type baseContext interface { + consumer.Traces + consumer.Metrics + consumer.Logs +} + +func (pc parserCollection) parseCommonContextStatements(contextStatement ContextStatements) (baseContext, error) { + switch contextStatement.Context { + case Resource: + parsedStatements, err := pc.resourceParser.ParseStatements(contextStatement.Statements) + if err != nil { + return nil, err + } + rStatements := ottlresource.NewStatements(parsedStatements, pc.settings, ottlresource.WithErrorMode(pc.errorMode)) + return resourceStatements{rStatements}, nil + case Scope: + parsedStatements, err := pc.scopeParser.ParseStatements(contextStatement.Statements) + if err != nil { + return nil, err + } + sStatements := ottlscope.NewStatements(parsedStatements, pc.settings, ottlscope.WithErrorMode(pc.errorMode)) + return scopeStatements{sStatements}, nil + default: + return nil, fmt.Errorf("unknown context %v", contextStatement.Context) + } +} diff --git a/exporter/common/traces.go b/exporter/common/traces.go new file mode 100644 index 000000000000..55951eabc9cc --- /dev/null +++ b/exporter/common/traces.go @@ -0,0 +1,167 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/ptrace" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlresource" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlspan" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlspanevent" +) + +var _ consumer.Traces = &traceStatements{} + +type traceStatements struct { + ottl.Statements[ottlspan.TransformContext] +} + +func (t traceStatements) Capabilities() consumer.Capabilities { + return consumer.Capabilities{ + MutatesData: true, + } +} + +func (t traceStatements) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { + for i := 0; i < td.ResourceSpans().Len(); i++ { + rspans := td.ResourceSpans().At(i) + for j := 0; j < rspans.ScopeSpans().Len(); j++ { + sspans := rspans.ScopeSpans().At(j) + spans := sspans.Spans() + for k := 0; k < spans.Len(); k++ { + tCtx := ottlspan.NewTransformContext(spans.At(k), sspans.Scope(), rspans.Resource()) + err := t.Execute(ctx, tCtx) + if err != nil { + return err + } + } + } + } + return nil +} + +var _ consumer.Traces = &spanEventStatements{} + +type spanEventStatements struct { + ottl.Statements[ottlspanevent.TransformContext] +} + +func (s spanEventStatements) Capabilities() consumer.Capabilities { + return consumer.Capabilities{ + MutatesData: true, + } +} + +func (s spanEventStatements) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { + for i := 0; i < td.ResourceSpans().Len(); i++ { + rspans := td.ResourceSpans().At(i) + for j := 0; j < rspans.ScopeSpans().Len(); j++ { + sspans := rspans.ScopeSpans().At(j) + spans := sspans.Spans() + for k := 0; k < spans.Len(); k++ { + span := spans.At(k) + spanEvents := span.Events() + for n := 0; n < spanEvents.Len(); n++ { + tCtx := ottlspanevent.NewTransformContext(spanEvents.At(n), span, sspans.Scope(), rspans.Resource()) + err := s.Execute(ctx, tCtx) + if err != nil { + return err + } + } + } + } + } + return nil +} + +type TraceParserCollection struct { + parserCollection + spanParser ottl.Parser[ottlspan.TransformContext] + spanEventParser ottl.Parser[ottlspanevent.TransformContext] +} + +type TraceParserCollectionOption func(*TraceParserCollection) error + +func WithSpanParser(functions map[string]ottl.Factory[ottlspan.TransformContext]) TraceParserCollectionOption { + return func(tp *TraceParserCollection) error { + spanParser, err := ottlspan.NewParser(functions, tp.settings) + if err != nil { + return err + } + tp.spanParser = spanParser + return nil + } +} + +func WithSpanEventParser(functions map[string]ottl.Factory[ottlspanevent.TransformContext]) TraceParserCollectionOption { + return func(tp *TraceParserCollection) error { + spanEventParser, err := ottlspanevent.NewParser(functions, tp.settings) + if err != nil { + return err + } + tp.spanEventParser = spanEventParser + return nil + } +} + +func WithTraceErrorMode(errorMode ottl.ErrorMode) TraceParserCollectionOption { + return func(tp *TraceParserCollection) error { + tp.errorMode = errorMode + return nil + } +} + +func NewTraceParserCollection(settings component.TelemetrySettings, options ...TraceParserCollectionOption) (*TraceParserCollection, error) { + rp, err := ottlresource.NewParser(ResourceFunctions(), settings) + if err != nil { + return nil, err + } + sp, err := ottlscope.NewParser(ScopeFunctions(), settings) + if err != nil { + return nil, err + } + tpc := &TraceParserCollection{ + parserCollection: parserCollection{ + settings: settings, + resourceParser: rp, + scopeParser: sp, + }, + } + + for _, op := range options { + err := op(tpc) + if err != nil { + return nil, err + } + } + + return tpc, nil +} + +func (pc TraceParserCollection) ParseContextStatements(contextStatements ContextStatements) (consumer.Traces, error) { + switch contextStatements.Context { + case Span: + parsedStatements, err := pc.spanParser.ParseStatements(contextStatements.Statements) + if err != nil { + return nil, err + } + sStatements := ottlspan.NewStatements(parsedStatements, pc.settings, ottlspan.WithErrorMode(pc.errorMode)) + return traceStatements{sStatements}, nil + case SpanEvent: + parsedStatements, err := pc.spanEventParser.ParseStatements(contextStatements.Statements) + if err != nil { + return nil, err + } + seStatements := ottlspanevent.NewStatements(parsedStatements, pc.settings, ottlspanevent.WithErrorMode(pc.errorMode)) + return spanEventStatements{seStatements}, nil + default: + return pc.parseCommonContextStatements(contextStatements) + } +} diff --git a/exporter/functions.go b/exporter/functions.go new file mode 100644 index 000000000000..6ee6636b288c --- /dev/null +++ b/exporter/functions.go @@ -0,0 +1,15 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package exporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter" + +import ( + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottllog" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottlfuncs" +) + +func LogFunctions() map[string]ottl.Factory[ottllog.TransformContext] { + // No logs-only functions yet. + return ottlfuncs.StandardFuncs[ottllog.TransformContext]() +} diff --git a/exporter/honeycombmarkerexporter/config.go b/exporter/honeycombmarkerexporter/config.go index 55ed30154afd..59cc6fdee157 100644 --- a/exporter/honeycombmarkerexporter/config.go +++ b/exporter/honeycombmarkerexporter/config.go @@ -5,6 +5,9 @@ package honeycombexporter // import "github.com/open-telemetry/opentelemetry-col import ( "fmt" + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter" + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/common" + "go.uber.org/zap" "go.opentelemetry.io/collector/component" ) @@ -57,6 +60,32 @@ func (cfg *Config) Validate() error { return fmt.Errorf("invalid URL") } + if len(cfg.Markers) != 0 { + for _, m := range cfg.Markers { + if len(m.Rules.ResourceConditions) == 0 && len(m.Rules.LogConditions) == 0 { + return fmt.Errorf("no rules supplied for marker %v", m) + } + + pc, err := common.NewLogParserCollection(component.TelemetrySettings{Logger: zap.NewNop()}, common.WithLogParser(exporter.LogFunctions())) + + if err != nil { + return err + } + + cs := common.ContextStatements{ + Context: "log", + Statements: m.Rules.LogConditions, + } + _, err = pc.ParseContextStatements(cs) + if err != nil { + return fmt.Errorf("unable to parse log condition %v", m.Rules.LogConditions) + } + + } + } else { + return fmt.Errorf("no markers supplied") + } + return nil } From 52f85c8e75d7fa0675fad137d1b331ff0d9c4234 Mon Sep 17 00:00:00 2001 From: Faith Chikwekwe Date: Tue, 3 Oct 2023 11:52:07 -0400 Subject: [PATCH 09/43] Update exporter/honeycombmarkerexporter/factory.go Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> --- exporter/honeycombmarkerexporter/factory.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/honeycombmarkerexporter/factory.go b/exporter/honeycombmarkerexporter/factory.go index acf8efb5a0a3..b41730e306b9 100644 --- a/exporter/honeycombmarkerexporter/factory.go +++ b/exporter/honeycombmarkerexporter/factory.go @@ -24,7 +24,7 @@ func NewFactory() exporter.Factory { func CreateDefaultConfig() component.Config { return &Config{ APIKey: "", - APIURL: "", + APIURL: "api.honeycomb.io:443", Markers: []marker{ { MarkerType: "", From 792bdcec86e23bd4c9603cc743b6ab76f2388352 Mon Sep 17 00:00:00 2001 From: Faith Chikwekwe Date: Tue, 3 Oct 2023 11:52:37 -0400 Subject: [PATCH 10/43] Update exporter/honeycombmarkerexporter/factory.go Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> --- exporter/honeycombmarkerexporter/factory.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/honeycombmarkerexporter/factory.go b/exporter/honeycombmarkerexporter/factory.go index b41730e306b9..ec444a5c4036 100644 --- a/exporter/honeycombmarkerexporter/factory.go +++ b/exporter/honeycombmarkerexporter/factory.go @@ -17,7 +17,7 @@ func NewFactory() exporter.Factory { return exporter.NewFactory( metadata.Type, CreateDefaultConfig, - exporter.WithLogs(createLogsExporter, component.StabilityLevelDevelopment), + exporter.WithLogs(createLogsExporter, metadata.LogsStability), ) } From 1fb07b0c61287b1d84d94cc00d4aa4f01b7a8d0d Mon Sep 17 00:00:00 2001 From: Faith Chikwekwe Date: Tue, 3 Oct 2023 11:53:18 -0400 Subject: [PATCH 11/43] Update exporter/honeycombmarkerexporter/metadata.yaml Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> --- exporter/honeycombmarkerexporter/metadata.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exporter/honeycombmarkerexporter/metadata.yaml b/exporter/honeycombmarkerexporter/metadata.yaml index b99b8c6186b8..ceac2de5a0de 100644 --- a/exporter/honeycombmarkerexporter/metadata.yaml +++ b/exporter/honeycombmarkerexporter/metadata.yaml @@ -4,4 +4,6 @@ status: class: exporter stability: development: [logs] - distributions: [] \ No newline at end of file + distributions: [] + codeowners: + active: [TylerHelmuth, fchikwekwe] From 311a4203bc86fe0efb4696525c2a7d97bd72f69b Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 3 Oct 2023 11:57:06 -0400 Subject: [PATCH 12/43] fix: use configopaque --- exporter/honeycombmarkerexporter/config.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/exporter/honeycombmarkerexporter/config.go b/exporter/honeycombmarkerexporter/config.go index 59cc6fdee157..8b79c6567c6a 100644 --- a/exporter/honeycombmarkerexporter/config.go +++ b/exporter/honeycombmarkerexporter/config.go @@ -5,17 +5,18 @@ package honeycombexporter // import "github.com/open-telemetry/opentelemetry-col import ( "fmt" + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/common" - "go.uber.org/zap" - "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configopaque" + "go.uber.org/zap" ) // Config defines configuration for the Honeycomb Marker exporter. type Config struct { // APIKey is the authentication token associated with the Honeycomb account. - APIKey string `mapstructure:"api_key"` + APIKey configopaque.String `mapstructure:"api_key"` // API URL to use (defaults to https://api.honeycomb.io) APIURL string `mapstructure:"api_url"` From a49faf1fa9ef89bd9e30fcfc0cee0906d5e13617 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Thu, 5 Oct 2023 11:04:23 -0400 Subject: [PATCH 13/43] fix: add support for checking log and resource conditions --- exporter/common/config.go | 37 ---- exporter/common/functions.go | 19 -- exporter/common/logs.go | 117 ----------- exporter/common/metrics.go | 225 --------------------- exporter/common/processor.go | 164 --------------- exporter/common/traces.go | 167 --------------- exporter/functions.go | 15 -- exporter/honeycombmarkerexporter/config.go | 43 ++-- processor/filterprocessor/config.go | 46 ++++- 9 files changed, 67 insertions(+), 766 deletions(-) delete mode 100644 exporter/common/config.go delete mode 100644 exporter/common/functions.go delete mode 100644 exporter/common/logs.go delete mode 100644 exporter/common/metrics.go delete mode 100644 exporter/common/processor.go delete mode 100644 exporter/common/traces.go delete mode 100644 exporter/functions.go diff --git a/exporter/common/config.go b/exporter/common/config.go deleted file mode 100644 index 2747ac11d4db..000000000000 --- a/exporter/common/config.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" - -import ( - "fmt" - "strings" -) - -type ContextID string - -const ( - Resource ContextID = "resource" - Scope ContextID = "scope" - Span ContextID = "span" - SpanEvent ContextID = "spanevent" - Metric ContextID = "metric" - DataPoint ContextID = "datapoint" - Log ContextID = "log" -) - -func (c *ContextID) UnmarshalText(text []byte) error { - str := ContextID(strings.ToLower(string(text))) - switch str { - case Resource, Scope, Span, SpanEvent, Metric, DataPoint, Log: - *c = str - return nil - default: - return fmt.Errorf("unknown context %v", str) - } -} - -type ContextStatements struct { - Context ContextID `mapstructure:"context"` - Statements []string `mapstructure:"statements"` -} diff --git a/exporter/common/functions.go b/exporter/common/functions.go deleted file mode 100644 index 2d0a02b06102..000000000000 --- a/exporter/common/functions.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" - -import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlresource" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottlfuncs" -) - -func ResourceFunctions() map[string]ottl.Factory[ottlresource.TransformContext] { - return ottlfuncs.StandardFuncs[ottlresource.TransformContext]() -} - -func ScopeFunctions() map[string]ottl.Factory[ottlscope.TransformContext] { - return ottlfuncs.StandardFuncs[ottlscope.TransformContext]() -} diff --git a/exporter/common/logs.go b/exporter/common/logs.go deleted file mode 100644 index 7af9031d5011..000000000000 --- a/exporter/common/logs.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" - -import ( - "context" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/pdata/plog" - - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottllog" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlresource" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope" -) - -var _ consumer.Logs = &logStatements{} - -type logStatements struct { - ottl.Statements[ottllog.TransformContext] -} - -func (l logStatements) Capabilities() consumer.Capabilities { - return consumer.Capabilities{ - MutatesData: true, - } -} - -func (l logStatements) ConsumeLogs(ctx context.Context, ld plog.Logs) error { - for i := 0; i < ld.ResourceLogs().Len(); i++ { - rlogs := ld.ResourceLogs().At(i) - for j := 0; j < rlogs.ScopeLogs().Len(); j++ { - slogs := rlogs.ScopeLogs().At(j) - logs := slogs.LogRecords() - for k := 0; k < logs.Len(); k++ { - tCtx := ottllog.NewTransformContext(logs.At(k), slogs.Scope(), rlogs.Resource()) - err := l.Execute(ctx, tCtx) - if err != nil { - return err - } - } - } - } - return nil -} - -type LogParserCollection struct { - parserCollection - logParser ottl.Parser[ottllog.TransformContext] -} - -type LogParserCollectionOption func(*LogParserCollection) error - -func WithLogParser(functions map[string]ottl.Factory[ottllog.TransformContext]) LogParserCollectionOption { - return func(lp *LogParserCollection) error { - logParser, err := ottllog.NewParser(functions, lp.settings) - if err != nil { - return err - } - lp.logParser = logParser - return nil - } -} - -func WithLogErrorMode(errorMode ottl.ErrorMode) LogParserCollectionOption { - return func(lp *LogParserCollection) error { - lp.errorMode = errorMode - return nil - } -} - -func NewLogParserCollection(settings component.TelemetrySettings, options ...LogParserCollectionOption) (*LogParserCollection, error) { - rp, err := ottlresource.NewParser(ResourceFunctions(), settings) - if err != nil { - return nil, err - } - sp, err := ottlscope.NewParser(ScopeFunctions(), settings) - if err != nil { - return nil, err - } - lpc := &LogParserCollection{ - parserCollection: parserCollection{ - settings: settings, - resourceParser: rp, - scopeParser: sp, - }, - } - - for _, op := range options { - err := op(lpc) - if err != nil { - return nil, err - } - } - - return lpc, nil -} - -func (pc LogParserCollection) ParseContextStatements(contextStatements ContextStatements) (consumer.Logs, error) { - switch contextStatements.Context { - case Log: - parsedStatements, err := pc.logParser.ParseStatements(contextStatements.Statements) - if err != nil { - return nil, err - } - lStatements := ottllog.NewStatements(parsedStatements, pc.settings, ottllog.WithErrorMode(pc.errorMode)) - return logStatements{lStatements}, nil - default: - statements, err := pc.parseCommonContextStatements(contextStatements) - if err != nil { - return nil, err - } - return statements, nil - } -} diff --git a/exporter/common/metrics.go b/exporter/common/metrics.go deleted file mode 100644 index becce3132cae..000000000000 --- a/exporter/common/metrics.go +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" - -import ( - "context" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/pdata/pcommon" - "go.opentelemetry.io/collector/pdata/pmetric" - - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottldatapoint" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlmetric" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlresource" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope" -) - -var _ consumer.Metrics = &metricStatements{} - -type metricStatements struct { - ottl.Statements[ottlmetric.TransformContext] -} - -func (m metricStatements) Capabilities() consumer.Capabilities { - return consumer.Capabilities{ - MutatesData: true, - } -} - -func (m metricStatements) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { - for i := 0; i < md.ResourceMetrics().Len(); i++ { - rmetrics := md.ResourceMetrics().At(i) - for j := 0; j < rmetrics.ScopeMetrics().Len(); j++ { - smetrics := rmetrics.ScopeMetrics().At(j) - metrics := smetrics.Metrics() - for k := 0; k < metrics.Len(); k++ { - tCtx := ottlmetric.NewTransformContext(metrics.At(k), smetrics.Metrics(), smetrics.Scope(), rmetrics.Resource()) - err := m.Execute(ctx, tCtx) - if err != nil { - return err - } - } - } - } - return nil -} - -var _ consumer.Metrics = &dataPointStatements{} - -type dataPointStatements struct { - ottl.Statements[ottldatapoint.TransformContext] -} - -func (d dataPointStatements) Capabilities() consumer.Capabilities { - return consumer.Capabilities{ - MutatesData: true, - } -} - -func (d dataPointStatements) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { - for i := 0; i < md.ResourceMetrics().Len(); i++ { - rmetrics := md.ResourceMetrics().At(i) - for j := 0; j < rmetrics.ScopeMetrics().Len(); j++ { - smetrics := rmetrics.ScopeMetrics().At(j) - metrics := smetrics.Metrics() - for k := 0; k < metrics.Len(); k++ { - metric := metrics.At(k) - var err error - //exhaustive:enforce - switch metric.Type() { - case pmetric.MetricTypeSum: - err = d.handleNumberDataPoints(ctx, metric.Sum().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource()) - case pmetric.MetricTypeGauge: - err = d.handleNumberDataPoints(ctx, metric.Gauge().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource()) - case pmetric.MetricTypeHistogram: - err = d.handleHistogramDataPoints(ctx, metric.Histogram().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource()) - case pmetric.MetricTypeExponentialHistogram: - err = d.handleExponetialHistogramDataPoints(ctx, metric.ExponentialHistogram().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource()) - case pmetric.MetricTypeSummary: - err = d.handleSummaryDataPoints(ctx, metric.Summary().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource()) - } - if err != nil { - return err - } - } - } - } - return nil -} - -func (d dataPointStatements) handleNumberDataPoints(ctx context.Context, dps pmetric.NumberDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error { - for i := 0; i < dps.Len(); i++ { - tCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, metrics, is, resource) - err := d.Execute(ctx, tCtx) - if err != nil { - return err - } - } - return nil -} - -func (d dataPointStatements) handleHistogramDataPoints(ctx context.Context, dps pmetric.HistogramDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error { - for i := 0; i < dps.Len(); i++ { - tCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, metrics, is, resource) - err := d.Execute(ctx, tCtx) - if err != nil { - return err - } - } - return nil -} - -func (d dataPointStatements) handleExponetialHistogramDataPoints(ctx context.Context, dps pmetric.ExponentialHistogramDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error { - for i := 0; i < dps.Len(); i++ { - tCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, metrics, is, resource) - err := d.Execute(ctx, tCtx) - if err != nil { - return err - } - } - return nil -} - -func (d dataPointStatements) handleSummaryDataPoints(ctx context.Context, dps pmetric.SummaryDataPointSlice, metric pmetric.Metric, metrics pmetric.MetricSlice, is pcommon.InstrumentationScope, resource pcommon.Resource) error { - for i := 0; i < dps.Len(); i++ { - tCtx := ottldatapoint.NewTransformContext(dps.At(i), metric, metrics, is, resource) - err := d.Execute(ctx, tCtx) - if err != nil { - return err - } - } - return nil -} - -type MetricParserCollection struct { - parserCollection - metricParser ottl.Parser[ottlmetric.TransformContext] - dataPointParser ottl.Parser[ottldatapoint.TransformContext] -} - -type MetricParserCollectionOption func(*MetricParserCollection) error - -func WithMetricParser(functions map[string]ottl.Factory[ottlmetric.TransformContext]) MetricParserCollectionOption { - return func(mp *MetricParserCollection) error { - metricParser, err := ottlmetric.NewParser(functions, mp.settings) - if err != nil { - return err - } - mp.metricParser = metricParser - return nil - } -} - -func WithDataPointParser(functions map[string]ottl.Factory[ottldatapoint.TransformContext]) MetricParserCollectionOption { - return func(mp *MetricParserCollection) error { - dataPointParser, err := ottldatapoint.NewParser(functions, mp.settings) - if err != nil { - return err - } - mp.dataPointParser = dataPointParser - return nil - } -} - -func WithMetricErrorMode(errorMode ottl.ErrorMode) MetricParserCollectionOption { - return func(mp *MetricParserCollection) error { - mp.errorMode = errorMode - return nil - } -} - -func NewMetricParserCollection(settings component.TelemetrySettings, options ...MetricParserCollectionOption) (*MetricParserCollection, error) { - rp, err := ottlresource.NewParser(ResourceFunctions(), settings) - if err != nil { - return nil, err - } - sp, err := ottlscope.NewParser(ScopeFunctions(), settings) - if err != nil { - return nil, err - } - mpc := &MetricParserCollection{ - parserCollection: parserCollection{ - settings: settings, - resourceParser: rp, - scopeParser: sp, - }, - } - - for _, op := range options { - err := op(mpc) - if err != nil { - return nil, err - } - } - - return mpc, nil -} - -func (pc MetricParserCollection) ParseContextStatements(contextStatements ContextStatements) (consumer.Metrics, error) { - switch contextStatements.Context { - case Metric: - parseStatements, err := pc.metricParser.ParseStatements(contextStatements.Statements) - if err != nil { - return nil, err - } - mStatements := ottlmetric.NewStatements(parseStatements, pc.settings, ottlmetric.WithErrorMode(pc.errorMode)) - return metricStatements{mStatements}, nil - case DataPoint: - parsedStatements, err := pc.dataPointParser.ParseStatements(contextStatements.Statements) - if err != nil { - return nil, err - } - dpStatements := ottldatapoint.NewStatements(parsedStatements, pc.settings, ottldatapoint.WithErrorMode(pc.errorMode)) - return dataPointStatements{dpStatements}, nil - default: - statements, err := pc.parseCommonContextStatements(contextStatements) - if err != nil { - return nil, err - } - return statements, nil - } -} diff --git a/exporter/common/processor.go b/exporter/common/processor.go deleted file mode 100644 index 56e658b96d40..000000000000 --- a/exporter/common/processor.go +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" - -import ( - "context" - "fmt" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/pdata/plog" - "go.opentelemetry.io/collector/pdata/pmetric" - "go.opentelemetry.io/collector/pdata/ptrace" - - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlresource" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope" -) - -var _ consumer.Traces = &resourceStatements{} -var _ consumer.Metrics = &resourceStatements{} -var _ consumer.Logs = &resourceStatements{} -var _ baseContext = &resourceStatements{} - -type resourceStatements struct { - ottl.Statements[ottlresource.TransformContext] -} - -func (r resourceStatements) Capabilities() consumer.Capabilities { - return consumer.Capabilities{ - MutatesData: true, - } -} - -func (r resourceStatements) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { - for i := 0; i < td.ResourceSpans().Len(); i++ { - rspans := td.ResourceSpans().At(i) - tCtx := ottlresource.NewTransformContext(rspans.Resource()) - err := r.Execute(ctx, tCtx) - if err != nil { - return err - } - } - return nil -} - -func (r resourceStatements) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { - for i := 0; i < md.ResourceMetrics().Len(); i++ { - rmetrics := md.ResourceMetrics().At(i) - tCtx := ottlresource.NewTransformContext(rmetrics.Resource()) - err := r.Execute(ctx, tCtx) - if err != nil { - return err - } - } - return nil -} - -func (r resourceStatements) ConsumeLogs(ctx context.Context, ld plog.Logs) error { - for i := 0; i < ld.ResourceLogs().Len(); i++ { - rlogs := ld.ResourceLogs().At(i) - tCtx := ottlresource.NewTransformContext(rlogs.Resource()) - err := r.Execute(ctx, tCtx) - if err != nil { - return err - } - } - return nil -} - -var _ consumer.Traces = &scopeStatements{} -var _ consumer.Metrics = &scopeStatements{} -var _ consumer.Logs = &scopeStatements{} -var _ baseContext = &scopeStatements{} - -type scopeStatements struct { - ottl.Statements[ottlscope.TransformContext] -} - -func (s scopeStatements) Capabilities() consumer.Capabilities { - return consumer.Capabilities{ - MutatesData: true, - } -} - -func (s scopeStatements) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { - for i := 0; i < td.ResourceSpans().Len(); i++ { - rspans := td.ResourceSpans().At(i) - for j := 0; j < rspans.ScopeSpans().Len(); j++ { - sspans := rspans.ScopeSpans().At(j) - tCtx := ottlscope.NewTransformContext(sspans.Scope(), rspans.Resource()) - err := s.Execute(ctx, tCtx) - if err != nil { - return err - } - } - } - return nil -} - -func (s scopeStatements) ConsumeMetrics(ctx context.Context, md pmetric.Metrics) error { - for i := 0; i < md.ResourceMetrics().Len(); i++ { - rmetrics := md.ResourceMetrics().At(i) - for j := 0; j < rmetrics.ScopeMetrics().Len(); j++ { - smetrics := rmetrics.ScopeMetrics().At(j) - tCtx := ottlscope.NewTransformContext(smetrics.Scope(), rmetrics.Resource()) - err := s.Execute(ctx, tCtx) - if err != nil { - return err - } - } - } - return nil -} - -func (s scopeStatements) ConsumeLogs(ctx context.Context, ld plog.Logs) error { - for i := 0; i < ld.ResourceLogs().Len(); i++ { - rlogs := ld.ResourceLogs().At(i) - for j := 0; j < rlogs.ScopeLogs().Len(); j++ { - slogs := rlogs.ScopeLogs().At(j) - tCtx := ottlscope.NewTransformContext(slogs.Scope(), rlogs.Resource()) - err := s.Execute(ctx, tCtx) - if err != nil { - return err - } - } - } - return nil -} - -type parserCollection struct { - settings component.TelemetrySettings - resourceParser ottl.Parser[ottlresource.TransformContext] - scopeParser ottl.Parser[ottlscope.TransformContext] - errorMode ottl.ErrorMode -} - -type baseContext interface { - consumer.Traces - consumer.Metrics - consumer.Logs -} - -func (pc parserCollection) parseCommonContextStatements(contextStatement ContextStatements) (baseContext, error) { - switch contextStatement.Context { - case Resource: - parsedStatements, err := pc.resourceParser.ParseStatements(contextStatement.Statements) - if err != nil { - return nil, err - } - rStatements := ottlresource.NewStatements(parsedStatements, pc.settings, ottlresource.WithErrorMode(pc.errorMode)) - return resourceStatements{rStatements}, nil - case Scope: - parsedStatements, err := pc.scopeParser.ParseStatements(contextStatement.Statements) - if err != nil { - return nil, err - } - sStatements := ottlscope.NewStatements(parsedStatements, pc.settings, ottlscope.WithErrorMode(pc.errorMode)) - return scopeStatements{sStatements}, nil - default: - return nil, fmt.Errorf("unknown context %v", contextStatement.Context) - } -} diff --git a/exporter/common/traces.go b/exporter/common/traces.go deleted file mode 100644 index 55951eabc9cc..000000000000 --- a/exporter/common/traces.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package common // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor/internal/common" - -import ( - "context" - - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/pdata/ptrace" - - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlresource" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlscope" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlspan" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottlspanevent" -) - -var _ consumer.Traces = &traceStatements{} - -type traceStatements struct { - ottl.Statements[ottlspan.TransformContext] -} - -func (t traceStatements) Capabilities() consumer.Capabilities { - return consumer.Capabilities{ - MutatesData: true, - } -} - -func (t traceStatements) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { - for i := 0; i < td.ResourceSpans().Len(); i++ { - rspans := td.ResourceSpans().At(i) - for j := 0; j < rspans.ScopeSpans().Len(); j++ { - sspans := rspans.ScopeSpans().At(j) - spans := sspans.Spans() - for k := 0; k < spans.Len(); k++ { - tCtx := ottlspan.NewTransformContext(spans.At(k), sspans.Scope(), rspans.Resource()) - err := t.Execute(ctx, tCtx) - if err != nil { - return err - } - } - } - } - return nil -} - -var _ consumer.Traces = &spanEventStatements{} - -type spanEventStatements struct { - ottl.Statements[ottlspanevent.TransformContext] -} - -func (s spanEventStatements) Capabilities() consumer.Capabilities { - return consumer.Capabilities{ - MutatesData: true, - } -} - -func (s spanEventStatements) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { - for i := 0; i < td.ResourceSpans().Len(); i++ { - rspans := td.ResourceSpans().At(i) - for j := 0; j < rspans.ScopeSpans().Len(); j++ { - sspans := rspans.ScopeSpans().At(j) - spans := sspans.Spans() - for k := 0; k < spans.Len(); k++ { - span := spans.At(k) - spanEvents := span.Events() - for n := 0; n < spanEvents.Len(); n++ { - tCtx := ottlspanevent.NewTransformContext(spanEvents.At(n), span, sspans.Scope(), rspans.Resource()) - err := s.Execute(ctx, tCtx) - if err != nil { - return err - } - } - } - } - } - return nil -} - -type TraceParserCollection struct { - parserCollection - spanParser ottl.Parser[ottlspan.TransformContext] - spanEventParser ottl.Parser[ottlspanevent.TransformContext] -} - -type TraceParserCollectionOption func(*TraceParserCollection) error - -func WithSpanParser(functions map[string]ottl.Factory[ottlspan.TransformContext]) TraceParserCollectionOption { - return func(tp *TraceParserCollection) error { - spanParser, err := ottlspan.NewParser(functions, tp.settings) - if err != nil { - return err - } - tp.spanParser = spanParser - return nil - } -} - -func WithSpanEventParser(functions map[string]ottl.Factory[ottlspanevent.TransformContext]) TraceParserCollectionOption { - return func(tp *TraceParserCollection) error { - spanEventParser, err := ottlspanevent.NewParser(functions, tp.settings) - if err != nil { - return err - } - tp.spanEventParser = spanEventParser - return nil - } -} - -func WithTraceErrorMode(errorMode ottl.ErrorMode) TraceParserCollectionOption { - return func(tp *TraceParserCollection) error { - tp.errorMode = errorMode - return nil - } -} - -func NewTraceParserCollection(settings component.TelemetrySettings, options ...TraceParserCollectionOption) (*TraceParserCollection, error) { - rp, err := ottlresource.NewParser(ResourceFunctions(), settings) - if err != nil { - return nil, err - } - sp, err := ottlscope.NewParser(ScopeFunctions(), settings) - if err != nil { - return nil, err - } - tpc := &TraceParserCollection{ - parserCollection: parserCollection{ - settings: settings, - resourceParser: rp, - scopeParser: sp, - }, - } - - for _, op := range options { - err := op(tpc) - if err != nil { - return nil, err - } - } - - return tpc, nil -} - -func (pc TraceParserCollection) ParseContextStatements(contextStatements ContextStatements) (consumer.Traces, error) { - switch contextStatements.Context { - case Span: - parsedStatements, err := pc.spanParser.ParseStatements(contextStatements.Statements) - if err != nil { - return nil, err - } - sStatements := ottlspan.NewStatements(parsedStatements, pc.settings, ottlspan.WithErrorMode(pc.errorMode)) - return traceStatements{sStatements}, nil - case SpanEvent: - parsedStatements, err := pc.spanEventParser.ParseStatements(contextStatements.Statements) - if err != nil { - return nil, err - } - seStatements := ottlspanevent.NewStatements(parsedStatements, pc.settings, ottlspanevent.WithErrorMode(pc.errorMode)) - return spanEventStatements{seStatements}, nil - default: - return pc.parseCommonContextStatements(contextStatements) - } -} diff --git a/exporter/functions.go b/exporter/functions.go deleted file mode 100644 index 6ee6636b288c..000000000000 --- a/exporter/functions.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package exporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter" - -import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottllog" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottlfuncs" -) - -func LogFunctions() map[string]ottl.Factory[ottllog.TransformContext] { - // No logs-only functions yet. - return ottlfuncs.StandardFuncs[ottllog.TransformContext]() -} diff --git a/exporter/honeycombmarkerexporter/config.go b/exporter/honeycombmarkerexporter/config.go index 8b79c6567c6a..4f3910ba7b54 100644 --- a/exporter/honeycombmarkerexporter/config.go +++ b/exporter/honeycombmarkerexporter/config.go @@ -5,9 +5,9 @@ package honeycombexporter // import "github.com/open-telemetry/opentelemetry-col import ( "fmt" - - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter" - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/common" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configopaque" "go.uber.org/zap" @@ -23,6 +23,10 @@ type Config struct { // Markers is the list of markers to create Markers []marker `mapstructure:"markers"` + + Logs filterprocessor.LogFilters `mapstructure:"logs"` + + Resources filterprocessor.ResourceFilters `mapstructure:"logs"` } type marker struct { @@ -67,26 +71,29 @@ func (cfg *Config) Validate() error { return fmt.Errorf("no rules supplied for marker %v", m) } - pc, err := common.NewLogParserCollection(component.TelemetrySettings{Logger: zap.NewNop()}, common.WithLogParser(exporter.LogFunctions())) - - if err != nil { - return err - } - - cs := common.ContextStatements{ - Context: "log", - Statements: m.Rules.LogConditions, - } - _, err = pc.ParseContextStatements(cs) - if err != nil { - return fmt.Errorf("unable to parse log condition %v", m.Rules.LogConditions) - } - } } else { return fmt.Errorf("no markers supplied") } + if cfg.Logs.LogConditions != nil { + _, err := filterottl.NewBoolExprForLog(cfg.Logs.LogConditions, filterottl.StandardLogFuncs(), ottl.PropagateError, component.TelemetrySettings{Logger: zap.NewNop()}) + return err + } + + if cfg.Logs.LogConditions != nil && cfg.Logs.Include != nil { + return cfg.Logs.Include.Validate() + } + + if cfg.Logs.LogConditions != nil && cfg.Logs.Exclude != nil { + return cfg.Logs.Exclude.Validate() + } + + if cfg.Resources.ResourceConditions != nil { + _, err := filterottl.NewBoolExprForLog(cfg.Resources.ResourceConditions, filterottl.StandardLogFuncs(), ottl.PropagateError, component.TelemetrySettings{Logger: zap.NewNop()}) + return err + } + return nil } diff --git a/processor/filterprocessor/config.go b/processor/filterprocessor/config.go index 3f517382fdda..a60112f6cd0a 100644 --- a/processor/filterprocessor/config.go +++ b/processor/filterprocessor/config.go @@ -33,6 +33,8 @@ type Config struct { Logs LogFilters `mapstructure:"logs"` + Resources ResourceFilters `mapstructure:"logs"` + Spans filterconfig.MatchConfig `mapstructure:"spans"` Traces TraceFilters `mapstructure:"traces"` @@ -94,6 +96,23 @@ type LogFilters struct { LogConditions []string `mapstructure:"log_record"` } +// ResourceFilters filters by Log properties. +type ResourceFilters struct { + // Include match properties describe logs that should be included in the Collector Service pipeline, + // all other recources should be dropped from further processing. + // If both Include and Exclude are specified, Include filtering occurs first. + Include *ResourceMatchProperties `mapstructure:"include"` + // Exclude match properties describe logs that should be excluded from the Collector Service pipeline, + // all other logs should be included. + // If both Include and Exclude are specified, Include filtering occurs first. + Exclude *ResourceMatchProperties `mapstructure:"exclude"` + + // LogConditions is a list of OTTL conditions for an ottllog context. + // If any condition resolves to true, the log event will be dropped. + // Supports `and`, `or`, and `()` + ResourceConditions []string `mapstructure:"log_record"` +} + // LogMatchType specifies the strategy for matching against `plog.Log`s. type LogMatchType string @@ -206,8 +225,8 @@ type LogMatchProperties struct { LogBodies []string `mapstructure:"bodies"` } -// validate checks that the LogMatchProperties is valid -func (lmp LogMatchProperties) validate() error { +// Validate checks that the LogMatchProperties is valid +func (lmp LogMatchProperties) Validate() error { if lmp.SeverityNumberProperties != nil { return lmp.SeverityNumberProperties.validate() } @@ -264,6 +283,17 @@ func (lmp LogSeverityNumberMatchProperties) validate() error { var _ component.Config = (*Config)(nil) +type ResourceMatchProperties struct { + // LogMatchType specifies the type of matching desired + ResourceMatchType ResourceMatchType `mapstructure:"match_type"` + + // ResourceAttributes defines a list of possible resource attributes to match logs against. + // A match occurs if any resource attribute matches all expressions in this given list. + ResourceAttributes []filterconfig.Attribute `mapstructure:"resource_attributes"` +} + +type ResourceMatchType string + // Validate checks if the processor configuration is valid func (cfg *Config) Validate() error { if (cfg.Traces.SpanConditions != nil || cfg.Traces.SpanEventConditions != nil) && (cfg.Spans.Include != nil || cfg.Spans.Exclude != nil) { @@ -275,6 +305,9 @@ func (cfg *Config) Validate() error { if cfg.Logs.LogConditions != nil && (cfg.Logs.Include != nil || cfg.Logs.Exclude != nil) { return fmt.Errorf("cannot use ottl conditions and include/exclude for logs at the same time") } + if cfg.Resources.ResourceConditions != nil && (cfg.Resources.Include != nil || cfg.Resources.Exclude != nil) { + return fmt.Errorf("cannot use ottl conditions and include/exclude for resources at the same time") + } var errors error @@ -304,11 +337,16 @@ func (cfg *Config) Validate() error { } if cfg.Logs.LogConditions != nil && cfg.Logs.Include != nil { - errors = multierr.Append(errors, cfg.Logs.Include.validate()) + errors = multierr.Append(errors, cfg.Logs.Include.Validate()) } if cfg.Logs.LogConditions != nil && cfg.Logs.Exclude != nil { - errors = multierr.Append(errors, cfg.Logs.Exclude.validate()) + errors = multierr.Append(errors, cfg.Logs.Exclude.Validate()) + } + + if cfg.Resources.ResourceConditions != nil { + _, err := filterottl.NewBoolExprForResource(cfg.Resources.ResourceConditions, filterottl.StandardResourceFuncs(), ottl.PropagateError, component.TelemetrySettings{Logger: zap.NewNop()}) + errors = multierr.Append(errors, err) } return errors From c55361660f44b0ca8377973a14b633f5dd980cbc Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Thu, 5 Oct 2023 11:11:26 -0400 Subject: [PATCH 14/43] chore: update changelog --- .chloggen/feat_marker-exporter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/feat_marker-exporter.yaml b/.chloggen/feat_marker-exporter.yaml index b531cdf0dc1e..3c0f0bcd3f85 100755 --- a/.chloggen/feat_marker-exporter.yaml +++ b/.chloggen/feat_marker-exporter.yaml @@ -7,7 +7,7 @@ change_type: 'new_component' component: 'honeycombmarkerexporter' # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: "This component will export markers to be consumed by the Honeycomb Markers API to highlight user events based initially on preset configurations." +note: "This component will export markers to be consumed by the Honeycomb Markers API to highlight user events" # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. issues: [26653] From f92d3df2774cbf4e16135405508f540c1fda9aa9 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Thu, 5 Oct 2023 11:31:47 -0400 Subject: [PATCH 15/43] refactor: rename exporter dir --- .chloggen/feat_marker-exporter.yaml | 2 +- .../{honeycombmarkerexporter => honeycombexporter}/Makefile | 0 .../{honeycombmarkerexporter => honeycombexporter}/README.md | 2 -- .../{honeycombmarkerexporter => honeycombexporter}/config.go | 0 .../config_test.go | 0 .../{honeycombmarkerexporter => honeycombexporter}/doc.go | 4 ++-- .../{honeycombmarkerexporter => honeycombexporter}/factory.go | 2 +- .../factory_test.go | 0 .../internal/metadata/generated_status.go | 0 .../logs_exporter.go | 0 .../metadata.yaml | 0 .../testdata/config.yaml | 0 12 files changed, 4 insertions(+), 6 deletions(-) rename exporter/{honeycombmarkerexporter => honeycombexporter}/Makefile (100%) rename exporter/{honeycombmarkerexporter => honeycombexporter}/README.md (99%) rename exporter/{honeycombmarkerexporter => honeycombexporter}/config.go (100%) rename exporter/{honeycombmarkerexporter => honeycombexporter}/config_test.go (100%) rename exporter/{honeycombmarkerexporter => honeycombexporter}/doc.go (57%) rename exporter/{honeycombmarkerexporter => honeycombexporter}/factory.go (96%) rename exporter/{honeycombmarkerexporter => honeycombexporter}/factory_test.go (100%) rename exporter/{honeycombmarkerexporter => honeycombexporter}/internal/metadata/generated_status.go (100%) rename exporter/{honeycombmarkerexporter => honeycombexporter}/logs_exporter.go (100%) rename exporter/{honeycombmarkerexporter => honeycombexporter}/metadata.yaml (100%) rename exporter/{honeycombmarkerexporter => honeycombexporter}/testdata/config.yaml (100%) diff --git a/.chloggen/feat_marker-exporter.yaml b/.chloggen/feat_marker-exporter.yaml index 3c0f0bcd3f85..5f7688a33a20 100755 --- a/.chloggen/feat_marker-exporter.yaml +++ b/.chloggen/feat_marker-exporter.yaml @@ -4,7 +4,7 @@ change_type: 'new_component' # The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) -component: 'honeycombmarkerexporter' +component: 'honeycombexporter' # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). note: "This component will export markers to be consumed by the Honeycomb Markers API to highlight user events" diff --git a/exporter/honeycombmarkerexporter/Makefile b/exporter/honeycombexporter/Makefile similarity index 100% rename from exporter/honeycombmarkerexporter/Makefile rename to exporter/honeycombexporter/Makefile diff --git a/exporter/honeycombmarkerexporter/README.md b/exporter/honeycombexporter/README.md similarity index 99% rename from exporter/honeycombmarkerexporter/README.md rename to exporter/honeycombexporter/README.md index 96eb2e76e47d..27ed438cd1fd 100644 --- a/exporter/honeycombmarkerexporter/README.md +++ b/exporter/honeycombexporter/README.md @@ -43,6 +43,4 @@ exporters: - logconditions: - "LogCondition1" - "LogCondition2" - - ``` \ No newline at end of file diff --git a/exporter/honeycombmarkerexporter/config.go b/exporter/honeycombexporter/config.go similarity index 100% rename from exporter/honeycombmarkerexporter/config.go rename to exporter/honeycombexporter/config.go diff --git a/exporter/honeycombmarkerexporter/config_test.go b/exporter/honeycombexporter/config_test.go similarity index 100% rename from exporter/honeycombmarkerexporter/config_test.go rename to exporter/honeycombexporter/config_test.go diff --git a/exporter/honeycombmarkerexporter/doc.go b/exporter/honeycombexporter/doc.go similarity index 57% rename from exporter/honeycombmarkerexporter/doc.go rename to exporter/honeycombexporter/doc.go index 4d67c2f71e79..6809be8e45ec 100644 --- a/exporter/honeycombmarkerexporter/doc.go +++ b/exporter/honeycombexporter/doc.go @@ -3,5 +3,5 @@ //go:generate mdatagen metadata.yaml -// Package honeycombmarkerexporter exports marker data to Honeycomb. -package honeycombexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter" +// Package honeycombexporter exports marker data to Honeycomb. +package honeycombexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter" diff --git a/exporter/honeycombmarkerexporter/factory.go b/exporter/honeycombexporter/factory.go similarity index 96% rename from exporter/honeycombmarkerexporter/factory.go rename to exporter/honeycombexporter/factory.go index ec444a5c4036..3daf22eda73a 100644 --- a/exporter/honeycombmarkerexporter/factory.go +++ b/exporter/honeycombexporter/factory.go @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper" - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter/internal/metadata" ) func NewFactory() exporter.Factory { diff --git a/exporter/honeycombmarkerexporter/factory_test.go b/exporter/honeycombexporter/factory_test.go similarity index 100% rename from exporter/honeycombmarkerexporter/factory_test.go rename to exporter/honeycombexporter/factory_test.go diff --git a/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go b/exporter/honeycombexporter/internal/metadata/generated_status.go similarity index 100% rename from exporter/honeycombmarkerexporter/internal/metadata/generated_status.go rename to exporter/honeycombexporter/internal/metadata/generated_status.go diff --git a/exporter/honeycombmarkerexporter/logs_exporter.go b/exporter/honeycombexporter/logs_exporter.go similarity index 100% rename from exporter/honeycombmarkerexporter/logs_exporter.go rename to exporter/honeycombexporter/logs_exporter.go diff --git a/exporter/honeycombmarkerexporter/metadata.yaml b/exporter/honeycombexporter/metadata.yaml similarity index 100% rename from exporter/honeycombmarkerexporter/metadata.yaml rename to exporter/honeycombexporter/metadata.yaml diff --git a/exporter/honeycombmarkerexporter/testdata/config.yaml b/exporter/honeycombexporter/testdata/config.yaml similarity index 100% rename from exporter/honeycombmarkerexporter/testdata/config.yaml rename to exporter/honeycombexporter/testdata/config.yaml From 44cbc2c510a9c3f694f30518d9a30dcf575182ef Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Thu, 5 Oct 2023 13:00:11 -0400 Subject: [PATCH 16/43] fix: revert changes to filter processor --- exporter/honeycombexporter/config.go | 36 ++++++++-------------- processor/filterprocessor/config.go | 46 ---------------------------- 2 files changed, 13 insertions(+), 69 deletions(-) diff --git a/exporter/honeycombexporter/config.go b/exporter/honeycombexporter/config.go index 4f3910ba7b54..eb33b20d5516 100644 --- a/exporter/honeycombexporter/config.go +++ b/exporter/honeycombexporter/config.go @@ -7,12 +7,15 @@ import ( "fmt" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterottl" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" - "github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configopaque" "go.uber.org/zap" ) +/* +undo all changes to filterprocessor +*/ + */ // Config defines configuration for the Honeycomb Marker exporter. type Config struct { // APIKey is the authentication token associated with the Honeycomb account. @@ -23,10 +26,6 @@ type Config struct { // Markers is the list of markers to create Markers []marker `mapstructure:"markers"` - - Logs filterprocessor.LogFilters `mapstructure:"logs"` - - Resources filterprocessor.ResourceFilters `mapstructure:"logs"` } type marker struct { @@ -71,29 +70,20 @@ func (cfg *Config) Validate() error { return fmt.Errorf("no rules supplied for marker %v", m) } + _, err := filterottl.NewBoolExprForResource(m.Rules.ResourceConditions, filterottl.StandardResourceFuncs(), ottl.PropagateError, component.TelemetrySettings{Logger: zap.NewNop()}) + if err != nil { + return err + } + + _, err = filterottl.NewBoolExprForLog(m.Rules.LogConditions, filterottl.StandardLogFuncs(), ottl.PropagateError, component.TelemetrySettings{Logger: zap.NewNop()}) + if err != nil { + return err + } } } else { return fmt.Errorf("no markers supplied") } - if cfg.Logs.LogConditions != nil { - _, err := filterottl.NewBoolExprForLog(cfg.Logs.LogConditions, filterottl.StandardLogFuncs(), ottl.PropagateError, component.TelemetrySettings{Logger: zap.NewNop()}) - return err - } - - if cfg.Logs.LogConditions != nil && cfg.Logs.Include != nil { - return cfg.Logs.Include.Validate() - } - - if cfg.Logs.LogConditions != nil && cfg.Logs.Exclude != nil { - return cfg.Logs.Exclude.Validate() - } - - if cfg.Resources.ResourceConditions != nil { - _, err := filterottl.NewBoolExprForLog(cfg.Resources.ResourceConditions, filterottl.StandardLogFuncs(), ottl.PropagateError, component.TelemetrySettings{Logger: zap.NewNop()}) - return err - } - return nil } diff --git a/processor/filterprocessor/config.go b/processor/filterprocessor/config.go index a60112f6cd0a..907ddf255783 100644 --- a/processor/filterprocessor/config.go +++ b/processor/filterprocessor/config.go @@ -33,8 +33,6 @@ type Config struct { Logs LogFilters `mapstructure:"logs"` - Resources ResourceFilters `mapstructure:"logs"` - Spans filterconfig.MatchConfig `mapstructure:"spans"` Traces TraceFilters `mapstructure:"traces"` @@ -96,23 +94,6 @@ type LogFilters struct { LogConditions []string `mapstructure:"log_record"` } -// ResourceFilters filters by Log properties. -type ResourceFilters struct { - // Include match properties describe logs that should be included in the Collector Service pipeline, - // all other recources should be dropped from further processing. - // If both Include and Exclude are specified, Include filtering occurs first. - Include *ResourceMatchProperties `mapstructure:"include"` - // Exclude match properties describe logs that should be excluded from the Collector Service pipeline, - // all other logs should be included. - // If both Include and Exclude are specified, Include filtering occurs first. - Exclude *ResourceMatchProperties `mapstructure:"exclude"` - - // LogConditions is a list of OTTL conditions for an ottllog context. - // If any condition resolves to true, the log event will be dropped. - // Supports `and`, `or`, and `()` - ResourceConditions []string `mapstructure:"log_record"` -} - // LogMatchType specifies the strategy for matching against `plog.Log`s. type LogMatchType string @@ -283,17 +264,6 @@ func (lmp LogSeverityNumberMatchProperties) validate() error { var _ component.Config = (*Config)(nil) -type ResourceMatchProperties struct { - // LogMatchType specifies the type of matching desired - ResourceMatchType ResourceMatchType `mapstructure:"match_type"` - - // ResourceAttributes defines a list of possible resource attributes to match logs against. - // A match occurs if any resource attribute matches all expressions in this given list. - ResourceAttributes []filterconfig.Attribute `mapstructure:"resource_attributes"` -} - -type ResourceMatchType string - // Validate checks if the processor configuration is valid func (cfg *Config) Validate() error { if (cfg.Traces.SpanConditions != nil || cfg.Traces.SpanEventConditions != nil) && (cfg.Spans.Include != nil || cfg.Spans.Exclude != nil) { @@ -305,9 +275,6 @@ func (cfg *Config) Validate() error { if cfg.Logs.LogConditions != nil && (cfg.Logs.Include != nil || cfg.Logs.Exclude != nil) { return fmt.Errorf("cannot use ottl conditions and include/exclude for logs at the same time") } - if cfg.Resources.ResourceConditions != nil && (cfg.Resources.Include != nil || cfg.Resources.Exclude != nil) { - return fmt.Errorf("cannot use ottl conditions and include/exclude for resources at the same time") - } var errors error @@ -336,18 +303,5 @@ func (cfg *Config) Validate() error { errors = multierr.Append(errors, err) } - if cfg.Logs.LogConditions != nil && cfg.Logs.Include != nil { - errors = multierr.Append(errors, cfg.Logs.Include.Validate()) - } - - if cfg.Logs.LogConditions != nil && cfg.Logs.Exclude != nil { - errors = multierr.Append(errors, cfg.Logs.Exclude.Validate()) - } - - if cfg.Resources.ResourceConditions != nil { - _, err := filterottl.NewBoolExprForResource(cfg.Resources.ResourceConditions, filterottl.StandardResourceFuncs(), ottl.PropagateError, component.TelemetrySettings{Logger: zap.NewNop()}) - errors = multierr.Append(errors, err) - } - return errors } From 414367b0c9f4b4551b81192a1564888678b2b386 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Thu, 5 Oct 2023 13:04:38 -0400 Subject: [PATCH 17/43] fix: revert changes to filter processor --- processor/filterprocessor/config.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/processor/filterprocessor/config.go b/processor/filterprocessor/config.go index 907ddf255783..3f517382fdda 100644 --- a/processor/filterprocessor/config.go +++ b/processor/filterprocessor/config.go @@ -206,8 +206,8 @@ type LogMatchProperties struct { LogBodies []string `mapstructure:"bodies"` } -// Validate checks that the LogMatchProperties is valid -func (lmp LogMatchProperties) Validate() error { +// validate checks that the LogMatchProperties is valid +func (lmp LogMatchProperties) validate() error { if lmp.SeverityNumberProperties != nil { return lmp.SeverityNumberProperties.validate() } @@ -303,5 +303,13 @@ func (cfg *Config) Validate() error { errors = multierr.Append(errors, err) } + if cfg.Logs.LogConditions != nil && cfg.Logs.Include != nil { + errors = multierr.Append(errors, cfg.Logs.Include.validate()) + } + + if cfg.Logs.LogConditions != nil && cfg.Logs.Exclude != nil { + errors = multierr.Append(errors, cfg.Logs.Exclude.validate()) + } + return errors } From 372171cfc3d31358c0aed7b1e8ed0b99fa590717 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Thu, 5 Oct 2023 13:06:28 -0400 Subject: [PATCH 18/43] fix: remove comments --- exporter/honeycombexporter/config.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/exporter/honeycombexporter/config.go b/exporter/honeycombexporter/config.go index eb33b20d5516..2e1afbfedc96 100644 --- a/exporter/honeycombexporter/config.go +++ b/exporter/honeycombexporter/config.go @@ -12,10 +12,6 @@ import ( "go.uber.org/zap" ) -/* -undo all changes to filterprocessor -*/ - */ // Config defines configuration for the Honeycomb Marker exporter. type Config struct { // APIKey is the authentication token associated with the Honeycomb account. From a8c920a6dc967424e0c6cbf53c0b1b2f8a24be49 Mon Sep 17 00:00:00 2001 From: Faith Chikwekwe Date: Thu, 5 Oct 2023 16:12:48 -0400 Subject: [PATCH 19/43] Update exporter/honeycombexporter/README.md Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> --- exporter/honeycombexporter/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/honeycombexporter/README.md b/exporter/honeycombexporter/README.md index 27ed438cd1fd..fc2f3a3462ec 100644 --- a/exporter/honeycombexporter/README.md +++ b/exporter/honeycombexporter/README.md @@ -1,7 +1,7 @@ @@ -0,0 +1,18 @@ # Honeycomb Marker Exporter -This exporter supports sending creating markers and sending them to the Honeycomb Markers API. +This exporter allows creating markers, via the Honeycomb Markers API, based on the look of incoming telemetry. The following configuration options are supported: From 03ba0bff8eb8bed1a5e7621fff743f61b43db1b2 Mon Sep 17 00:00:00 2001 From: Faith Chikwekwe Date: Fri, 6 Oct 2023 11:03:46 -0400 Subject: [PATCH 20/43] Update exporter/honeycombexporter/metadata.yaml Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> --- exporter/honeycombexporter/metadata.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/honeycombexporter/metadata.yaml b/exporter/honeycombexporter/metadata.yaml index ceac2de5a0de..51361e199f72 100644 --- a/exporter/honeycombexporter/metadata.yaml +++ b/exporter/honeycombexporter/metadata.yaml @@ -1,4 +1,4 @@ -type: honeycomb +type: honeycombmarker status: class: exporter From ec08d377fea4fdbb0033d8f9e31fb383f467e85f Mon Sep 17 00:00:00 2001 From: Faith Chikwekwe Date: Fri, 6 Oct 2023 11:03:57 -0400 Subject: [PATCH 21/43] Update .chloggen/feat_marker-exporter.yaml Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> --- .chloggen/feat_marker-exporter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/feat_marker-exporter.yaml b/.chloggen/feat_marker-exporter.yaml index 5f7688a33a20..3c0f0bcd3f85 100755 --- a/.chloggen/feat_marker-exporter.yaml +++ b/.chloggen/feat_marker-exporter.yaml @@ -4,7 +4,7 @@ change_type: 'new_component' # The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) -component: 'honeycombexporter' +component: 'honeycombmarkerexporter' # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). note: "This component will export markers to be consumed by the Honeycomb Markers API to highlight user events" From f21943a7134354306fc71aaf5d1418d37613363b Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Fri, 6 Oct 2023 12:01:06 -0400 Subject: [PATCH 22/43] test: update config test --- .github/CODEOWNERS | 2 +- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 2 +- .github/ISSUE_TEMPLATE/other.yaml | 2 +- exporter/honeycombexporter/config_test.go | 23 ++++++++-- exporter/honeycombexporter/factory.go | 16 ++----- .../honeycombexporter/testdata/config.yaml | 44 ++++++++++++------- versions.yaml | 2 +- 8 files changed, 56 insertions(+), 37 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7f2ff95ca2b7..c061d87b5747 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -61,7 +61,7 @@ exporter/fileexporter/ @open-te exporter/googlecloudexporter/ @open-telemetry/collector-contrib-approvers @aabmass @dashpole @jsuereth @punya @damemi @psx95 exporter/googlecloudpubsubexporter/ @open-telemetry/collector-contrib-approvers @alexvanboxel exporter/googlemanagedprometheusexporter/ @open-telemetry/collector-contrib-approvers @aabmass @dashpole @jsuereth @punya @damemi @psx95 -exporter/honeycombexporter/ @open-telemetry/collector-contrib-approvers @fchikwekwe @TylerHelmuth +exporter/honeycombmarkerexporter/ @open-telemetry/collector-contrib-approvers @fchikwekwe @TylerHelmuth exporter/influxdbexporter/ @open-telemetry/collector-contrib-approvers @jacobmarble exporter/instanaexporter/ @open-telemetry/collector-contrib-approvers @jpkrohling @hickeyma exporter/kafkaexporter/ @open-telemetry/collector-contrib-approvers @pavolloffay @MovieStoreGuy diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 3a3b98f8933c..d34855aa67c6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -54,7 +54,7 @@ body: - exporter/googlecloud - exporter/googlecloudpubsub - exporter/googlemanagedprometheus - - exporter/honeycombexporter + - exporter/honeycombmarkerexporter - exporter/influxdb - exporter/instana - exporter/kafka diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index b16163f1797d..57029d75e0bd 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -48,7 +48,7 @@ body: - exporter/googlecloud - exporter/googlecloudpubsub - exporter/googlemanagedprometheus - - exporter/honeycombexporter + - exporter/honeycombmarkerexporter - exporter/influxdb - exporter/instana - exporter/kafka diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index 9c9128820769..184504070dae 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -48,7 +48,7 @@ body: - exporter/googlecloud - exporter/googlecloudpubsub - exporter/googlemanagedprometheus - - exporter/honeycombexporter + - exporter/honeycombmarkerexporter - exporter/influxdb - exporter/instana - exporter/kafka diff --git a/exporter/honeycombexporter/config_test.go b/exporter/honeycombexporter/config_test.go index b1e6e72aaeee..3bfb419844e3 100644 --- a/exporter/honeycombexporter/config_test.go +++ b/exporter/honeycombexporter/config_test.go @@ -3,6 +3,7 @@ package honeycombexporter import ( + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter/internal/metadata" "path/filepath" "testing" @@ -18,7 +19,7 @@ func TestLoadConfig(t *testing.T) { cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml")) require.NoError(t, err) - defaultCfg := CreateDefaultConfig() + //defaultCfg := CreateDefaultConfig() tests := []struct { id component.ID @@ -26,8 +27,24 @@ func TestLoadConfig(t *testing.T) { }{ { - id: component.NewIDWithName("honeycomb", ""), - expected: defaultCfg, + id: component.NewIDWithName("honeycomb", ""), + expected: &Config{ + APIKey: "test-apikey", + APIURL: "https://api.testhost.io", + Markers: []marker{ + { + MarkerType: "fooType", + MessageField: "test message", + UrlField: "https://api.testhost.io", + }, + }, + }, + }, + { + id: component.NewIDWithName(metadata.Type, "bad_syntax_log"), + }, + { + id: component.NewIDWithName(metadata.Type, "unknown_log"), }, } diff --git a/exporter/honeycombexporter/factory.go b/exporter/honeycombexporter/factory.go index 3daf22eda73a..595bf91ee02e 100644 --- a/exporter/honeycombexporter/factory.go +++ b/exporter/honeycombexporter/factory.go @@ -23,19 +23,9 @@ func NewFactory() exporter.Factory { func CreateDefaultConfig() component.Config { return &Config{ - APIKey: "", - APIURL: "api.honeycomb.io:443", - Markers: []marker{ - { - MarkerType: "", - MessageField: "", - UrlField: "", - Rules: Rules{ - ResourceConditions: []string{}, - LogConditions: []string{}, - }, - }, - }, + APIKey: "", + APIURL: "", + Markers: []marker{}, } } diff --git a/exporter/honeycombexporter/testdata/config.yaml b/exporter/honeycombexporter/testdata/config.yaml index 743c2fdc7e7f..3065bf86bd5f 100644 --- a/exporter/honeycombexporter/testdata/config.yaml +++ b/exporter/honeycombexporter/testdata/config.yaml @@ -1,18 +1,30 @@ honeycomb: - apikey: - apiurl: http://localhost:8080/ + api_key: "test-apikey" + api_url: "https://api.testhost.io" markers: - - markertype: "type1", - messagefield: "test message", - urlfield: "http://localhost:8080/", - rules: - - resourceconditions: - - "ResourceCondition1" - - "ResourceCondition2" - - logconditions: - - "LogCondition1" - - "LogCondition2" - - markertype: "type2", - messagefield: "another test message", - urlfield: "http://localhost:8080/", - rules: + - marker_type: "fooType", + message_field: "test message", + url_field: "https://api.testhost.io", +# rules: +# - resource_conditions: +# - context: resource +# statements: +# - set(attributes["test"], []) +# - limit(attributes, 100, []) +# - log_conditions: +# - context: log +# statements: +# - set(attributes["foo"], foo) +# - markertype: "barType", +# messagefield: "another test message", +# urlfield: "http://localhost:8080/", +# rules: +# - resourceconditions: +# - context: resource +# statements: +# - keep_keys(attributes, ["test.name", "test.namespace") +# - limit(attributes, 100, []) +# - logconditions: +# - context: log +# statements: +# - set(attributes["bar"], bar) diff --git a/versions.yaml b/versions.yaml index 4ee16bf07b86..6b1a7932b69c 100644 --- a/versions.yaml +++ b/versions.yaml @@ -41,7 +41,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlemanagedprometheusexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudpubsubexporter - - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter + - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/influxdbexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/instanaexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/kafkaexporter From 5c55fd6824a9e84665be8c508762959fe31805ba Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Fri, 6 Oct 2023 13:50:46 -0400 Subject: [PATCH 23/43] test: add more config test cases --- exporter/honeycombexporter/config_test.go | 47 +++++++++- .../honeycombexporter/testdata/config.yaml | 94 ++++++++++++++----- 2 files changed, 114 insertions(+), 27 deletions(-) diff --git a/exporter/honeycombexporter/config_test.go b/exporter/honeycombexporter/config_test.go index 3bfb419844e3..2d891288870e 100644 --- a/exporter/honeycombexporter/config_test.go +++ b/exporter/honeycombexporter/config_test.go @@ -36,6 +36,36 @@ func TestLoadConfig(t *testing.T) { MarkerType: "fooType", MessageField: "test message", UrlField: "https://api.testhost.io", + Rules: Rules{ + ResourceConditions: []string{ + `IsMatch(attributes["test"], ".*")`, + }, + LogConditions: []string{ + `body == "test"`, + }, + }, + }, + }, + }, + }, + { + id: component.NewIDWithName("honeycomb", "color_no_type"), + expected: &Config{ + APIKey: "test-apikey", + APIURL: "https://api.testhost.io", + Markers: []marker{ + { + MarkerColor: "green", + MessageField: "test message", + UrlField: "https://api.testhost.io", + Rules: Rules{ + ResourceConditions: []string{ + `IsMatch(attributes["test"], ".*")`, + }, + LogConditions: []string{ + `body == "test"`, + }, + }, }, }, }, @@ -44,7 +74,16 @@ func TestLoadConfig(t *testing.T) { id: component.NewIDWithName(metadata.Type, "bad_syntax_log"), }, { - id: component.NewIDWithName(metadata.Type, "unknown_log"), + id: component.NewIDWithName(metadata.Type, "no_conditions"), + }, + { + id: component.NewIDWithName(metadata.Type, "no_api_key"), + }, + { + id: component.NewIDWithName(metadata.Type, "no_api_url"), + }, + { + id: component.NewIDWithName(metadata.Type, "no_marker_message"), }, } @@ -57,6 +96,12 @@ func TestLoadConfig(t *testing.T) { require.NoError(t, err) require.NoError(t, component.UnmarshalConfig(sub, cfg)) + if tt.expected == nil { + err = component.ValidateConfig(cfg) + assert.Error(t, err) + return + } + assert.NoError(t, component.ValidateConfig(cfg)) assert.Equal(t, tt.expected, cfg) }) diff --git a/exporter/honeycombexporter/testdata/config.yaml b/exporter/honeycombexporter/testdata/config.yaml index 3065bf86bd5f..399f7344b5c8 100644 --- a/exporter/honeycombexporter/testdata/config.yaml +++ b/exporter/honeycombexporter/testdata/config.yaml @@ -2,29 +2,71 @@ honeycomb: api_key: "test-apikey" api_url: "https://api.testhost.io" markers: - - marker_type: "fooType", - message_field: "test message", - url_field: "https://api.testhost.io", -# rules: -# - resource_conditions: -# - context: resource -# statements: -# - set(attributes["test"], []) -# - limit(attributes, 100, []) -# - log_conditions: -# - context: log -# statements: -# - set(attributes["foo"], foo) -# - markertype: "barType", -# messagefield: "another test message", -# urlfield: "http://localhost:8080/", -# rules: -# - resourceconditions: -# - context: resource -# statements: -# - keep_keys(attributes, ["test.name", "test.namespace") -# - limit(attributes, 100, []) -# - logconditions: -# - context: log -# statements: -# - set(attributes["bar"], bar) + - type: "fooType" + message_field: "test message" + url_field: "https://api.testhost.io" + rules: + resource_conditions: + - IsMatch(attributes["test"], ".*") + log_conditions: + - body == "test" + +honeycomb/color_no_type: + api_key: "test-apikey" + api_url: "https://api.testhost.io" + markers: + - color: "green" + message_field: "test message" + url_field: "https://api.testhost.io" + rules: + resource_conditions: + - IsMatch(attributes["test"], ".*") + log_conditions: + - body == "test" + +honeycomb/bad_syntax_log: + api_key: "test-apikey" + api_url: "https://api.testhost.io" + markers: + - type: "fooType" + message_field: "test message" + url_field: "https://api.testhost.io" + rules: + log_conditions: + - body == "test" + - set(attributes["body"], body) + +honeycomb/no_conditions: + api_key: "test-apikey" + api_url: "https://api.testhost.io" + markers: + - color: "green" + message_field: "test message" + url_field: "https://api.testhost.io" + rules: + +honeycomb/no_api_key: + api_key: "" + api_url: "https://api.testhost.io" + markers: + - type: "fooType" + message_field: "test message" + url_field: "https://api.testhost.io" + rules: + resource_conditions: + - IsMatch(attributes["test"], ".*") + log_conditions: + - body == "test" + +honeycomb/no_api_url: + api_key: "test-apikey" + api_url: "" + markers: + - type: "fooType" + message_field: "test message" + url_field: "https://api.testhost.io" + rules: + resource_conditions: + - IsMatch(attributes["test"], ".*") + log_conditions: + - body == "test" \ No newline at end of file From bab5a8ba62fda65c62a7e07eaccb3579170df15e Mon Sep 17 00:00:00 2001 From: Faith Chikwekwe Date: Fri, 6 Oct 2023 14:19:00 -0400 Subject: [PATCH 24/43] Update exporter/honeycombexporter/factory.go Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> --- exporter/honeycombexporter/factory.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/honeycombexporter/factory.go b/exporter/honeycombexporter/factory.go index 595bf91ee02e..d9a3a1d10ae5 100644 --- a/exporter/honeycombexporter/factory.go +++ b/exporter/honeycombexporter/factory.go @@ -24,7 +24,7 @@ func NewFactory() exporter.Factory { func CreateDefaultConfig() component.Config { return &Config{ APIKey: "", - APIURL: "", + APIURL: "api.honeycomb.io:443", Markers: []marker{}, } } From 3981adc029da58dd309122247b4f32c13f212ba5 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 12:04:14 -0400 Subject: [PATCH 25/43] test: fix no api url case --- exporter/honeycombexporter/config.go | 10 ++++++---- exporter/honeycombexporter/config_test.go | 8 +------- exporter/honeycombexporter/factory.go | 2 +- exporter/honeycombexporter/logs_exporter.go | 8 +++++--- exporter/honeycombexporter/testdata/config.yaml | 8 +++++++- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/exporter/honeycombexporter/config.go b/exporter/honeycombexporter/config.go index 2e1afbfedc96..4a82a059386e 100644 --- a/exporter/honeycombexporter/config.go +++ b/exporter/honeycombexporter/config.go @@ -51,13 +51,15 @@ type Rules struct { LogConditions []string `mapstructure:"log_conditions"` } +var defaultCfg = CreateDefaultConfig().(*Config) + func (cfg *Config) Validate() error { - if cfg.APIKey == "" { - return fmt.Errorf("invalid API Key") + if cfg == nil { + *cfg = *defaultCfg } - if cfg.APIURL == "" { - return fmt.Errorf("invalid URL") + if cfg.APIKey == "" { + return fmt.Errorf("invalid API Key") } if len(cfg.Markers) != 0 { diff --git a/exporter/honeycombexporter/config_test.go b/exporter/honeycombexporter/config_test.go index 2d891288870e..ca95ff800a0f 100644 --- a/exporter/honeycombexporter/config_test.go +++ b/exporter/honeycombexporter/config_test.go @@ -19,13 +19,10 @@ func TestLoadConfig(t *testing.T) { cm, err := confmaptest.LoadConf(filepath.Join("testdata", "config.yaml")) require.NoError(t, err) - //defaultCfg := CreateDefaultConfig() - tests := []struct { id component.ID expected component.Config }{ - { id: component.NewIDWithName("honeycomb", ""), expected: &Config{ @@ -80,10 +77,7 @@ func TestLoadConfig(t *testing.T) { id: component.NewIDWithName(metadata.Type, "no_api_key"), }, { - id: component.NewIDWithName(metadata.Type, "no_api_url"), - }, - { - id: component.NewIDWithName(metadata.Type, "no_marker_message"), + id: component.NewIDWithName(metadata.Type, "no_markers_supplied"), }, } diff --git a/exporter/honeycombexporter/factory.go b/exporter/honeycombexporter/factory.go index 595bf91ee02e..d9a3a1d10ae5 100644 --- a/exporter/honeycombexporter/factory.go +++ b/exporter/honeycombexporter/factory.go @@ -24,7 +24,7 @@ func NewFactory() exporter.Factory { func CreateDefaultConfig() component.Config { return &Config{ APIKey: "", - APIURL: "", + APIURL: "api.honeycomb.io:443", Markers: []marker{}, } } diff --git a/exporter/honeycombexporter/logs_exporter.go b/exporter/honeycombexporter/logs_exporter.go index e4f5a735e33d..a59af1622f0b 100644 --- a/exporter/honeycombexporter/logs_exporter.go +++ b/exporter/honeycombexporter/logs_exporter.go @@ -11,12 +11,14 @@ import ( ) type honeycombLogsExporter struct { - logger *zap.Logger + logger *zap.Logger + markers []marker } -func newLogsExporter(logger *zap.Logger, _ *Config) *honeycombLogsExporter { +func newLogsExporter(logger *zap.Logger, config *Config) *honeycombLogsExporter { logsExp := &honeycombLogsExporter{ - logger: logger, + logger: logger, + markers: config.Markers, } return logsExp } diff --git a/exporter/honeycombexporter/testdata/config.yaml b/exporter/honeycombexporter/testdata/config.yaml index 399f7344b5c8..3ca6508c9ffb 100644 --- a/exporter/honeycombexporter/testdata/config.yaml +++ b/exporter/honeycombexporter/testdata/config.yaml @@ -69,4 +69,10 @@ honeycomb/no_api_url: resource_conditions: - IsMatch(attributes["test"], ".*") log_conditions: - - body == "test" \ No newline at end of file + - body == "test" + +honeycomb/no_markers_supplied: + api_key: "test-apikey" + api_url: "https://api.testhost.io" + markers: + From fe609830acf07ad3d1d698e904b37ea3989a1327 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 12:21:50 -0400 Subject: [PATCH 26/43] fix: update license in config test --- exporter/honeycombexporter/config_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/exporter/honeycombexporter/config_test.go b/exporter/honeycombexporter/config_test.go index ca95ff800a0f..8f11b3181d7b 100644 --- a/exporter/honeycombexporter/config_test.go +++ b/exporter/honeycombexporter/config_test.go @@ -1,3 +1,4 @@ +// Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 package honeycombexporter From 1cf336fc91c6216beee8f8481b7ee060a1026adf Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 12:31:10 -0400 Subject: [PATCH 27/43] fix: rename exporter pkg --- exporter/honeycombexporter/doc.go | 7 ------- .../Makefile | 0 .../README.md | 0 .../config.go | 2 +- .../config_test.go | 4 ++-- exporter/honeycombmarkerexporter/doc.go | 7 +++++++ .../factory.go | 4 ++-- .../factory_test.go | 2 +- .../internal/metadata/generated_status.go | 0 .../logs_exporter.go | 2 +- .../metadata.yaml | 0 .../testdata/config.yaml | 0 12 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 exporter/honeycombexporter/doc.go rename exporter/{honeycombexporter => honeycombmarkerexporter}/Makefile (100%) rename exporter/{honeycombexporter => honeycombmarkerexporter}/README.md (100%) rename exporter/{honeycombexporter => honeycombmarkerexporter}/config.go (95%) rename exporter/{honeycombexporter => honeycombmarkerexporter}/config_test.go (96%) create mode 100644 exporter/honeycombmarkerexporter/doc.go rename exporter/{honeycombexporter => honeycombmarkerexporter}/factory.go (83%) rename exporter/{honeycombexporter => honeycombmarkerexporter}/factory_test.go (96%) rename exporter/{honeycombexporter => honeycombmarkerexporter}/internal/metadata/generated_status.go (100%) rename exporter/{honeycombexporter => honeycombmarkerexporter}/logs_exporter.go (79%) rename exporter/{honeycombexporter => honeycombmarkerexporter}/metadata.yaml (100%) rename exporter/{honeycombexporter => honeycombmarkerexporter}/testdata/config.yaml (100%) diff --git a/exporter/honeycombexporter/doc.go b/exporter/honeycombexporter/doc.go deleted file mode 100644 index 6809be8e45ec..000000000000 --- a/exporter/honeycombexporter/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -//go:generate mdatagen metadata.yaml - -// Package honeycombexporter exports marker data to Honeycomb. -package honeycombexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter" diff --git a/exporter/honeycombexporter/Makefile b/exporter/honeycombmarkerexporter/Makefile similarity index 100% rename from exporter/honeycombexporter/Makefile rename to exporter/honeycombmarkerexporter/Makefile diff --git a/exporter/honeycombexporter/README.md b/exporter/honeycombmarkerexporter/README.md similarity index 100% rename from exporter/honeycombexporter/README.md rename to exporter/honeycombmarkerexporter/README.md diff --git a/exporter/honeycombexporter/config.go b/exporter/honeycombmarkerexporter/config.go similarity index 95% rename from exporter/honeycombexporter/config.go rename to exporter/honeycombmarkerexporter/config.go index 4a82a059386e..a9e1d8fd36cb 100644 --- a/exporter/honeycombexporter/config.go +++ b/exporter/honeycombmarkerexporter/config.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package honeycombexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter" +package honeycombmarkerexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter" import ( "fmt" diff --git a/exporter/honeycombexporter/config_test.go b/exporter/honeycombmarkerexporter/config_test.go similarity index 96% rename from exporter/honeycombexporter/config_test.go rename to exporter/honeycombmarkerexporter/config_test.go index 8f11b3181d7b..3456ab69aef7 100644 --- a/exporter/honeycombexporter/config_test.go +++ b/exporter/honeycombmarkerexporter/config_test.go @@ -1,10 +1,10 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package honeycombexporter +package honeycombmarkerexporter import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter/internal/metadata" "path/filepath" "testing" diff --git a/exporter/honeycombmarkerexporter/doc.go b/exporter/honeycombmarkerexporter/doc.go new file mode 100644 index 000000000000..aeb818ce09c9 --- /dev/null +++ b/exporter/honeycombmarkerexporter/doc.go @@ -0,0 +1,7 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:generate mdatagen metadata.yaml + +// Package honeycombmarkerexporter exports marker data to Honeycomb. +package honeycombmarkerexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter" diff --git a/exporter/honeycombexporter/factory.go b/exporter/honeycombmarkerexporter/factory.go similarity index 83% rename from exporter/honeycombexporter/factory.go rename to exporter/honeycombmarkerexporter/factory.go index d9a3a1d10ae5..774aa4a2c801 100644 --- a/exporter/honeycombexporter/factory.go +++ b/exporter/honeycombmarkerexporter/factory.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package honeycombexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter" +package honeycombmarkerexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter" import ( "context" @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper" - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter/internal/metadata" ) func NewFactory() exporter.Factory { diff --git a/exporter/honeycombexporter/factory_test.go b/exporter/honeycombmarkerexporter/factory_test.go similarity index 96% rename from exporter/honeycombexporter/factory_test.go rename to exporter/honeycombmarkerexporter/factory_test.go index a1746d41988d..8b3fce63d577 100644 --- a/exporter/honeycombexporter/factory_test.go +++ b/exporter/honeycombmarkerexporter/factory_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package honeycombexporter +package honeycombmarkerexporter import ( "context" diff --git a/exporter/honeycombexporter/internal/metadata/generated_status.go b/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go similarity index 100% rename from exporter/honeycombexporter/internal/metadata/generated_status.go rename to exporter/honeycombmarkerexporter/internal/metadata/generated_status.go diff --git a/exporter/honeycombexporter/logs_exporter.go b/exporter/honeycombmarkerexporter/logs_exporter.go similarity index 79% rename from exporter/honeycombexporter/logs_exporter.go rename to exporter/honeycombmarkerexporter/logs_exporter.go index a59af1622f0b..95e7ba3cd7c5 100644 --- a/exporter/honeycombexporter/logs_exporter.go +++ b/exporter/honeycombmarkerexporter/logs_exporter.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package honeycombexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombexporter" +package honeycombmarkerexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter" import ( "context" diff --git a/exporter/honeycombexporter/metadata.yaml b/exporter/honeycombmarkerexporter/metadata.yaml similarity index 100% rename from exporter/honeycombexporter/metadata.yaml rename to exporter/honeycombmarkerexporter/metadata.yaml diff --git a/exporter/honeycombexporter/testdata/config.yaml b/exporter/honeycombmarkerexporter/testdata/config.yaml similarity index 100% rename from exporter/honeycombexporter/testdata/config.yaml rename to exporter/honeycombmarkerexporter/testdata/config.yaml From c0014ccdb82e9256f0ff680ea3fda7eb41356d3f Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 12:47:44 -0400 Subject: [PATCH 28/43] fix: comply with linter --- exporter/honeycombmarkerexporter/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exporter/honeycombmarkerexporter/config.go b/exporter/honeycombmarkerexporter/config.go index a9e1d8fd36cb..bfc123676530 100644 --- a/exporter/honeycombmarkerexporter/config.go +++ b/exporter/honeycombmarkerexporter/config.go @@ -35,9 +35,9 @@ type marker struct { // If necessary the value will be converted to a string. MessageField string `mapstructure:"message_field"` - // UrlField is the attribute that will be used as the url. + // URLField is the attribute that will be used as the url. // If necessary the value will be converted to a string. - UrlField string `mapstructure:"url_field"` + URLField string `mapstructure:"url_field"` // Rules are the OTTL rules that determine when a piece of telemetry should be turned into a Marker Rules Rules `mapstructure:"rules"` @@ -55,7 +55,7 @@ var defaultCfg = CreateDefaultConfig().(*Config) func (cfg *Config) Validate() error { if cfg == nil { - *cfg = *defaultCfg + cfg = defaultCfg } if cfg.APIKey == "" { From 7e8da90c2fd08486e9dd1e91da0b6c8d5ffff63a Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 12:59:59 -0400 Subject: [PATCH 29/43] fix: update url fields in config test --- exporter/honeycombmarkerexporter/config_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter/honeycombmarkerexporter/config_test.go b/exporter/honeycombmarkerexporter/config_test.go index 3456ab69aef7..2654cb83488c 100644 --- a/exporter/honeycombmarkerexporter/config_test.go +++ b/exporter/honeycombmarkerexporter/config_test.go @@ -33,7 +33,7 @@ func TestLoadConfig(t *testing.T) { { MarkerType: "fooType", MessageField: "test message", - UrlField: "https://api.testhost.io", + URLField: "https://api.testhost.io", Rules: Rules{ ResourceConditions: []string{ `IsMatch(attributes["test"], ".*")`, @@ -55,7 +55,7 @@ func TestLoadConfig(t *testing.T) { { MarkerColor: "green", MessageField: "test message", - UrlField: "https://api.testhost.io", + URLField: "https://api.testhost.io", Rules: Rules{ ResourceConditions: []string{ `IsMatch(attributes["test"], ".*")`, From 9573c1328b09e097ad026ae8519c8d8093be04d1 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 16:02:51 -0400 Subject: [PATCH 30/43] chore: add go mod file --- exporter/honeycombmarkerexporter/config.go | 6 +- .../honeycombmarkerexporter/config_test.go | 3 +- exporter/honeycombmarkerexporter/go.mod | 56 +++++ exporter/honeycombmarkerexporter/go.sum | 234 ++++++++++++++++++ 4 files changed, 296 insertions(+), 3 deletions(-) create mode 100644 exporter/honeycombmarkerexporter/go.mod create mode 100644 exporter/honeycombmarkerexporter/go.sum diff --git a/exporter/honeycombmarkerexporter/config.go b/exporter/honeycombmarkerexporter/config.go index bfc123676530..be3e6657f25c 100644 --- a/exporter/honeycombmarkerexporter/config.go +++ b/exporter/honeycombmarkerexporter/config.go @@ -5,11 +5,13 @@ package honeycombmarkerexporter // import "github.com/open-telemetry/opentelemet import ( "fmt" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterottl" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/configopaque" "go.uber.org/zap" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) // Config defines configuration for the Honeycomb Marker exporter. diff --git a/exporter/honeycombmarkerexporter/config_test.go b/exporter/honeycombmarkerexporter/config_test.go index 2654cb83488c..0cab3b7152b8 100644 --- a/exporter/honeycombmarkerexporter/config_test.go +++ b/exporter/honeycombmarkerexporter/config_test.go @@ -4,7 +4,6 @@ package honeycombmarkerexporter import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter/internal/metadata" "path/filepath" "testing" @@ -12,6 +11,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap/confmaptest" + + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter/internal/metadata" ) func TestLoadConfig(t *testing.T) { diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod new file mode 100644 index 000000000000..d6d2b6016578 --- /dev/null +++ b/exporter/honeycombmarkerexporter/go.mod @@ -0,0 +1,56 @@ +module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter + +go 1.20 + +require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.86.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.86.0 + github.com/stretchr/testify v1.8.4 + go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7 + go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7 + go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7 + go.opentelemetry.io/collector/exporter v0.86.1-0.20231006161201-d364ad61c4d7 + go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 + go.uber.org/zap v1.26.0 +) + +require ( + github.com/alecthomas/participle/v2 v2.1.0 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gobwas/glob v0.2.3 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/uuid v1.3.1 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect + github.com/knadh/koanf/providers/confmap v0.1.0 // indirect + github.com/knadh/koanf/v2 v2.0.1 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect + 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/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.86.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/collector v0.86.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.86.0 // indirect + go.opentelemetry.io/collector/consumer v0.86.0 // indirect + go.opentelemetry.io/collector/extension v0.86.0 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect + go.opentelemetry.io/otel v1.19.0 // indirect + go.opentelemetry.io/otel/metric v1.19.0 // indirect + go.opentelemetry.io/otel/trace v1.19.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect + google.golang.org/grpc v1.58.2 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum new file mode 100644 index 000000000000..741fb61bfce2 --- /dev/null +++ b/exporter/honeycombmarkerexporter/go.sum @@ -0,0 +1,234 @@ +cloud.google.com/go v0.26.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/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0= +github.com/alecthomas/participle/v2 v2.1.0 h1:z7dElHRrOEEq45F2TG5cbQihMtNTv8vwldytDj7Wrz4= +github.com/alecthomas/participle/v2 v2.1.0/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c= +github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= +github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= +github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.86.0 h1:HEuJ7hCbLVfoL7xLrGQ2QORvocyFfWuaoDuzyTLwTdc= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.86.0/go.mod h1:ss8TG43W1xNke9aeI0uTIVpyXW5OmYslxMj01UMdjR8= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.86.0 h1:T6nMIqOKajxMP9X7Dq+BBAu+eg17k9QBNx430+ki5Dk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.86.0/go.mod h1:g6Iv48KbwXtstNrET5bDEfJwGnBxFJntxaCba1bDIIg= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.86.0 h1:dREgPRZ0kOc2ZEynRSILn6T2Ds7RTr9j4W28XyboK60= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.86.0/go.mod h1:fRwCRopq4cIHr6CvLyPEfda7zIlkaWNtxY/OBBliBI8= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/collector v0.86.0 h1:Yxu0muUws9e7HG+5DDiYajkfAeOo/riUv0sJO4E9rXA= +go.opentelemetry.io/collector v0.86.0/go.mod h1:HoXzPE/mJMN4jy5E1cSUMznxkKFiGAGJbkguzpnq5ak= +go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7 h1:Ptp2HfFfv2X3GmJdxejnNmLR9SqWyXsHh41z2JvuFcQ= +go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:CK7+gkTy4z3doM0E02nFMYr+4ukIWUIBNWqpTZuXGlQ= +go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7 h1:mT9H5U+wIW7lPvny0cNClJvl5lnaAztJdM3aeS/sh8M= +go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:TPCHaU+QXiEV+JXbgyr6mSErTI9chwQyasDVMdJr3eY= +go.opentelemetry.io/collector/config/configtelemetry v0.86.0 h1:xMqeL/gz7ZwZKRB58WYimEGU+Lvbzo5zd99uihjkMZY= +go.opentelemetry.io/collector/config/configtelemetry v0.86.0/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7 h1:EwSO/+XDjXcIUiZcsWVG37oiQ4TkIGk/LM7Dd3CTopQ= +go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:vJms49x98lXUR7Mj6/28eXV+Otn3dDQpc+Znvex9Z84= +go.opentelemetry.io/collector/consumer v0.86.0 h1:8AL9I30tJV01KfcSaa+8DTiARIiUDA8o2p7yQoSFUCs= +go.opentelemetry.io/collector/consumer v0.86.0/go.mod h1:SvoV1eto4VZzQ3ILKQ1rv4qgN8rUMJqupn78hoXLHRw= +go.opentelemetry.io/collector/exporter v0.86.1-0.20231006161201-d364ad61c4d7 h1:5rJMxvZdAgur/W84ig9MHa5PtMOmTPkwXNyZSstvGXY= +go.opentelemetry.io/collector/exporter v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:KJtz08Y/JWDf7q1ekd1JKN/W6w75Up3Y+Ly5Ob1JG0k= +go.opentelemetry.io/collector/extension v0.86.0 h1:oXnZarkh1aBgnr/U3JSj/lPpBJUquOQ3DHMXXP4Jacc= +go.opentelemetry.io/collector/extension v0.86.0/go.mod h1:EPAloXQ+48577GvHTP5wGDvV4OyHPuldvM+2rYbM/fw= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 h1:Wv8JFRUD01MwWkhZwF85to5oukHDFPRjnt88ArDFqco= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 h1:Hrh7jB148ml4SbGsEuQFFcOpBebwpgf6UXM+PvdU9bQ= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7/go.mod h1:OdN0alYOlYhHXu6BDlGehrZWgtBuiDsz/rlNeJeXiNg= +go.opentelemetry.io/collector/processor v0.86.0 h1:b4Htiom5mgcM5d7Memw1NkxBKgOADF1je0mLIhulQUM= +go.opentelemetry.io/collector/receiver v0.86.0 h1:AP+KZ225CmXR1oBD36+vV/pZcRFTkSiG7HvAVqfHoRg= +go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= +go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= +go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA= +go.opentelemetry.io/otel/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= +go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k= +go.opentelemetry.io/otel/trace v1.19.0 h1:DFVQmlVbfVeOuBRrwdtaehRrWiL1JoVs9CPIQ1Dzxpg= +go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= +golang.org/x/exp v0.0.0-20230711023510-fffb14384f22/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= +google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From c75e2e834701dec2b9fb1fa161d3373e8d62f2b1 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 16:31:21 -0400 Subject: [PATCH 31/43] chore: update deps --- exporter/honeycombmarkerexporter/go.mod | 2 +- exporter/honeycombmarkerexporter/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index d6d2b6016578..430ae67ea509 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -37,7 +37,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.86.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.86.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/consumer v0.86.0 // indirect go.opentelemetry.io/collector/extension v0.86.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index 741fb61bfce2..995ca827049b 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -117,8 +117,8 @@ go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7 h1 go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:CK7+gkTy4z3doM0E02nFMYr+4ukIWUIBNWqpTZuXGlQ= go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7 h1:mT9H5U+wIW7lPvny0cNClJvl5lnaAztJdM3aeS/sh8M= go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:TPCHaU+QXiEV+JXbgyr6mSErTI9chwQyasDVMdJr3eY= -go.opentelemetry.io/collector/config/configtelemetry v0.86.0 h1:xMqeL/gz7ZwZKRB58WYimEGU+Lvbzo5zd99uihjkMZY= -go.opentelemetry.io/collector/config/configtelemetry v0.86.0/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7 h1:RfQsuqBZmiAfLp80shP8JOLUhEkErnil8RSi5MD/rls= +go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7 h1:EwSO/+XDjXcIUiZcsWVG37oiQ4TkIGk/LM7Dd3CTopQ= go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:vJms49x98lXUR7Mj6/28eXV+Otn3dDQpc+Znvex9Z84= go.opentelemetry.io/collector/consumer v0.86.0 h1:8AL9I30tJV01KfcSaa+8DTiARIiUDA8o2p7yQoSFUCs= From c29a3a89453c0c574f29daa3470ae0a92e0ea569 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 16:55:52 -0400 Subject: [PATCH 32/43] chore: update deps and comply with linter --- exporter/honeycombmarkerexporter/config.go | 2 +- exporter/honeycombmarkerexporter/config_test.go | 2 +- exporter/honeycombmarkerexporter/factory.go | 4 ++-- exporter/honeycombmarkerexporter/go.mod | 5 ++--- exporter/honeycombmarkerexporter/go.sum | 2 ++ 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/exporter/honeycombmarkerexporter/config.go b/exporter/honeycombmarkerexporter/config.go index be3e6657f25c..628f1a0c0dc9 100644 --- a/exporter/honeycombmarkerexporter/config.go +++ b/exporter/honeycombmarkerexporter/config.go @@ -53,7 +53,7 @@ type Rules struct { LogConditions []string `mapstructure:"log_conditions"` } -var defaultCfg = CreateDefaultConfig().(*Config) +var defaultCfg = createDefaultConfig().(*Config) func (cfg *Config) Validate() error { if cfg == nil { diff --git a/exporter/honeycombmarkerexporter/config_test.go b/exporter/honeycombmarkerexporter/config_test.go index 0cab3b7152b8..867ab5fdcdd4 100644 --- a/exporter/honeycombmarkerexporter/config_test.go +++ b/exporter/honeycombmarkerexporter/config_test.go @@ -105,7 +105,7 @@ func TestLoadConfig(t *testing.T) { } func withDefaultConfig(fns ...func(*Config)) *Config { - cfg := CreateDefaultConfig().(*Config) + cfg := createDefaultConfig().(*Config) for _, fn := range fns { fn(cfg) } diff --git a/exporter/honeycombmarkerexporter/factory.go b/exporter/honeycombmarkerexporter/factory.go index 774aa4a2c801..72d12dff26f8 100644 --- a/exporter/honeycombmarkerexporter/factory.go +++ b/exporter/honeycombmarkerexporter/factory.go @@ -16,12 +16,12 @@ import ( func NewFactory() exporter.Factory { return exporter.NewFactory( metadata.Type, - CreateDefaultConfig, + createDefaultConfig, exporter.WithLogs(createLogsExporter, metadata.LogsStability), ) } -func CreateDefaultConfig() component.Config { +func createDefaultConfig() component.Config { return &Config{ APIKey: "", APIURL: "api.honeycomb.io:443", diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index 430ae67ea509..a0fb2f7aa0f4 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -38,9 +38,8 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.86.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7 // indirect - go.opentelemetry.io/collector/consumer v0.86.0 // indirect - go.opentelemetry.io/collector/extension v0.86.0 // indirect - go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect + go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7 // indirect + go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index 995ca827049b..e7e17201ce72 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -123,10 +123,12 @@ go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7 h1:E go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:vJms49x98lXUR7Mj6/28eXV+Otn3dDQpc+Znvex9Z84= go.opentelemetry.io/collector/consumer v0.86.0 h1:8AL9I30tJV01KfcSaa+8DTiARIiUDA8o2p7yQoSFUCs= go.opentelemetry.io/collector/consumer v0.86.0/go.mod h1:SvoV1eto4VZzQ3ILKQ1rv4qgN8rUMJqupn78hoXLHRw= +go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:bOVFVPhtghkI+jmRT/E7Sig0wXTV4eU3aoYyZyrt2z8= go.opentelemetry.io/collector/exporter v0.86.1-0.20231006161201-d364ad61c4d7 h1:5rJMxvZdAgur/W84ig9MHa5PtMOmTPkwXNyZSstvGXY= go.opentelemetry.io/collector/exporter v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:KJtz08Y/JWDf7q1ekd1JKN/W6w75Up3Y+Ly5Ob1JG0k= go.opentelemetry.io/collector/extension v0.86.0 h1:oXnZarkh1aBgnr/U3JSj/lPpBJUquOQ3DHMXXP4Jacc= go.opentelemetry.io/collector/extension v0.86.0/go.mod h1:EPAloXQ+48577GvHTP5wGDvV4OyHPuldvM+2rYbM/fw= +go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:YD+b2rB+kROkpMvWQF55Y0XR9mZPqR6200Ek2ffy3Uc= go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 h1:Wv8JFRUD01MwWkhZwF85to5oukHDFPRjnt88ArDFqco= go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 h1:Hrh7jB148ml4SbGsEuQFFcOpBebwpgf6UXM+PvdU9bQ= From 5c856ce28f0d759493929ab3978917abb501b647 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:09:19 -0600 Subject: [PATCH 33/43] Update exporter/honeycombmarkerexporter/go.mod --- exporter/honeycombmarkerexporter/go.mod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index a0fb2f7aa0f4..d6c4441b0210 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -39,7 +39,8 @@ require ( go.opentelemetry.io/collector v0.86.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7 // indirect - go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect + go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect From 09a68e53031727dc8ce840053733159dea4bcbbd Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 17:13:15 -0400 Subject: [PATCH 34/43] chore: fix go mod --- exporter/honeycombmarkerexporter/go.mod | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index a0fb2f7aa0f4..d6c4441b0210 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -39,7 +39,8 @@ require ( go.opentelemetry.io/collector v0.86.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7 // indirect - go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect + go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect From 35f2be85ff51ddedac40c78de280962d6ac729c4 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 17:21:22 -0400 Subject: [PATCH 35/43] chore: update deps --- exporter/honeycombmarkerexporter/go.mod | 2 +- exporter/honeycombmarkerexporter/go.sum | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index d6c4441b0210..a69b55e0f932 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -40,7 +40,7 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7 // indirect - go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index e7e17201ce72..b4e27ba240b9 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -121,16 +121,14 @@ go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d3 go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7 h1:EwSO/+XDjXcIUiZcsWVG37oiQ4TkIGk/LM7Dd3CTopQ= go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:vJms49x98lXUR7Mj6/28eXV+Otn3dDQpc+Znvex9Z84= -go.opentelemetry.io/collector/consumer v0.86.0 h1:8AL9I30tJV01KfcSaa+8DTiARIiUDA8o2p7yQoSFUCs= -go.opentelemetry.io/collector/consumer v0.86.0/go.mod h1:SvoV1eto4VZzQ3ILKQ1rv4qgN8rUMJqupn78hoXLHRw= +go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7 h1:sTPyKQ5M7gvRmO72+qFmOv3y0YmxK0gyCHFoL/Ap1TQ= go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:bOVFVPhtghkI+jmRT/E7Sig0wXTV4eU3aoYyZyrt2z8= go.opentelemetry.io/collector/exporter v0.86.1-0.20231006161201-d364ad61c4d7 h1:5rJMxvZdAgur/W84ig9MHa5PtMOmTPkwXNyZSstvGXY= go.opentelemetry.io/collector/exporter v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:KJtz08Y/JWDf7q1ekd1JKN/W6w75Up3Y+Ly5Ob1JG0k= -go.opentelemetry.io/collector/extension v0.86.0 h1:oXnZarkh1aBgnr/U3JSj/lPpBJUquOQ3DHMXXP4Jacc= -go.opentelemetry.io/collector/extension v0.86.0/go.mod h1:EPAloXQ+48577GvHTP5wGDvV4OyHPuldvM+2rYbM/fw= +go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7 h1:WP77l9R3XeCKlCdevYr2pSYlibs728w3GANuqKQpq4k= go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:YD+b2rB+kROkpMvWQF55Y0XR9mZPqR6200Ek2ffy3Uc= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015 h1:Wv8JFRUD01MwWkhZwF85to5oukHDFPRjnt88ArDFqco= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 h1:0jyd3Kz63QVV6fWB2a0tKWH11fIqBE7oO2bETDiQGCI= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 h1:Hrh7jB148ml4SbGsEuQFFcOpBebwpgf6UXM+PvdU9bQ= go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7/go.mod h1:OdN0alYOlYhHXu6BDlGehrZWgtBuiDsz/rlNeJeXiNg= go.opentelemetry.io/collector/processor v0.86.0 h1:b4Htiom5mgcM5d7Memw1NkxBKgOADF1je0mLIhulQUM= From 19a1cf6f7dde9d8fb1fd8d9d49de142b0d04e772 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 17:45:36 -0400 Subject: [PATCH 36/43] chore: update crosslink --- exporter/honeycombmarkerexporter/go.mod | 20 +++++++++++++++----- exporter/honeycombmarkerexporter/go.sum | 20 ++++++-------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index a69b55e0f932..6554f6b9fc12 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.86.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.86.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.86.1-0.20231006161201-d364ad61c4d7 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7 go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7 @@ -33,10 +33,10 @@ 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/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.86.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.86.1-0.20231006161201-d364ad61c4d7 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/collector v0.86.0 // indirect + go.opentelemetry.io/collector v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7 // indirect go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7 // indirect @@ -46,11 +46,21 @@ require ( go.opentelemetry.io/otel/trace v1.19.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect - golang.org/x/net v0.15.0 // indirect - golang.org/x/sys v0.12.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect google.golang.org/grpc v1.58.2 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl => ../../pkg/ottl + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter => ../../internal/filter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index b4e27ba240b9..c7f362e69d29 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -83,12 +83,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.86.0 h1:HEuJ7hCbLVfoL7xLrGQ2QORvocyFfWuaoDuzyTLwTdc= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.86.0/go.mod h1:ss8TG43W1xNke9aeI0uTIVpyXW5OmYslxMj01UMdjR8= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.86.0 h1:T6nMIqOKajxMP9X7Dq+BBAu+eg17k9QBNx430+ki5Dk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.86.0/go.mod h1:g6Iv48KbwXtstNrET5bDEfJwGnBxFJntxaCba1bDIIg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.86.0 h1:dREgPRZ0kOc2ZEynRSILn6T2Ds7RTr9j4W28XyboK60= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.86.0/go.mod h1:fRwCRopq4cIHr6CvLyPEfda7zIlkaWNtxY/OBBliBI8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= @@ -111,8 +105,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector v0.86.0 h1:Yxu0muUws9e7HG+5DDiYajkfAeOo/riUv0sJO4E9rXA= -go.opentelemetry.io/collector v0.86.0/go.mod h1:HoXzPE/mJMN4jy5E1cSUMznxkKFiGAGJbkguzpnq5ak= +go.opentelemetry.io/collector v0.86.1-0.20231006161201-d364ad61c4d7 h1:3dTO79Uq8H3LUVeSytEnTnSe7PlcLg7qieNksYDao5E= +go.opentelemetry.io/collector v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:4jxPdXTip34YtYZ8l1UX+TeX0g5gpliuf3S+oDQrH7c= go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7 h1:Ptp2HfFfv2X3GmJdxejnNmLR9SqWyXsHh41z2JvuFcQ= go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:CK7+gkTy4z3doM0E02nFMYr+4ukIWUIBNWqpTZuXGlQ= go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7 h1:mT9H5U+wIW7lPvny0cNClJvl5lnaAztJdM3aeS/sh8M= @@ -131,8 +125,6 @@ go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015.0.20231006161201-d364ad go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 h1:Hrh7jB148ml4SbGsEuQFFcOpBebwpgf6UXM+PvdU9bQ= go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7/go.mod h1:OdN0alYOlYhHXu6BDlGehrZWgtBuiDsz/rlNeJeXiNg= -go.opentelemetry.io/collector/processor v0.86.0 h1:b4Htiom5mgcM5d7Memw1NkxBKgOADF1je0mLIhulQUM= -go.opentelemetry.io/collector/receiver v0.86.0 h1:AP+KZ225CmXR1oBD36+vV/pZcRFTkSiG7HvAVqfHoRg= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA= @@ -167,8 +159,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -179,8 +171,8 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= From e8b2fce27d36fcb34258370d16010bc7a5692619 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Tue, 10 Oct 2023 18:13:32 -0400 Subject: [PATCH 37/43] chore: regenerate files --- .../internal/metadata/generated_status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go b/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go index 7845d060b6f5..e475b1c0f3b6 100644 --- a/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go +++ b/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go @@ -7,6 +7,6 @@ import ( ) const ( - Type = "honeycomb" + Type = "honeycombmarker" LogsStability = component.StabilityLevelDevelopment ) From 026926ea1afa53d06fbc6da4180253a3a5f294a2 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Wed, 11 Oct 2023 11:20:56 -0400 Subject: [PATCH 38/43] chore: update go mod --- exporter/honeycombmarkerexporter/go.mod | 22 +++++++-------- exporter/honeycombmarkerexporter/go.sum | 36 ++++++++++++------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index 6554f6b9fc12..d791130d1c22 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -4,13 +4,13 @@ go 1.20 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.86.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.86.1-0.20231006161201-d364ad61c4d7 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.87.0 github.com/stretchr/testify v1.8.4 - go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7 + go.opentelemetry.io/collector/component v0.87.0 go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7 - go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7 - go.opentelemetry.io/collector/exporter v0.86.1-0.20231006161201-d364ad61c4d7 - go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 + go.opentelemetry.io/collector/confmap v0.87.0 + go.opentelemetry.io/collector/exporter v0.87.0 + go.opentelemetry.io/collector/pdata v1.0.0-rcv0016 go.uber.org/zap v1.26.0 ) @@ -33,14 +33,14 @@ 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/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.86.1-0.20231006161201-d364ad61c4d7 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.87.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/collector v0.86.1-0.20231006161201-d364ad61c4d7 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7 // indirect - go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7 // indirect - go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7 // indirect - go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 // indirect + go.opentelemetry.io/collector v0.87.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.87.0 // indirect + go.opentelemetry.io/collector/consumer v0.87.0 // indirect + go.opentelemetry.io/collector/extension v0.87.0 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0016 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect go.opentelemetry.io/otel/trace v1.19.0 // indirect diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index c7f362e69d29..341457699211 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -105,26 +105,26 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector v0.86.1-0.20231006161201-d364ad61c4d7 h1:3dTO79Uq8H3LUVeSytEnTnSe7PlcLg7qieNksYDao5E= -go.opentelemetry.io/collector v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:4jxPdXTip34YtYZ8l1UX+TeX0g5gpliuf3S+oDQrH7c= -go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7 h1:Ptp2HfFfv2X3GmJdxejnNmLR9SqWyXsHh41z2JvuFcQ= -go.opentelemetry.io/collector/component v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:CK7+gkTy4z3doM0E02nFMYr+4ukIWUIBNWqpTZuXGlQ= +go.opentelemetry.io/collector v0.87.0 h1:160HewHp+/wzr62BzWjQgIvdTtzpaYTlCnGVb8DYnM0= +go.opentelemetry.io/collector v0.87.0/go.mod h1:VsAXXIK0D1na+Ysoy1/GIx0GgkH8vQqA6zwosddFz7A= +go.opentelemetry.io/collector/component v0.87.0 h1:Q+lwM5WAa2x4a5lgyaF6SjFBpIij5gyjsoiv9KFG36A= +go.opentelemetry.io/collector/component v0.87.0/go.mod h1:LsfDQRkwJRHOSHNnM1/pdi/6EQNj41WpIxpZRqSdI0E= go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7 h1:mT9H5U+wIW7lPvny0cNClJvl5lnaAztJdM3aeS/sh8M= go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:TPCHaU+QXiEV+JXbgyr6mSErTI9chwQyasDVMdJr3eY= -go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7 h1:RfQsuqBZmiAfLp80shP8JOLUhEkErnil8RSi5MD/rls= -go.opentelemetry.io/collector/config/configtelemetry v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= -go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7 h1:EwSO/+XDjXcIUiZcsWVG37oiQ4TkIGk/LM7Dd3CTopQ= -go.opentelemetry.io/collector/confmap v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:vJms49x98lXUR7Mj6/28eXV+Otn3dDQpc+Znvex9Z84= -go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7 h1:sTPyKQ5M7gvRmO72+qFmOv3y0YmxK0gyCHFoL/Ap1TQ= -go.opentelemetry.io/collector/consumer v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:bOVFVPhtghkI+jmRT/E7Sig0wXTV4eU3aoYyZyrt2z8= -go.opentelemetry.io/collector/exporter v0.86.1-0.20231006161201-d364ad61c4d7 h1:5rJMxvZdAgur/W84ig9MHa5PtMOmTPkwXNyZSstvGXY= -go.opentelemetry.io/collector/exporter v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:KJtz08Y/JWDf7q1ekd1JKN/W6w75Up3Y+Ly5Ob1JG0k= -go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7 h1:WP77l9R3XeCKlCdevYr2pSYlibs728w3GANuqKQpq4k= -go.opentelemetry.io/collector/extension v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:YD+b2rB+kROkpMvWQF55Y0XR9mZPqR6200Ek2ffy3Uc= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 h1:0jyd3Kz63QVV6fWB2a0tKWH11fIqBE7oO2bETDiQGCI= -go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= -go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7 h1:Hrh7jB148ml4SbGsEuQFFcOpBebwpgf6UXM+PvdU9bQ= -go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231006161201-d364ad61c4d7/go.mod h1:OdN0alYOlYhHXu6BDlGehrZWgtBuiDsz/rlNeJeXiNg= +go.opentelemetry.io/collector/config/configtelemetry v0.87.0 h1:xUqayM9b41OvXkjU3p8RkUr8hUrCjfDUmO+oKhRNSwc= +go.opentelemetry.io/collector/config/configtelemetry v0.87.0/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/confmap v0.87.0 h1:LFnyDKIOMtlJm5EsdcFN2t0rcU/QLbS9QEs/awM2HOA= +go.opentelemetry.io/collector/confmap v0.87.0/go.mod h1:inqYRP70+bMrUwGGnuhcWyyufxyU3VQT6rl3/EX0f+g= +go.opentelemetry.io/collector/consumer v0.87.0 h1:oR5XKZoVF/hwz0FnrYPaHcbbQazHifMsxpENMR7ivvo= +go.opentelemetry.io/collector/consumer v0.87.0/go.mod h1:lui5rg1byAT7QPbCY733StCDc/TPxS3hVNXKoVQ3LsI= +go.opentelemetry.io/collector/exporter v0.87.0 h1:DZ0QT2yp1qACmHMxs6W2ho5RPqdevCx9R/LFCxnxi9w= +go.opentelemetry.io/collector/exporter v0.87.0/go.mod h1:SGobdCR0xwQElJT2Sbofo7BprMlV8XeXdsNP9fsNaKY= +go.opentelemetry.io/collector/extension v0.87.0 h1:EMIaEequ5rjWzoid6vNImjQGVMfzbME+8JSa5XACYKs= +go.opentelemetry.io/collector/extension v0.87.0/go.mod h1:D3srNZC99QVTAdLNUVuqfmmgJge4sQHDrnt5XWscvxI= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0016 h1:/6N9990tbjotvXgrXpV5AbaFiyxTdFEXDypGBHVDSQM= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0016/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0016 h1:qCPXSQCoD3qeWFb1RuIks8fw9Atxpk78bmtVdi15KhE= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0016/go.mod h1:OdN0alYOlYhHXu6BDlGehrZWgtBuiDsz/rlNeJeXiNg= go.opentelemetry.io/otel v1.19.0 h1:MuS/TNf4/j4IXsZuJegVzI1cwut7Qc00344rgH7p8bs= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA= From 4b21e62323676066dfdb09c413e9bc13e8eefe93 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Wed, 11 Oct 2023 11:35:53 -0400 Subject: [PATCH 39/43] chore: run go mod tidy and update configopaue version --- exporter/honeycombmarkerexporter/go.mod | 2 +- exporter/honeycombmarkerexporter/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index d791130d1c22..c55af3226bed 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -7,7 +7,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.87.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.87.0 - go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7 + go.opentelemetry.io/collector/config/configopaque v0.87.0 go.opentelemetry.io/collector/confmap v0.87.0 go.opentelemetry.io/collector/exporter v0.87.0 go.opentelemetry.io/collector/pdata v1.0.0-rcv0016 diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index 341457699211..949175148023 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -109,8 +109,8 @@ go.opentelemetry.io/collector v0.87.0 h1:160HewHp+/wzr62BzWjQgIvdTtzpaYTlCnGVb8D go.opentelemetry.io/collector v0.87.0/go.mod h1:VsAXXIK0D1na+Ysoy1/GIx0GgkH8vQqA6zwosddFz7A= go.opentelemetry.io/collector/component v0.87.0 h1:Q+lwM5WAa2x4a5lgyaF6SjFBpIij5gyjsoiv9KFG36A= go.opentelemetry.io/collector/component v0.87.0/go.mod h1:LsfDQRkwJRHOSHNnM1/pdi/6EQNj41WpIxpZRqSdI0E= -go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7 h1:mT9H5U+wIW7lPvny0cNClJvl5lnaAztJdM3aeS/sh8M= -go.opentelemetry.io/collector/config/configopaque v0.86.1-0.20231006161201-d364ad61c4d7/go.mod h1:TPCHaU+QXiEV+JXbgyr6mSErTI9chwQyasDVMdJr3eY= +go.opentelemetry.io/collector/config/configopaque v0.87.0 h1:+qqJG1oEzX4+/YNbgeaXW9YM0BPWSj5XCi5y2zZLhDY= +go.opentelemetry.io/collector/config/configopaque v0.87.0/go.mod h1:TPCHaU+QXiEV+JXbgyr6mSErTI9chwQyasDVMdJr3eY= go.opentelemetry.io/collector/config/configtelemetry v0.87.0 h1:xUqayM9b41OvXkjU3p8RkUr8hUrCjfDUmO+oKhRNSwc= go.opentelemetry.io/collector/config/configtelemetry v0.87.0/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= go.opentelemetry.io/collector/confmap v0.87.0 h1:LFnyDKIOMtlJm5EsdcFN2t0rcU/QLbS9QEs/awM2HOA= From 89e659c205f9f9261eeda3e28d6ad21de55b79fa Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Wed, 11 Oct 2023 11:57:53 -0400 Subject: [PATCH 40/43] chore: regen dependabot yml --- .github/dependabot.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f22ae93678be..615cb65c803b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,16 +7,6 @@ updates: schedule: interval: "weekly" day: "wednesday" - - package-ecosystem: "gomod" - directory: "/cmd/mdatagen" - schedule: - interval: "weekly" - day: "wednesday" - - package-ecosystem: "gomod" - directory: "/cmd/opampsupervisor" - schedule: - interval: "weekly" - day: "wednesday" - package-ecosystem: "gomod" directory: "/cmd/otelcontribcol" schedule: @@ -172,6 +162,11 @@ updates: schedule: interval: "weekly" day: "wednesday" + - package-ecosystem: "gomod" + directory: "/exporter/honeycombmarkerexporter" + schedule: + interval: "weekly" + day: "wednesday" - package-ecosystem: "gomod" directory: "/exporter/influxdbexporter" schedule: @@ -272,6 +267,11 @@ updates: schedule: interval: "weekly" day: "wednesday" + - package-ecosystem: "gomod" + directory: "/exporter/syslogexporter" + schedule: + interval: "weekly" + day: "wednesday" - package-ecosystem: "gomod" directory: "/exporter/tanzuobservabilityexporter" schedule: From e38fce023b5818fe726c871e25ee630f4204e690 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Wed, 11 Oct 2023 12:22:22 -0400 Subject: [PATCH 41/43] chore: regen issue template files --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yaml | 2 +- .github/ISSUE_TEMPLATE/other.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index ea176d244e95..ff7c68b9aff5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -54,7 +54,7 @@ body: - exporter/googlecloud - exporter/googlecloudpubsub - exporter/googlemanagedprometheus - - exporter/honeycombmarkerexporter + - exporter/honeycombgit marker - exporter/influxdb - exporter/instana - exporter/kafka diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 6a6b6d391ff2..814303a8cb55 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -48,7 +48,7 @@ body: - exporter/googlecloud - exporter/googlecloudpubsub - exporter/googlemanagedprometheus - - exporter/honeycombmarkerexporter + - exporter/honeycombmarker - exporter/influxdb - exporter/instana - exporter/kafka diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index d46cba7fa8c7..f9d2390eb1c9 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -48,7 +48,7 @@ body: - exporter/googlecloud - exporter/googlecloudpubsub - exporter/googlemanagedprometheus - - exporter/honeycombmarkerexporter + - exporter/honeycombmarker - exporter/influxdb - exporter/instana - exporter/kafka From d14c5df777cb65fbbeb2d16ae18a5247456973eb Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Wed, 11 Oct 2023 12:40:19 -0400 Subject: [PATCH 42/43] chore: regen bug report --- .github/ISSUE_TEMPLATE/bug_report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index ff7c68b9aff5..6eaafc61824c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -54,7 +54,7 @@ body: - exporter/googlecloud - exporter/googlecloudpubsub - exporter/googlemanagedprometheus - - exporter/honeycombgit marker + - exporter/honeycombmarker - exporter/influxdb - exporter/instana - exporter/kafka From d81ab3b50e05613ea226b8f35dae228d626f6a51 Mon Sep 17 00:00:00 2001 From: fchikwekwe Date: Wed, 11 Oct 2023 14:14:48 -0400 Subject: [PATCH 43/43] fix: change markertype and markercolor to type and color --- exporter/honeycombmarkerexporter/README.md | 20 ++++++++----------- exporter/honeycombmarkerexporter/config.go | 14 ++++++------- .../honeycombmarkerexporter/config_test.go | 8 ++++---- exporter/honeycombmarkerexporter/doc.go | 2 +- exporter/honeycombmarkerexporter/factory.go | 2 +- .../honeycombmarkerexporter/logs_exporter.go | 2 +- 6 files changed, 22 insertions(+), 26 deletions(-) diff --git a/exporter/honeycombmarkerexporter/README.md b/exporter/honeycombmarkerexporter/README.md index fc2f3a3462ec..c11819579877 100644 --- a/exporter/honeycombmarkerexporter/README.md +++ b/exporter/honeycombmarkerexporter/README.md @@ -8,8 +8,8 @@ The following configuration options are supported: * `api_key` (Required): This is the API key (also called Write Key) for your Honeycomb account. * `api_url` (Required): You can set the hostname to send marker data to. * `markers` (Required): This specifies the exact configuration to create an event marker. - * `markertype`: Specifies the marker type. Markers with the same type will appear in the same color in Honeycomb. MarkerType or MarkerColor should be set. - * `markercolor`: Specifies the marker color. Will only be used if MarkerType is not set. + * `type`: Specifies the marker type. Markers with the same type will appear in the same color in Honeycomb. MarkerType or MarkerColor should be set. + * `color`: Specifies the marker color. Will only be used if MarkerType is not set. * `messagefield`: This is the attribute that will be used as the message. If necessary the value will be converted to a string. * `urlfield`: This is the attribute that will be used as the url. If necessary the value will be converted to a string. * `rules`: This is a list of OTTL rules that determine when to create an event marker. @@ -23,24 +23,20 @@ exporters: api_key: "my-api-key" api_url: "https://api.testhost.io" markers: - - markertype: "fooType", + - type: "fooType", messagefield: "test message", urlfield: "https://api.testhost.io", rules: - resourceconditions: - - "ResourceCondition1" - - "ResourceCondition2" + - IsMatch(attributes["test"], ".*") - logconditions: - - "LogCondition1" - - "LogCondition2" - - markertype: "barType", + - body == "test" + - color: "green", messagefield: "another test message", urlfield: "https://api.testhost.io", rules: - resourceconditions: - - "ResourceCondition1" - - "ResourceCondition2" + - IsMatch(attributes["test"], ".*") - logconditions: - - "LogCondition1" - - "LogCondition2" + - body == "test" ``` \ No newline at end of file diff --git a/exporter/honeycombmarkerexporter/config.go b/exporter/honeycombmarkerexporter/config.go index 628f1a0c0dc9..bc9bf7d2987c 100644 --- a/exporter/honeycombmarkerexporter/config.go +++ b/exporter/honeycombmarkerexporter/config.go @@ -23,15 +23,15 @@ type Config struct { APIURL string `mapstructure:"api_url"` // Markers is the list of markers to create - Markers []marker `mapstructure:"markers"` + Markers []Marker `mapstructure:"markers"` } -type marker struct { - // MarkerType defines the type of marker. Markers with the same type appear in Honeycomb with the same color - MarkerType string `mapstructure:"type"` +type Marker struct { + // Type defines the type of Marker. Markers with the same type appear in Honeycomb with the same color + Type string `mapstructure:"type"` - // MarkerColor is the color of the marker. Will only be used if the MarkerType does not already exist. - MarkerColor string `mapstructure:"color"` + // Color is the color of the Marker. Will only be used if the Type does not already exist. + Color string `mapstructure:"color"` // MessageField is the attribute that will be used as the message. // If necessary the value will be converted to a string. @@ -67,7 +67,7 @@ func (cfg *Config) Validate() error { if len(cfg.Markers) != 0 { for _, m := range cfg.Markers { if len(m.Rules.ResourceConditions) == 0 && len(m.Rules.LogConditions) == 0 { - return fmt.Errorf("no rules supplied for marker %v", m) + return fmt.Errorf("no rules supplied for Marker %v", m) } _, err := filterottl.NewBoolExprForResource(m.Rules.ResourceConditions, filterottl.StandardResourceFuncs(), ottl.PropagateError, component.TelemetrySettings{Logger: zap.NewNop()}) diff --git a/exporter/honeycombmarkerexporter/config_test.go b/exporter/honeycombmarkerexporter/config_test.go index 867ab5fdcdd4..9fbdc724db56 100644 --- a/exporter/honeycombmarkerexporter/config_test.go +++ b/exporter/honeycombmarkerexporter/config_test.go @@ -30,9 +30,9 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ APIKey: "test-apikey", APIURL: "https://api.testhost.io", - Markers: []marker{ + Markers: []Marker{ { - MarkerType: "fooType", + Type: "fooType", MessageField: "test message", URLField: "https://api.testhost.io", Rules: Rules{ @@ -52,9 +52,9 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ APIKey: "test-apikey", APIURL: "https://api.testhost.io", - Markers: []marker{ + Markers: []Marker{ { - MarkerColor: "green", + Color: "green", MessageField: "test message", URLField: "https://api.testhost.io", Rules: Rules{ diff --git a/exporter/honeycombmarkerexporter/doc.go b/exporter/honeycombmarkerexporter/doc.go index aeb818ce09c9..e01e77000d7f 100644 --- a/exporter/honeycombmarkerexporter/doc.go +++ b/exporter/honeycombmarkerexporter/doc.go @@ -3,5 +3,5 @@ //go:generate mdatagen metadata.yaml -// Package honeycombmarkerexporter exports marker data to Honeycomb. +// Package honeycombmarkerexporter exports Marker data to Honeycomb. package honeycombmarkerexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/honeycombmarkerexporter" diff --git a/exporter/honeycombmarkerexporter/factory.go b/exporter/honeycombmarkerexporter/factory.go index 72d12dff26f8..36e26f4d7e7f 100644 --- a/exporter/honeycombmarkerexporter/factory.go +++ b/exporter/honeycombmarkerexporter/factory.go @@ -25,7 +25,7 @@ func createDefaultConfig() component.Config { return &Config{ APIKey: "", APIURL: "api.honeycomb.io:443", - Markers: []marker{}, + Markers: []Marker{}, } } diff --git a/exporter/honeycombmarkerexporter/logs_exporter.go b/exporter/honeycombmarkerexporter/logs_exporter.go index 95e7ba3cd7c5..3dfe36d5d9bc 100644 --- a/exporter/honeycombmarkerexporter/logs_exporter.go +++ b/exporter/honeycombmarkerexporter/logs_exporter.go @@ -12,7 +12,7 @@ import ( type honeycombLogsExporter struct { logger *zap.Logger - markers []marker + markers []Marker } func newLogsExporter(logger *zap.Logger, config *Config) *honeycombLogsExporter {