From 9adb91e165fb90c22c0dab0e658bf04414bfcb7c Mon Sep 17 00:00:00 2001 From: Steven Swartz Date: Tue, 26 Mar 2024 09:30:28 -0400 Subject: [PATCH] Add skeleton for new rabbitmq exporter component (#31800) **Description:** Sets-up the configuration format and common component boilerplate for the rabbitmq exporter Implementation will be in other pull requests **Link to tracking Issue:** [28891](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/28891) **Testing:** Standard initial unit tests **Documentation:** Created README for the component --------- Co-authored-by: Antoine Toulme --- .chloggen/rabbitmq-exporter-skeleton.yaml | 27 ++++ .github/CODEOWNERS | 1 + .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + .github/ISSUE_TEMPLATE/feature_request.yaml | 1 + .github/ISSUE_TEMPLATE/other.yaml | 1 + exporter/rabbitmqexporter/Makefile | 1 + exporter/rabbitmqexporter/README.md | 46 ++++++ exporter/rabbitmqexporter/config.go | 43 +++++ exporter/rabbitmqexporter/config_test.go | 91 +++++++++++ exporter/rabbitmqexporter/doc.go | 7 + exporter/rabbitmqexporter/factory.go | 101 ++++++++++++ exporter/rabbitmqexporter/factory_test.go | 47 ++++++ .../generated_component_test.go | 101 ++++++++++++ exporter/rabbitmqexporter/go.mod | 59 +++++++ exporter/rabbitmqexporter/go.sum | 150 ++++++++++++++++++ .../internal/metadata/generated_status.go | 27 ++++ exporter/rabbitmqexporter/metadata.yaml | 15 ++ exporter/rabbitmqexporter/package_test.go | 14 ++ .../rabbitmqexporter/rabbitmq_exporter.go | 54 +++++++ .../testdata/test-config.yaml | 22 +++ versions.yaml | 1 + 21 files changed, 810 insertions(+) create mode 100644 .chloggen/rabbitmq-exporter-skeleton.yaml create mode 100644 exporter/rabbitmqexporter/Makefile create mode 100644 exporter/rabbitmqexporter/README.md create mode 100644 exporter/rabbitmqexporter/config.go create mode 100644 exporter/rabbitmqexporter/config_test.go create mode 100644 exporter/rabbitmqexporter/doc.go create mode 100644 exporter/rabbitmqexporter/factory.go create mode 100644 exporter/rabbitmqexporter/factory_test.go create mode 100644 exporter/rabbitmqexporter/generated_component_test.go create mode 100644 exporter/rabbitmqexporter/go.mod create mode 100644 exporter/rabbitmqexporter/go.sum create mode 100644 exporter/rabbitmqexporter/internal/metadata/generated_status.go create mode 100644 exporter/rabbitmqexporter/metadata.yaml create mode 100644 exporter/rabbitmqexporter/package_test.go create mode 100644 exporter/rabbitmqexporter/rabbitmq_exporter.go create mode 100644 exporter/rabbitmqexporter/testdata/test-config.yaml diff --git a/.chloggen/rabbitmq-exporter-skeleton.yaml b/.chloggen/rabbitmq-exporter-skeleton.yaml new file mode 100644 index 000000000000..7f48864e7f84 --- /dev/null +++ b/.chloggen/rabbitmq-exporter-skeleton.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: rabbitmqexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add new exporter for sending telemetry to RabbitMQ brokers using the AMQP 0.9.1 protocol + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [28891] + +# (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: [user] diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f0cfe199e76e..caf0ea686213 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -72,6 +72,7 @@ exporter/otelarrowexporter/ @open-telemetry/collect exporter/prometheusexporter/ @open-telemetry/collector-contrib-approvers @Aneurysm9 exporter/prometheusremotewriteexporter/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @rapphil exporter/pulsarexporter/ @open-telemetry/collector-contrib-approvers @dmitryax @dao-jun +exporter/rabbitmqexporter/ @open-telemetry/collector-contrib-approvers @swar8080 exporter/sapmexporter/ @open-telemetry/collector-contrib-approvers @dmitryax @atoulme exporter/sentryexporter/ @open-telemetry/collector-contrib-approvers @AbhiPrasad exporter/signalfxexporter/ @open-telemetry/collector-contrib-approvers @dmitryax @crobert-1 diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index ffd09e95f6cb..1c793f2b4531 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -72,6 +72,7 @@ body: - exporter/prometheus - exporter/prometheusremotewrite - exporter/pulsar + - exporter/rabbitmq - exporter/sapm - exporter/sentry - exporter/signalfx diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index 26bc9845df9c..d8fca76ca5b4 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -66,6 +66,7 @@ body: - exporter/prometheus - exporter/prometheusremotewrite - exporter/pulsar + - exporter/rabbitmq - exporter/sapm - exporter/sentry - exporter/signalfx diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index d5bee69da1c4..f94131e78497 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -66,6 +66,7 @@ body: - exporter/prometheus - exporter/prometheusremotewrite - exporter/pulsar + - exporter/rabbitmq - exporter/sapm - exporter/sentry - exporter/signalfx diff --git a/exporter/rabbitmqexporter/Makefile b/exporter/rabbitmqexporter/Makefile new file mode 100644 index 000000000000..c1496226e590 --- /dev/null +++ b/exporter/rabbitmqexporter/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common \ No newline at end of file diff --git a/exporter/rabbitmqexporter/README.md b/exporter/rabbitmqexporter/README.md new file mode 100644 index 000000000000..a396f98427fa --- /dev/null +++ b/exporter/rabbitmqexporter/README.md @@ -0,0 +1,46 @@ +# RabbitMQ Exporter + +| Status | | +| ------------- |-----------| +| Stability | [development]: traces, metrics, logs | +| Distributions | [] | +| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Frabbitmq%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Frabbitmq) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Frabbitmq%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Frabbitmq) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@swar8080](https://www.github.com/swar8080) | + +[development]: https://github.com/open-telemetry/opentelemetry-collector#development + + +Exports metrics, traces, and logs to [RabbitMQ](https://www.rabbitmq.com/) using the AMQP 0.9.1 protocol + +## Getting Started + +The following settings can be configured: +- `connection`: + - `endpoint` (required, ex = amqp://localhost:5672): Endpoint to connect to RabbitMQ + - `vhost` (optional): The RabbitMQ [virtual host](https://www.rabbitmq.com/docs/vhosts) to connect to + - `auth`: + - `sasl`: Configuration if using SASL PLAIN authentication + - `username` (required): username for authentication + - `password` (required): password for authentication + - `tls` (optional): TODO, need to add this + - `routing`: + - `routing_key` (default = otlp_spans for traces, otlp_metrics for metrics, otlp_logs for logs): Routing key used to route exported messages to RabbitMQ consumers + - `durable` (default = true): Whether to instruct RabbitMQ to make messages [durable](https://www.rabbitmq.com/docs/queues#durability) by writing to disk + - `message_body_encoding`: (default = "otlp_proto"): The encoding of telemetry sent to RabbitMQ + - `otlp_proto`: payload is Protobuf serialized from `ExportTraceServiceRequest` if set as a traces exporter or `ExportMetricsServiceRequest` for metrics or `ExportLogsServiceRequest` for logs. + - `otlp_json`: ** EXPERIMENTAL ** payload is JSON serialized from `ExportTraceServiceRequest` if set as a traces exporter or `ExportMetricsServiceRequest` for metrics or `ExportLogsServiceRequest` for logs. + - `retry_on_failure`: + - `enabled` (default = false) + +Example config: + +```yaml +exporters: + rabbitmq: + connection: + endpoint: amqp://localhost:5672 + auth: + sasl: + username: user + password: pass +``` \ No newline at end of file diff --git a/exporter/rabbitmqexporter/config.go b/exporter/rabbitmqexporter/config.go new file mode 100644 index 000000000000..9aad0213d7a5 --- /dev/null +++ b/exporter/rabbitmqexporter/config.go @@ -0,0 +1,43 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package rabbitmqexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/rabbitmqexporter" + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configretry" +) + +type Config struct { + Connection ConnectionConfig `mapstructure:"connection"` + Routing RoutingConfig `mapstructure:"routing"` + MessageBodyEncoding string `mapstructure:"message_body_encoding"` + Durable bool `mapstructure:"durable"` + RetrySettings configretry.BackOffConfig `mapstructure:"retry_on_failure"` +} + +type ConnectionConfig struct { + Endpoint string `mapstructure:"endpoint"` + VHost string `mapstructure:"vhost"` + Auth AuthConfig `mapstructure:"auth"` +} + +type RoutingConfig struct { + RoutingKey string `mapstructure:"routing_key"` +} + +type AuthConfig struct { + SASL SASLConfig `mapstructure:"sasl"` +} + +type SASLConfig struct { + Username string `mapstructure:"username"` + Password string `mapstructure:"password"` +} + +var _ component.Config = (*Config)(nil) + +// Validate checks if the exporter configuration is valid +func (cfg *Config) Validate() error { + return nil +} diff --git a/exporter/rabbitmqexporter/config_test.go b/exporter/rabbitmqexporter/config_test.go new file mode 100644 index 000000000000..22cb41018d68 --- /dev/null +++ b/exporter/rabbitmqexporter/config_test.go @@ -0,0 +1,91 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package rabbitmqexporter + +import ( + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configretry" + "go.opentelemetry.io/collector/confmap/confmaptest" + + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/rabbitmqexporter/internal/metadata" +) + +func TestLoadConfig(t *testing.T) { + t.Parallel() + + cm, err := confmaptest.LoadConf(filepath.Join("testdata", "test-config.yaml")) + require.NoError(t, err) + + tests := []struct { + id component.ID + expected component.Config + }{ + { + id: component.NewIDWithName(metadata.Type, ""), + expected: createDefaultConfig().(*Config), + }, + { + id: component.NewIDWithName(metadata.Type, "all_fields"), + expected: &Config{ + Connection: ConnectionConfig{ + Endpoint: "amqp://localhost:5672", + VHost: "vhost1", + Auth: AuthConfig{ + SASL: SASLConfig{ + Username: "user", + Password: "pass", + }, + }, + }, + Routing: RoutingConfig{ + RoutingKey: "custom_routing_key", + }, + MessageBodyEncoding: "otlp_json", + Durable: false, + RetrySettings: configretry.BackOffConfig{ + Enabled: true, + }, + }, + }, + { + id: component.NewIDWithName(metadata.Type, "mandatory_fields"), + expected: &Config{ + Connection: ConnectionConfig{ + Endpoint: "amqp://localhost:5672", + VHost: "", + Auth: AuthConfig{ + SASL: SASLConfig{ + Username: "user", + Password: "pass", + }, + }, + }, + MessageBodyEncoding: "otlp_proto", + Durable: true, + RetrySettings: configretry.BackOffConfig{ + Enabled: false, + }, + }, + }, + } + + 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) + }) + } +} diff --git a/exporter/rabbitmqexporter/doc.go b/exporter/rabbitmqexporter/doc.go new file mode 100644 index 000000000000..52181ceff162 --- /dev/null +++ b/exporter/rabbitmqexporter/doc.go @@ -0,0 +1,7 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:generate mdatagen metadata.yaml + +// Package rabbitmqexporter exports telemetry to RabbitMQ using the AMQP 0.9.1 protocol +package rabbitmqexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/rabbitmqexporter" diff --git a/exporter/rabbitmqexporter/factory.go b/exporter/rabbitmqexporter/factory.go new file mode 100644 index 000000000000..23804efdf432 --- /dev/null +++ b/exporter/rabbitmqexporter/factory.go @@ -0,0 +1,101 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package rabbitmqexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/rabbitmqexporter" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configretry" + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterhelper" + + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/rabbitmqexporter/internal/metadata" +) + +const ( + defaultEncoding = "otlp_proto" +) + +func NewFactory() exporter.Factory { + return exporter.NewFactory( + metadata.Type, + createDefaultConfig, + exporter.WithLogs(createLogsExporter, metadata.LogsStability), + exporter.WithMetrics(createMetricsExporter, metadata.TracesStability), + exporter.WithTraces(createTracesExporter, metadata.LogsStability), + ) +} + +func createDefaultConfig() component.Config { + retrySettings := configretry.BackOffConfig{ + Enabled: false, + } + return &Config{ + MessageBodyEncoding: defaultEncoding, + Durable: true, + RetrySettings: retrySettings, + } +} + +func createTracesExporter( + ctx context.Context, + set exporter.CreateSettings, + cfg component.Config, +) (exporter.Traces, error) { + config := cfg.(*Config) + r := newRabbitmqExporter(config, set.TelemetrySettings) + + return exporterhelper.NewTracesExporter( + ctx, + set, + cfg, + r.pushTraces, + exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), + exporterhelper.WithStart(r.start), + exporterhelper.WithShutdown(r.shutdown), + exporterhelper.WithRetry(config.RetrySettings), + ) +} + +func createMetricsExporter( + ctx context.Context, + set exporter.CreateSettings, + cfg component.Config, +) (exporter.Metrics, error) { + config := (cfg.(*Config)) + r := newRabbitmqExporter(config, set.TelemetrySettings) + + return exporterhelper.NewMetricsExporter( + ctx, + set, + cfg, + r.pushMetrics, + exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), + exporterhelper.WithStart(r.start), + exporterhelper.WithShutdown(r.shutdown), + exporterhelper.WithRetry(config.RetrySettings), + ) +} + +func createLogsExporter( + ctx context.Context, + set exporter.CreateSettings, + cfg component.Config, +) (exporter.Logs, error) { + config := (cfg.(*Config)) + r := newRabbitmqExporter(config, set.TelemetrySettings) + + return exporterhelper.NewLogsExporter( + ctx, + set, + cfg, + r.pushLogs, + exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}), + exporterhelper.WithStart(r.start), + exporterhelper.WithShutdown(r.shutdown), + exporterhelper.WithRetry(config.RetrySettings), + ) +} diff --git a/exporter/rabbitmqexporter/factory_test.go b/exporter/rabbitmqexporter/factory_test.go new file mode 100644 index 000000000000..a5787dd6881b --- /dev/null +++ b/exporter/rabbitmqexporter/factory_test.go @@ -0,0 +1,47 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package rabbitmqexporter + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/exporter/exportertest" +) + +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 TestCreateTracesExporter(t *testing.T) { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + + te, err := factory.CreateTracesExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg) + assert.NoError(t, err) + assert.NotNil(t, te) +} + +func TestCreateMetricsExporter(t *testing.T) { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + + te, err := factory.CreateMetricsExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg) + assert.NoError(t, err) + assert.NotNil(t, te) +} + +func TestCreateLogsExporter(t *testing.T) { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + + te, err := factory.CreateLogsExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg) + assert.NoError(t, err) + assert.NotNil(t, te) +} diff --git a/exporter/rabbitmqexporter/generated_component_test.go b/exporter/rabbitmqexporter/generated_component_test.go new file mode 100644 index 000000000000..78deb8976565 --- /dev/null +++ b/exporter/rabbitmqexporter/generated_component_test.go @@ -0,0 +1,101 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package rabbitmqexporter + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exportertest" + "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +func TestComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsExporter(ctx, set, cfg) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsExporter(ctx, set, cfg) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesExporter(ctx, set, cfg) + }, + }, + } + + cm, err := confmaptest.LoadConf("metadata.yaml") + require.NoError(t, err) + cfg := factory.CreateDefaultConfig() + sub, err := cm.Sub("tests::config") + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + for _, test := range tests { + t.Run(test.name+"-shutdown", func(t *testing.T) { + c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} + +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + +func generateLifecycleTestTraces() ptrace.Traces { + traces := ptrace.NewTraces() + rs := traces.ResourceSpans().AppendEmpty() + rs.Resource().Attributes().PutStr("resource", "R1") + span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.Attributes().PutStr("test_attr", "value_1") + span.SetName("test_span") + span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second))) + span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return traces +} diff --git a/exporter/rabbitmqexporter/go.mod b/exporter/rabbitmqexporter/go.mod new file mode 100644 index 000000000000..7387f5f543d8 --- /dev/null +++ b/exporter/rabbitmqexporter/go.mod @@ -0,0 +1,59 @@ +module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/rabbitmqexporter + +go 1.21 + +require ( + github.com/stretchr/testify v1.9.0 + go.opentelemetry.io/collector/component v0.96.1-0.20240315172937-3b5aee0c7a16 + go.opentelemetry.io/collector/config/configretry v0.96.0 + go.opentelemetry.io/collector/confmap v0.96.1-0.20240315172937-3b5aee0c7a16 + go.opentelemetry.io/collector/consumer v0.96.1-0.20240315172937-3b5aee0c7a16 + go.opentelemetry.io/collector/exporter v0.96.1-0.20240315172937-3b5aee0c7a16 + go.opentelemetry.io/collector/pdata v1.3.1-0.20240315172937-3b5aee0c7a16 + go.opentelemetry.io/otel/metric v1.24.0 + go.opentelemetry.io/otel/trace v1.24.0 + go.uber.org/goleak v1.3.0 +) + +require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/uuid v1.6.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.1.0 // indirect + github.com/mitchellh/copystructure v1.2.0 // 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/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.0 // indirect + github.com/prometheus/common v0.48.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + go.opentelemetry.io/collector v0.96.1-0.20240315172937-3b5aee0c7a16 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.96.1-0.20240315172937-3b5aee0c7a16 // indirect + go.opentelemetry.io/collector/extension v0.96.1-0.20240315172937-3b5aee0c7a16 // indirect + go.opentelemetry.io/collector/receiver v0.96.1-0.20240315172937-3b5aee0c7a16 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect + go.opentelemetry.io/otel/sdk v1.24.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/grpc v1.62.1 // indirect + google.golang.org/protobuf v1.33.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/exporter/rabbitmqexporter/go.sum b/exporter/rabbitmqexporter/go.sum new file mode 100644 index 000000000000..e4e6fa0724f3 --- /dev/null +++ b/exporter/rabbitmqexporter/go.sum @@ -0,0 +1,150 @@ +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +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/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +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/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +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.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8= +github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +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/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/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.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE= +github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opentelemetry.io/collector v0.96.1-0.20240315172937-3b5aee0c7a16 h1:4pMthIh6EgBDRrgqlnbal2hGPdDAADHc7C3gYU7cemc= +go.opentelemetry.io/collector v0.96.1-0.20240315172937-3b5aee0c7a16/go.mod h1:PFDUr160wBjUPqqVIvpJ0G9JXM8ux+qZkC+oZRB8gnA= +go.opentelemetry.io/collector/component v0.96.1-0.20240315172937-3b5aee0c7a16 h1:Is9uHOav+UViEFSyTl/I7Vk2zymZTSw9c6iBVn4/fRI= +go.opentelemetry.io/collector/component v0.96.1-0.20240315172937-3b5aee0c7a16/go.mod h1:0evn//YPgN/5VmbbD4JS0yH3ikWxwROQN1MKEOM/U3M= +go.opentelemetry.io/collector/config/configretry v0.96.0 h1:rdZqq/ddPCjZCYYuqDGxrC93uHzQWhX5MQ9tt5uMSpM= +go.opentelemetry.io/collector/config/configretry v0.96.0/go.mod h1:Nq7hp4nk+zeH0LYYsx348NHl02O89FnV45hcCCmqdtg= +go.opentelemetry.io/collector/config/configtelemetry v0.96.1-0.20240315172937-3b5aee0c7a16 h1:4Vi88ksIeP0NseJgnqFPvGOBwCXh4Ary6+NbF1Gi3OM= +go.opentelemetry.io/collector/config/configtelemetry v0.96.1-0.20240315172937-3b5aee0c7a16/go.mod h1:YV5PaOdtnU1xRomPcYqoHmyCr48tnaAREeGO96EZw8o= +go.opentelemetry.io/collector/confmap v0.96.1-0.20240315172937-3b5aee0c7a16 h1:as8mEhxxXrdtz4cNZyCJFtfORWeEVVDnFjhE9XNEwAA= +go.opentelemetry.io/collector/confmap v0.96.1-0.20240315172937-3b5aee0c7a16/go.mod h1:AnJmZcZoOLuykSXGiAf3shi11ZZk5ei4tZd9dDTTpWE= +go.opentelemetry.io/collector/consumer v0.96.1-0.20240315172937-3b5aee0c7a16 h1:Ck1Ezg+WseiNj1YllgCLHLQ7urv6Y+RVXcIpXKYpLrY= +go.opentelemetry.io/collector/consumer v0.96.1-0.20240315172937-3b5aee0c7a16/go.mod h1:pF9K1Oty2E3Z/crgyIg55DIy7S8QXYMrcyHvARUyGIY= +go.opentelemetry.io/collector/exporter v0.96.1-0.20240315172937-3b5aee0c7a16 h1:QlLavIlCvBRV6usVT0bDYmd3VYVNHnSCM9cO9oNrnVs= +go.opentelemetry.io/collector/exporter v0.96.1-0.20240315172937-3b5aee0c7a16/go.mod h1:qGuTdw9xT2NycZwWtahgAXJlK3rkiGbaZD6Na6s5Pzc= +go.opentelemetry.io/collector/extension v0.96.1-0.20240315172937-3b5aee0c7a16 h1:ETaJM2DKhBVMAEDexHafD+7W/HpFze7SbtYJE/w2zpY= +go.opentelemetry.io/collector/extension v0.96.1-0.20240315172937-3b5aee0c7a16/go.mod h1:H0IqtDdwT5WcXlikiaEB7rJTg3s9o04wNmyqRuG45PQ= +go.opentelemetry.io/collector/pdata v1.3.1-0.20240315172937-3b5aee0c7a16 h1:xy/YN0kUeRwl6mltOlUKLobfLxRVuS6b/d1D3pdVFnU= +go.opentelemetry.io/collector/pdata v1.3.1-0.20240315172937-3b5aee0c7a16/go.mod h1:0Ttp4wQinhV5oJTd9MjyvUegmZBO9O0nrlh/+EDLw+Q= +go.opentelemetry.io/collector/receiver v0.96.1-0.20240315172937-3b5aee0c7a16 h1:rNLRTRbzRsHgsfaVzAyBG+OHAr6xiTtcTECcPhmBwP4= +go.opentelemetry.io/collector/receiver v0.96.1-0.20240315172937-3b5aee0c7a16/go.mod h1:+dCEmp1XV0a42CnBV6RcdPA5Ns6t4YCtSQsEwyLmef8= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ= +go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= +go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8= +go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +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.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +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/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-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.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +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-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.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +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/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +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.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +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/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/exporter/rabbitmqexporter/internal/metadata/generated_status.go b/exporter/rabbitmqexporter/internal/metadata/generated_status.go new file mode 100644 index 000000000000..e52726f1f42b --- /dev/null +++ b/exporter/rabbitmqexporter/internal/metadata/generated_status.go @@ -0,0 +1,27 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metadata + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" +) + +var ( + Type = component.MustNewType("rabbitmq") +) + +const ( + TracesStability = component.StabilityLevelDevelopment + MetricsStability = component.StabilityLevelDevelopment + LogsStability = component.StabilityLevelDevelopment +) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/rabbitmq") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/rabbitmq") +} diff --git a/exporter/rabbitmqexporter/metadata.yaml b/exporter/rabbitmqexporter/metadata.yaml new file mode 100644 index 000000000000..caca7005d662 --- /dev/null +++ b/exporter/rabbitmqexporter/metadata.yaml @@ -0,0 +1,15 @@ +type: rabbitmq +scope_name: otelcol/rabbitmq + +status: + class: exporter + stability: + development: [traces, metrics, logs] + distributions: [] + codeowners: + active: [swar8080] + +tests: + skip_lifecycle: true + skip_shutdown: false + expect_consumer_error: true \ No newline at end of file diff --git a/exporter/rabbitmqexporter/package_test.go b/exporter/rabbitmqexporter/package_test.go new file mode 100644 index 000000000000..a47186870311 --- /dev/null +++ b/exporter/rabbitmqexporter/package_test.go @@ -0,0 +1,14 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package rabbitmqexporter + +import ( + "testing" + + "go.uber.org/goleak" +) + +func TestMain(m *testing.M) { + goleak.VerifyTestMain(m) +} diff --git a/exporter/rabbitmqexporter/rabbitmq_exporter.go b/exporter/rabbitmqexporter/rabbitmq_exporter.go new file mode 100644 index 000000000000..0c4d326a1e47 --- /dev/null +++ b/exporter/rabbitmqexporter/rabbitmq_exporter.go @@ -0,0 +1,54 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package rabbitmqexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/rabbitmqexporter" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +type rabbitmqExporter struct { + config *Config + settings component.TelemetrySettings +} + +func newRabbitmqExporter(cfg *Config, set component.TelemetrySettings) *rabbitmqExporter { + return &rabbitmqExporter{ + config: cfg, + settings: set, + } +} + +func (s *rabbitmqExporter) start(_ context.Context, _ component.Host) error { + + // To Be Implemented + return nil +} + +func (s *rabbitmqExporter) pushTraces(_ context.Context, _ ptrace.Traces) error { + + // To Be Implemented + return nil +} + +func (s *rabbitmqExporter) pushMetrics(_ context.Context, _ pmetric.Metrics) error { + + // To Be Implemented + return nil +} + +func (s *rabbitmqExporter) pushLogs(_ context.Context, _ plog.Logs) error { + + // To Be Implemented + return nil +} + +func (s *rabbitmqExporter) shutdown(_ context.Context) error { + // To Be Implemented + return nil +} diff --git a/exporter/rabbitmqexporter/testdata/test-config.yaml b/exporter/rabbitmqexporter/testdata/test-config.yaml new file mode 100644 index 000000000000..18ea1c1f6d0a --- /dev/null +++ b/exporter/rabbitmqexporter/testdata/test-config.yaml @@ -0,0 +1,22 @@ +rabbitmq/all_fields: + connection: + endpoint: amqp://localhost:5672 + vhost: vhost1 + auth: + sasl: + username: user + password: pass + routing: + routing_key: custom_routing_key + message_body_encoding: otlp_json + durable: false + retry_on_failure: + enabled: true + +rabbitmq/mandatory_fields: + connection: + endpoint: amqp://localhost:5672 + auth: + sasl: + username: user + password: pass diff --git a/versions.yaml b/versions.yaml index feec99a509e3..b1417e17b031 100644 --- a/versions.yaml +++ b/versions.yaml @@ -60,6 +60,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/pulsarexporter + - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/rabbitmqexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sentryexporter - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/signalfxexporter