Skip to content

Commit

Permalink
consolidate internal/aws and internal/awsxray folders (#3098)
Browse files Browse the repository at this point in the history
consolidate `internal/aws` and `internal/awsxray` modules into one folder.
├── aws
 │    ├── metrics
 │   └── xray


**Testing:** 
`make all`
  • Loading branch information
mxiamxia authored Apr 14, 2021
1 parent 020dc8c commit 81dc441
Show file tree
Hide file tree
Showing 75 changed files with 75 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ exporter/uptraceexporter/ @open-telemetry/collector-c
extension/httpforwarder/ @open-telemetry/collector-contrib-approvers @asuresh4
extension/observer/ @open-telemetry/collector-contrib-approvers @asuresh4 @jrcamp

internal/awsxray/ @open-telemetry/collector-contrib-approvers @anuraaga @mxiamxia
internal/aws/ @open-telemetry/collector-contrib-approvers @anuraaga @mxiamxia
internal/k8sconfig/ @open-telemetry/collector-contrib-approvers @pmcollins @asuresh4
internal/splunk/ @open-telemetry/collector-contrib-approvers @pmcollins @asuresh4
internal/stanza/ @open-telemetry/collector-contrib-approvers @djaglowski
Expand Down
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,19 @@ updates:
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/internal/aws"
directory: "/internal/aws/metrics"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/internal/awsxray"
directory: "/internal/aws/xray"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/internal/awsxray/testdata/sampleapp"
directory: "/internal/aws/xray/testdata/sampleapp"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/internal/awsxray/testdata/sampleserver"
directory: "/internal/aws/xray/testdata/sampleserver"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsemfexporter/datapoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
"go.uber.org/zap"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws"
aws "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics"
)

var deltaMetricCalculator = aws.NewFloat64DeltaCalculator()
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsemfexporter/datapoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"go.uber.org/zap/zapcore"
"go.uber.org/zap/zaptest/observer"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws"
aws "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics"
)

func generateTestIntGauge(name string) *metricspb.Metric {
Expand Down
13 changes: 2 additions & 11 deletions exporter/awsemfexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,15 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemf
go 1.14

require (
github.com/armon/go-metrics v0.3.3 // indirect
github.com/aws/aws-sdk-go v1.38.18
github.com/census-instrumentation/opencensus-proto v0.3.0
github.com/gogo/googleapis v1.3.0 // indirect
github.com/golang/protobuf v1.5.2
github.com/google/uuid v1.2.0
github.com/hashicorp/go-immutable-radix v1.2.0 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/onsi/ginkgo v1.14.1 // indirect
github.com/onsi/gomega v1.10.2 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws v0.0.0-00010101000000-000000000000
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics v0.0.0-00010101000000-000000000000
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/collector v0.24.1-0.20210414213607-0f75efa9f327
go.uber.org/zap v1.16.0
google.golang.org/protobuf v1.26.0
gopkg.in/ini.v1 v1.57.0 // indirect
)

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws => ../../internal/aws
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics => ./../../internal/aws/metrics
47 changes: 12 additions & 35 deletions exporter/awsemfexporter/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion exporter/awsemfexporter/grouped_metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
"go.uber.org/zap"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws"
aws "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics"
)

// GroupedMetric defines set of metrics with same namespace, timestamp and labels
Expand Down
4 changes: 2 additions & 2 deletions exporter/awsxrayexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/onsi/ginkgo v1.14.1 // indirect
github.com/onsi/gomega v1.10.2 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray v0.0.0-00010101000000-000000000000
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.0.0-00010101000000-000000000000
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/collector v0.24.1-0.20210414213607-0f75efa9f327
Expand All @@ -20,4 +20,4 @@ require (
gopkg.in/ini.v1 v1.57.0 // indirect
)

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray => ./../../internal/awsxray
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray => ./../../internal/aws/xray
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/translator/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
semconventions "go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/translator/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
semconventions "go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func TestAwsFromEc2Resource(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/translator/cause.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
semconventions "go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func makeCause(span pdata.Span, attributes map[string]string, resource pdata.Resource) (isError, isFault bool,
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/translator/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
semconventions "go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func makeHTTP(span pdata.Span) (map[string]string, *awsxray.HTTPData) {
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/translator/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
semconventions "go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

