From e489de5318da150f60360ce5e5752534d41a563d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=81=93=E5=90=9B?= Date: Sat, 28 Oct 2023 01:52:32 +0800 Subject: [PATCH] [extension/encodingextension] Introduce OTLP encoding extension (#27875) Introduce OTLP encoding extension. For more context, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/27564 --- .chloggen/otlp_encoding_extension.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 + .github/dependabot.yml | 10 +- .../encoding/otlpencodingextension/Makefile | 1 + .../encoding/otlpencodingextension/README.md | 12 ++ .../encoding/otlpencodingextension/config.go | 23 +++ .../encoding/otlpencodingextension/doc.go | 5 + .../otlpencodingextension/extension.go | 103 +++++++++++++ .../otlpencodingextension/extension_test.go | 136 ++++++++++++++++++ .../encoding/otlpencodingextension/factory.go | 30 ++++ .../encoding/otlpencodingextension/go.mod | 41 ++++++ .../encoding/otlpencodingextension/go.sum | 111 ++++++++++++++ .../internal/metadata/generated_status.go | 12 ++ .../otlpencodingextension/metadata.yaml | 9 ++ versions.yaml | 1 + 18 files changed, 520 insertions(+), 5 deletions(-) create mode 100755 .chloggen/otlp_encoding_extension.yaml create mode 100644 extension/encoding/otlpencodingextension/Makefile create mode 100644 extension/encoding/otlpencodingextension/README.md create mode 100644 extension/encoding/otlpencodingextension/config.go create mode 100644 extension/encoding/otlpencodingextension/doc.go create mode 100644 extension/encoding/otlpencodingextension/extension.go create mode 100644 extension/encoding/otlpencodingextension/extension_test.go create mode 100644 extension/encoding/otlpencodingextension/factory.go create mode 100644 extension/encoding/otlpencodingextension/go.mod create mode 100644 extension/encoding/otlpencodingextension/go.sum create mode 100644 extension/encoding/otlpencodingextension/internal/metadata/generated_status.go create mode 100644 extension/encoding/otlpencodingextension/metadata.yaml diff --git a/.chloggen/otlp_encoding_extension.yaml b/.chloggen/otlp_encoding_extension.yaml new file mode 100755 index 000000000000..c564f906b0af --- /dev/null +++ b/.chloggen/otlp_encoding_extension.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: otlpencodingextension + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Introduce OTLP encoding extension + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [6272] + +# (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: [] diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e207cc279a4d..b8fdc170ca35 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -95,6 +95,7 @@ extension/encoding/jaegerencodingextension/ @open-te extension/encoding/jsonlogencodingextension/ @open-telemetry/collector-contrib-approvers @VihasMakwana @atoulme extension/encoding/textencodingextension/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @atoulme extension/encoding/zipkinencodingextension/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @dao-jun +extension/encoding/otlpencodingextension/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @dao-jun extension/headerssetterextension/ @open-telemetry/collector-contrib-approvers @jpkrohling extension/healthcheckextension/ @open-telemetry/collector-contrib-approvers @jpkrohling extension/httpforwarder/ @open-telemetry/collector-contrib-approvers @atoulme @rmfitzpatrick diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 1edde75f0be7..e73cd7b8c356 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -85,6 +85,7 @@ body: - extension/bearertokenauth - extension/encoding/jaegerencoding - extension/encoding/jsonlogencoding + - extension/encoding/otlpencoding - extension/encoding/textencoding - extension/encoding/zipkinencoding - extension/headerssetter diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index ec5153584e22..dd62b7f21cf5 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -79,6 +79,7 @@ body: - extension/bearertokenauth - extension/encoding/jaegerencoding - extension/encoding/jsonlogencoding + - extension/encoding/otlpencoding - extension/encoding/textencoding - extension/encoding/zipkinencoding - extension/headerssetter diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index 46c56df71255..20ebbb9d9ba2 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -79,6 +79,7 @@ body: - extension/bearertokenauth - extension/encoding/jaegerencoding - extension/encoding/jsonlogencoding + - extension/encoding/otlpencoding - extension/encoding/textencoding - extension/encoding/zipkinencoding - extension/headerssetter diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 340ea217eb27..0efcd1cbca52 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -152,11 +152,6 @@ updates: schedule: interval: "weekly" day: "wednesday" - - package-ecosystem: "gomod" - directory: "/exporter/honeycombmarkerexporter" - schedule: - interval: "weekly" - day: "wednesday" - package-ecosystem: "gomod" directory: "/exporter/influxdbexporter" schedule: @@ -362,6 +357,11 @@ updates: schedule: interval: "weekly" day: "wednesday" + - package-ecosystem: "gomod" + directory: "/extension/opampextension" + schedule: + interval: "weekly" + day: "wednesday" - package-ecosystem: "gomod" directory: "/extension/pprofextension" schedule: diff --git a/extension/encoding/otlpencodingextension/Makefile b/extension/encoding/otlpencodingextension/Makefile new file mode 100644 index 000000000000..b157d14a4a94 --- /dev/null +++ b/extension/encoding/otlpencodingextension/Makefile @@ -0,0 +1 @@ +include ../../../Makefile.Common \ No newline at end of file diff --git a/extension/encoding/otlpencodingextension/README.md b/extension/encoding/otlpencodingextension/README.md new file mode 100644 index 000000000000..8df038c092d0 --- /dev/null +++ b/extension/encoding/otlpencodingextension/README.md @@ -0,0 +1,12 @@ +# OTLP encoding extension + + +| Status | | +| ------------- |-----------| +| Stability | [development] | +| Distributions | [] | +| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aextension%2Fotlpencoding%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aextension%2Fotlpencoding) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aextension%2Fotlpencoding%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aextension%2Fotlpencoding) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dao-jun](https://www.github.com/dao-jun), [@VihasMakwana](https://www.github.com/VihasMakwana) | + +[development]: https://github.com/open-telemetry/opentelemetry-collector#development + \ No newline at end of file diff --git a/extension/encoding/otlpencodingextension/config.go b/extension/encoding/otlpencodingextension/config.go new file mode 100644 index 000000000000..58989cdf5e9e --- /dev/null +++ b/extension/encoding/otlpencodingextension/config.go @@ -0,0 +1,23 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package otlpencodingextension // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" +import ( + "fmt" + + "go.opentelemetry.io/collector/component" +) + +var _ component.ConfigValidator = (*Config)(nil) + +type Config struct { + Protocol string `mapstructure:"protocol"` +} + +func (c *Config) Validate() error { + if c.Protocol != otlpProto && c.Protocol != otlpJSON { + return fmt.Errorf("unsupported protocol: %q", c.Protocol) + } + + return nil +} diff --git a/extension/encoding/otlpencodingextension/doc.go b/extension/encoding/otlpencodingextension/doc.go new file mode 100644 index 000000000000..a003854f9c70 --- /dev/null +++ b/extension/encoding/otlpencodingextension/doc.go @@ -0,0 +1,5 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:generate mdatagen metadata.yaml +package otlpencodingextension // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" diff --git a/extension/encoding/otlpencodingextension/extension.go b/extension/encoding/otlpencodingextension/extension.go new file mode 100644 index 000000000000..b2866beb6c67 --- /dev/null +++ b/extension/encoding/otlpencodingextension/extension.go @@ -0,0 +1,103 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package otlpencodingextension // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" + +import ( + "context" + "fmt" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/pdata/ptrace" +) + +const ( + otlpProto = "otlp_proto" + otlpJSON = "otlp_json" +) + +var ( + _ component.Component = (*otlpExtension)(nil) + _ ptrace.Marshaler = (*otlpExtension)(nil) + _ ptrace.Unmarshaler = (*otlpExtension)(nil) + _ plog.Marshaler = (*otlpExtension)(nil) + _ plog.Unmarshaler = (*otlpExtension)(nil) + _ pmetric.Marshaler = (*otlpExtension)(nil) + _ pmetric.Unmarshaler = (*otlpExtension)(nil) +) + +type otlpExtension struct { + config *Config + traceMarshaler ptrace.Marshaler + traceUnmarshaler ptrace.Unmarshaler + logMarshaler plog.Marshaler + logUnmarshaler plog.Unmarshaler + metricMarshaler pmetric.Marshaler + metricUnmarshaler pmetric.Unmarshaler +} + +func newExtension(config *Config) (*otlpExtension, error) { + var ex *otlpExtension + var err error + protocol := config.Protocol + switch protocol { + case otlpProto: + ex = &otlpExtension{ + config: config, + traceMarshaler: &ptrace.ProtoMarshaler{}, + traceUnmarshaler: &ptrace.ProtoUnmarshaler{}, + logMarshaler: &plog.ProtoMarshaler{}, + logUnmarshaler: &plog.ProtoUnmarshaler{}, + metricMarshaler: &pmetric.ProtoMarshaler{}, + metricUnmarshaler: &pmetric.ProtoUnmarshaler{}, + } + case otlpJSON: + ex = &otlpExtension{ + config: config, + traceMarshaler: &ptrace.JSONMarshaler{}, + traceUnmarshaler: &ptrace.JSONUnmarshaler{}, + logMarshaler: &plog.JSONMarshaler{}, + logUnmarshaler: &plog.JSONUnmarshaler{}, + metricMarshaler: &pmetric.JSONMarshaler{}, + metricUnmarshaler: &pmetric.JSONUnmarshaler{}, + } + default: + err = fmt.Errorf("unsupported protocol: %q", protocol) + } + + return ex, err +} + +func (ex *otlpExtension) UnmarshalTraces(buf []byte) (ptrace.Traces, error) { + return ex.traceUnmarshaler.UnmarshalTraces(buf) +} + +func (ex *otlpExtension) MarshalTraces(traces ptrace.Traces) ([]byte, error) { + return ex.traceMarshaler.MarshalTraces(traces) +} + +func (ex *otlpExtension) UnmarshalMetrics(buf []byte) (pmetric.Metrics, error) { + return ex.metricUnmarshaler.UnmarshalMetrics(buf) +} + +func (ex *otlpExtension) MarshalMetrics(metrics pmetric.Metrics) ([]byte, error) { + return ex.metricMarshaler.MarshalMetrics(metrics) +} + +func (ex *otlpExtension) UnmarshalLogs(buf []byte) (plog.Logs, error) { + return ex.logUnmarshaler.UnmarshalLogs(buf) +} + +func (ex *otlpExtension) MarshalLogs(logs plog.Logs) ([]byte, error) { + return ex.logMarshaler.MarshalLogs(logs) +} + +func (ex *otlpExtension) Start(_ context.Context, _ component.Host) error { + return nil +} + +func (ex *otlpExtension) Shutdown(_ context.Context) error { + return nil +} diff --git a/extension/encoding/otlpencodingextension/extension_test.go b/extension/encoding/otlpencodingextension/extension_test.go new file mode 100644 index 000000000000..411e6c8ef542 --- /dev/null +++ b/extension/encoding/otlpencodingextension/extension_test.go @@ -0,0 +1,136 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package otlpencodingextension // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/require" + "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 testOTLPMarshal(ex *otlpExtension, t *testing.T) { + traces := generateTraces() + _, err := ex.MarshalTraces(traces) + require.NoError(t, err) + + logs := generateLogs() + _, err = ex.MarshalLogs(logs) + require.NoError(t, err) + + metrics := generateMetrics() + _, err = ex.MarshalMetrics(metrics) + require.NoError(t, err) +} + +func testOTLPUnmarshal(ex *otlpExtension, t *testing.T) { + traces := generateTraces() + logs := generateLogs() + metrics := generateMetrics() + + traceBuf, err := ex.MarshalTraces(traces) + require.NoError(t, err) + logBuf, err := ex.MarshalLogs(logs) + require.NoError(t, err) + metricBuf, err := ex.MarshalMetrics(metrics) + require.NoError(t, err) + + traces0, err := ex.UnmarshalTraces(traceBuf) + require.NoError(t, err) + logs0, err := ex.UnmarshalLogs(logBuf) + require.NoError(t, err) + metrics0, err := ex.UnmarshalMetrics(metricBuf) + require.NoError(t, err) + + require.Equal(t, traces0.ResourceSpans().Len(), traces.ResourceSpans().Len()) + require.Equal(t, logs0.ResourceLogs().Len(), logs.ResourceLogs().Len()) + require.Equal(t, metrics0.ResourceMetrics().Len(), metrics.ResourceMetrics().Len()) +} + +func TestOTLPJSONMarshal(t *testing.T) { + conf := &Config{Protocol: otlpJSON} + ex := createAndExtension0(conf, t) + + testOTLPMarshal(ex, t) +} + +func TestOTLPProtoMarshal(t *testing.T) { + conf := &Config{Protocol: otlpProto} + ex := createAndExtension0(conf, t) + + testOTLPMarshal(ex, t) +} + +func TestOTLPJSONUnmarshal(t *testing.T) { + conf := &Config{Protocol: otlpJSON} + ex := createAndExtension0(conf, t) + testOTLPUnmarshal(ex, t) +} + +func TestOTLPProtoUnmarshal(t *testing.T) { + conf := &Config{Protocol: otlpProto} + ex := createAndExtension0(conf, t) + + testOTLPUnmarshal(ex, t) +} + +// createAndExtension0 Create extension +func createAndExtension0(c *Config, t *testing.T) *otlpExtension { + ex, err := newExtension(c) + require.NoError(t, err) + err = ex.Start(context.TODO(), nil) + require.NoError(t, err) + return ex +} + +func generateTraces() ptrace.Traces { + var num = 10 + now := time.Now() + md := ptrace.NewTraces() + ilm := md.ResourceSpans().AppendEmpty().ScopeSpans().AppendEmpty() + ilm.Spans().EnsureCapacity(num) + for i := 0; i < num; i++ { + im := ilm.Spans().AppendEmpty() + im.SetName("test_name") + im.SetStartTimestamp(pcommon.NewTimestampFromTime(now)) + im.SetEndTimestamp(pcommon.NewTimestampFromTime(now)) + } + return md +} + +func generateLogs() plog.Logs { + var num = 10 + md := plog.NewLogs() + ilm := md.ResourceLogs().AppendEmpty().ScopeLogs().AppendEmpty() + ilm.LogRecords().EnsureCapacity(num) + for i := 0; i < num; i++ { + im := ilm.LogRecords().AppendEmpty() + im.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + } + return md +} + +func generateMetrics() pmetric.Metrics { + var num = 10 + now := time.Now() + startTime := pcommon.NewTimestampFromTime(now.Add(-10 * time.Second)) + endTime := pcommon.NewTimestampFromTime(now) + + md := pmetric.NewMetrics() + ilm := md.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty() + ilm.Metrics().EnsureCapacity(num) + for i := 0; i < num; i++ { + im := ilm.Metrics().AppendEmpty() + im.SetName("test_name") + idp := im.SetEmptySum().DataPoints().AppendEmpty() + idp.SetStartTimestamp(startTime) + idp.SetTimestamp(endTime) + idp.SetIntValue(123) + } + return md +} diff --git a/extension/encoding/otlpencodingextension/factory.go b/extension/encoding/otlpencodingextension/factory.go new file mode 100644 index 000000000000..14202bc8b68e --- /dev/null +++ b/extension/encoding/otlpencodingextension/factory.go @@ -0,0 +1,30 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package otlpencodingextension // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension" + +import ( + "context" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/extension" + + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension/internal/metadata" +) + +func NewFactory() extension.Factory { + return extension.NewFactory( + metadata.Type, + createDefaultConfig, + createExtension, + metadata.ExtensionStability, + ) +} + +func createExtension(_ context.Context, _ extension.CreateSettings, config component.Config) (extension.Extension, error) { + return newExtension(config.(*Config)) +} + +func createDefaultConfig() component.Config { + return &Config{Protocol: otlpProto} +} diff --git a/extension/encoding/otlpencodingextension/go.mod b/extension/encoding/otlpencodingextension/go.mod new file mode 100644 index 000000000000..5844cef8d2e8 --- /dev/null +++ b/extension/encoding/otlpencodingextension/go.mod @@ -0,0 +1,41 @@ +module github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension + +go 1.20 + +require ( + github.com/stretchr/testify v1.8.4 + go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 + go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 + go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.3 // 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/pmezard/go-difflib v1.0.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 // 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 + go.uber.org/zap v1.26.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-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.59.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/extension/encoding/otlpencodingextension/go.sum b/extension/encoding/otlpencodingextension/go.sum new file mode 100644 index 000000000000..959b88539971 --- /dev/null +++ b/extension/encoding/otlpencodingextension/go.sum @@ -0,0 +1,111 @@ +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.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +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.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +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/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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +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/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +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.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 h1:t9GCaQDZ1MDBjEAC1Y7NvwiqvVppK6ckAfrUEAlFioA= +go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:4utKxz4Lilym3SPxNXJHosdaTjT1aQxI+TCmnJO54pU= +go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9 h1:4WPy3qE1lJE1LZE7t1kAj1XSZN85w68JknZO5Uo00vw= +go.opentelemetry.io/collector/config/configtelemetry v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9 h1:JKFChlNpigR1Q4hZUjDU2sB2VuQ+RigAh7oOQfdcaiQ= +go.opentelemetry.io/collector/confmap v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:CSJlMk1KRZloXAygpiPeCLpuQiLVDEZYbGsGHIKHeUg= +go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9 h1:6lnGLRgbuTQR7sR1xRqTfJMX2UNkOKbqVAwJDzobvGY= +go.opentelemetry.io/collector/extension v0.88.1-0.20231026220224-6405e152a2d9/go.mod h1:5wPlOyWtVJcZS9CMhFUnuRvNQ0XIoV/iUSaZWtCjoHA= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:luvDPu+FNy6LIylBOO8PH/ca6ym7JKAdMe1J1aJbsF4= +go.opentelemetry.io/collector/featuregate v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:fLmJMf1AoHttkF8p5oJAc4o5ZpHu8yO5XYJ7gbLCLzo= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9 h1:TVYPzf0ZwFDTSoQ6gPk4lpQgVK4g43cWYuo710E0RHI= +go.opentelemetry.io/collector/pdata v1.0.0-rcv0017.0.20231026220224-6405e152a2d9/go.mod h1:Rv9fOclA5AtM/JGm0d4jBOIAo1+jBA13UT5Bx0ovXi4= +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/metric v1.19.0 h1:aTzpGtV0ar9wlV4Sna9sdJyII5jTVJEvKETPiOKwvpE= +go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= +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.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +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/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.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +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.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= +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-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-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +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.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/extension/encoding/otlpencodingextension/internal/metadata/generated_status.go b/extension/encoding/otlpencodingextension/internal/metadata/generated_status.go new file mode 100644 index 000000000000..2b97e54b13c1 --- /dev/null +++ b/extension/encoding/otlpencodingextension/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 = "otlpencoding" + ExtensionStability = component.StabilityLevelDevelopment +) diff --git a/extension/encoding/otlpencodingextension/metadata.yaml b/extension/encoding/otlpencodingextension/metadata.yaml new file mode 100644 index 000000000000..b8498d0c1957 --- /dev/null +++ b/extension/encoding/otlpencodingextension/metadata.yaml @@ -0,0 +1,9 @@ +type: otlpencoding + +status: + class: extension + stability: + development: [ extension ] + distributions: [ ] + codeowners: + active: [ dao-jun, VihasMakwana ] \ No newline at end of file diff --git a/versions.yaml b/versions.yaml index 3972581cee96..8d9653cceb26 100644 --- a/versions.yaml +++ b/versions.yaml @@ -74,6 +74,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/jsonlogencodingextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/textencodingextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/zipkinencodingextension + - github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding/otlpencodingextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/headerssetterextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension - github.com/open-telemetry/opentelemetry-collector-contrib/extension/httpforwarder