Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbaldwin authored Oct 30, 2023
2 parents 5f1162c + bbde47c commit 9624304
Show file tree
Hide file tree
Showing 24 changed files with 257 additions and 17 deletions.
12 changes: 12 additions & 0 deletions .chloggen/encoding-extensions-interfaces.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Use this changelog template to create an entry for release notes.
change_type: enhancement

component: extension/encoding

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Introduce interfaces for encoding extensions.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [28686]

change_logs: [api]
5 changes: 3 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ extension/asapauthextension/ @open-te
extension/awsproxy/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @mxiamxia
extension/basicauthextension/ @open-telemetry/collector-contrib-approvers @jpkrohling @svrakitin @frzifus
extension/bearertokenauthextension/ @open-telemetry/collector-contrib-approvers @jpkrohling @frzifus
extension/encoding/ @open-telemetry/collector-contrib-approvers @atoulme @dao-jun @dmitryax @MovieStoreGuy @VihasMakwana
extension/encoding/jaegerencodingextension/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @atoulme
extension/encoding/jsonlogencodingextension/ @open-telemetry/collector-contrib-approvers @VihasMakwana @atoulme
extension/encoding/otlpencodingextension/ @open-telemetry/collector-contrib-approvers @dao-jun @VihasMakwana
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/encoding/zipkinencodingextension/ @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
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ body:
- extension/awsproxy
- extension/basicauth
- extension/bearertokenauth
- extension/encoding
- extension/encoding/jaegerencoding
- extension/encoding/jsonlogencoding
- extension/encoding/otlpencoding
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ body:
- extension/awsproxy
- extension/basicauth
- extension/bearertokenauth
- extension/encoding
- extension/encoding/jaegerencoding
- extension/encoding/jsonlogencoding
- extension/encoding/otlpencoding
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ body:
- extension/awsproxy
- extension/basicauth
- extension/bearertokenauth
- extension/encoding
- extension/encoding/jaegerencoding
- extension/encoding/jsonlogencoding
- extension/encoding/otlpencoding
Expand Down
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,17 +283,17 @@ updates:
interval: "weekly"
day: "wednesday"
- package-ecosystem: "gomod"
directory: "/extension/encoding/jaegerencodingextension"
directory: "/extension/encoding"
schedule:
interval: "weekly"
day: "wednesday"
- package-ecosystem: "gomod"
directory: "/extension/encoding/jsonlogencodingextension"
directory: "/extension/encoding/jaegerencodingextension"
schedule:
interval: "weekly"
day: "wednesday"
- package-ecosystem: "gomod"
directory: "/extension/encoding/otlpencodingextension"
directory: "/extension/encoding/jsonlogencodingextension"
schedule:
interval: "weekly"
day: "wednesday"
Expand Down
1 change: 1 addition & 0 deletions cmd/checkapi/allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
connector/servicegraphconnector
extension/encoding
extension/observer
processor/servicegraphprocessor
receiver/carbonreceiver
Expand Down
1 change: 1 addition & 0 deletions extension/encoding/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.Common
47 changes: 47 additions & 0 deletions extension/encoding/encoding.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package encoding // import "github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding"

import (
"go.opentelemetry.io/collector/extension"
"go.opentelemetry.io/collector/pdata/plog"
"go.opentelemetry.io/collector/pdata/pmetric"
"go.opentelemetry.io/collector/pdata/ptrace"
)

// LogsMarshalerExtension is an extension that marshals logs.
type LogsMarshalerExtension interface {
extension.Extension
plog.Marshaler
}

// LogsUnmarshalerExtension is an extension that unmarshals logs.
type LogsUnmarshalerExtension interface {
extension.Extension
plog.Unmarshaler
}

// MetricsMarshalerExtension is an extension that marshals metrics.
type MetricsMarshalerExtension interface {
extension.Extension
pmetric.Marshaler
}

// MetricsUnmarshalerExtension is an extension that unmarshals metrics.
type MetricsUnmarshalerExtension interface {
extension.Extension
pmetric.Unmarshaler
}

// TracesMarshalerExtension is an extension that marshals traces.
type TracesMarshalerExtension interface {
extension.Extension
ptrace.Marshaler
}

// TracesUnmarshalerExtension is an extension that unmarshals traces.
type TracesUnmarshalerExtension interface {
extension.Extension
ptrace.Unmarshaler
}
37 changes: 37 additions & 0 deletions extension/encoding/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding

go 1.20

require (
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/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
go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9 // 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
)
104 changes: 104 additions & 0 deletions extension/encoding/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion extension/encoding/jaegerencodingextension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ import (

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/pdata/ptrace"

"github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding"
)

var _ ptrace.Unmarshaler = &jaegerExtension{}
var _ encoding.TracesUnmarshalerExtension = &jaegerExtension{}

type jaegerExtension struct {
config *Config
Expand Down
3 changes: 3 additions & 0 deletions extension/encoding/jaegerencodingextension/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.20

require (
github.com/jaegertracing/jaeger v1.49.0
github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.0.0-00010101000000-000000000000
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.88.0
github.com/stretchr/testify v1.8.4
go.opentelemetry.io/collector/component v0.88.1-0.20231026220224-6405e152a2d9
Expand Down Expand Up @@ -54,3 +55,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../../pkg/translator/jaeger

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../../pkg/golden

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../
7 changes: 7 additions & 0 deletions extension/encoding/jsonlogencodingextension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/plog"

"github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding"
)

var (
_ encoding.LogsMarshalerExtension = (*jsonLogExtension)(nil)
_ encoding.LogsUnmarshalerExtension = (*jsonLogExtension)(nil)
)

type jsonLogExtension struct {
Expand Down
3 changes: 3 additions & 0 deletions extension/encoding/jsonlogencodingextension/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.20

require (
github.com/json-iterator/go v1.1.12
github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding v0.0.0-00010101000000-000000000000
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
Expand Down Expand Up @@ -39,3 +40,5 @@ require (
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/encoding => ../
3 changes: 3 additions & 0 deletions extension/encoding/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
status:
codeowners:
active: [atoulme, dao-jun, dmitryax, MovieStoreGuy, VihasMakwana]
Loading

0 comments on commit 9624304

Please sign in to comment.