// AWS X-Ray acceptable values for origin field.
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/translator/segment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
semconventions "go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/translator/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
semconventions "go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func makeService(resource pdata.Resource) *awsxray.ServiceData {
Expand Down
2 changes: 1 addition & 1 deletion exporter/awsxrayexporter/translator/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package translator
import (
semconventions "go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func makeSQL(attributes map[string]string) (map[string]string, *awsxray.SQLData) {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/splun

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => ./internal/k8sconfig

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws => ./internal/aws
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics => ./internal/aws/metrics

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray => ./internal/awsxray
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray => ./internal/aws/xray

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/stanza => ./internal/stanza

Expand Down
1 change: 0 additions & 1 deletion internal/aws/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions internal/aws/metrics/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../../Makefile.Common
2 changes: 1 addition & 1 deletion internal/aws/go.mod → internal/aws/metrics/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws
module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/metrics

go 1.14

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package aws
package metrics

import (
"sync"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package aws
package metrics

import (
"math/rand"
Expand Down
1 change: 1 addition & 0 deletions internal/aws/xray/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../../Makefile.Common
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/awsxray/go.mod → internal/aws/xray/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray
module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray

go 1.14

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"deployment_id": 32,
"version_label": "app-5a56-170119_190650-stage-170119_190650"
},
"account_id": "620297135128"
"account_id": "000000000000"
},
"service": {
"compiler_version": "go1.14.6",
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions internal/aws/xray/testdata/sampleapp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../../../../Makefile.Common
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions internal/aws/xray/testdata/sampleserver/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../../../../Makefile.Common
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion internal/awsxray/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion internal/awsxray/testdata/sampleapp/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion internal/awsxray/testdata/sampleserver/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"go.opentelemetry.io/collector/config/configtest"
"go.opentelemetry.io/collector/config/configtls"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver/internal/proxy"
)

Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/receiver/receiverhelper"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver/internal/proxy"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsxrayreceiver/internal/udppoller"
)
Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
"go.uber.org/zap"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

type mockMetricsConsumer struct {
Expand Down
4 changes: 2 additions & 2 deletions receiver/awsxrayreceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ require (
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/onsi/ginkgo v1.14.1 // indirect
github.com/onsi/gomega v1.10.2 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray v0.0.0-00010101000000-000000000000
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.0.0-00010101000000-000000000000
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/stretchr/testify v1.7.0
go.opentelemetry.io/collector v0.24.1-0.20210414213607-0f75efa9f327
go.uber.org/zap v1.16.0
gopkg.in/ini.v1 v1.57.0 // indirect
)

replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray => ./../../internal/awsxray
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray => ./../../internal/aws/xray
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/internal/translator/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func addAWSToResource(aws *awsxray.AWSData, attrs *pdata.AttributeMap) {
Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/internal/translator/cause.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func addCause(seg *awsxray.Segment, span *pdata.Span) {
Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/internal/translator/cause_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/stretchr/testify/assert"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func TestConvertStackFramesToStackTraceStr(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/internal/translator/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"go.opentelemetry.io/collector/translator/conventions"
tracetranslator "go.opentelemetry.io/collector/translator/trace"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func addHTTP(seg *awsxray.Segment, span *pdata.Span) {
Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/internal/translator/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"go.opentelemetry.io/collector/consumer/pdata"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func addMetadata(meta map[string]map[string]interface{}, attrs *pdata.AttributeMap) error {
Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/internal/translator/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"go.opentelemetry.io/collector/consumer/pdata"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/internal/translator/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func addSdkToResource(seg *awsxray.Segment, attrs *pdata.AttributeMap) {
Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/internal/translator/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

func addSQLToSpan(sql *awsxray.SQLData, attrs *pdata.AttributeMap) error {
Expand Down
2 changes: 1 addition & 1 deletion receiver/awsxrayreceiver/internal/translator/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/translator/conventions"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/awsxray"
awsxray "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray"
)

const (
Expand Down
Loading

0 comments on commit 81dc441

Please sign in to comment.