Skip to content

Commit

Permalink
Merge branch 'main' into rename-stackdriver-part2
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Mar 17, 2021
2 parents b4e5f8d + f8c550f commit a3aae22
Show file tree
Hide file tree
Showing 86 changed files with 2,956 additions and 437 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ jobs:
command: make -j2 for-all-target TARGET=lint
- run:
name: Checks
command: make -j4 checklicense impi misspell
command: make -j4 checklicense checkdoc impi misspell
- run:
name: Codegen
command: |
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ BUILD_X2=-X $(BUILD_INFO_IMPORT_PATH).Version=$(VERSION)
BUILD_X3=-X go.opentelemetry.io/collector/internal/version.BuildType=$(BUILD_TYPE)
BUILD_INFO=-ldflags "${BUILD_X1} ${BUILD_X2} ${BUILD_X3}"

COMP_REL_PATH=cmd/otelcontribcol/components.go
MOD_NAME=github.com/open-telemetry/opentelemetry-collector-contrib

# ALL_MODULES includes ./* dirs (excludes . dir and example with go code)
ALL_MODULES := $(shell find . -type f -name "go.mod" -exec dirname {} \; | sort | egrep '^./' )

Expand Down Expand Up @@ -144,6 +147,7 @@ install-tools:
cd $(TOOLS_MOD_DIR) && go install github.com/tcnksm/ghr
cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/collector/cmd/mdatagen
cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/collector/cmd/issuegenerator
cd $(TOOLS_MOD_DIR) && go install go.opentelemetry.io/collector/cmd/checkdoc

.PHONY: run
run:
Expand Down Expand Up @@ -239,3 +243,8 @@ build-examples:
$(MAKE) otelcontribcol-linux_$(ARCH)
docker build -t otelcontribcol-fpm internal/buildscripts/packaging/fpm
docker run --rm -v $(CURDIR):/repo -e PACKAGE=$* -e VERSION=$(VERSION) -e ARCH=$(ARCH) otelcontribcol-fpm

# Verify existence of READMEs for components specified as default components in the collector.
.PHONY: checkdoc
checkdoc:
checkdoc --project-path $(CURDIR) --component-rel-path $(COMP_REL_PATH) --module-name $(MOD_NAME)
4 changes: 2 additions & 2 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ all-srcs:
.DEFAULT_GOAL := common

.PHONY: common
common: checklicense impi lint misspell
common: checklicense checkdoc impi lint misspell

.PHONY: test
test:
Expand All @@ -62,7 +62,7 @@ benchmark:

.PHONY: addlicense
addlicense:
@ADDLICENCESEOUT=`$(ADDLICENCESE) -y -c 'OpenTelemetry Authors' $(ALL_SRC) 2>&1`; \
@ADDLICENCESEOUT=`$(ADDLICENCESE) -y "" -c 'OpenTelemetry Authors' $(ALL_SRC) 2>&1`; \
if [ "$$ADDLICENCESEOUT" ]; then \
echo "$(ADDLICENCESE) FAILED => add License errors:\n"; \
echo "$$ADDLICENCESEOUT\n"; \
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ Approvers ([@open-telemetry/collector-contrib-approvers](https://github.com/orgs
- [Anuraag Agrawal](https://github.com/anuraaga), AWS
- [Daniel Jaglowski](https://github.com/djaglowski), observIQ
- [Dmitrii Anoshin](https://github.com/dmitryax), Splunk
- [James Bebbington](https://github.com/james-bebbington), Google
- [Jay Camp](https://github.com/jrcamp), Splunk
- [Juraci Paixão Kröhling](https://github.com/jpkrohling), Red Hat
- [Kevin Brockhoff](https://github.com/kbrockhoff), Daugherty Business Solutions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
},
{
"Key": "attribute",
"Value": "{\"component\":\"http\",\"http.method\":\"GET\",\"http.status_code\":200,\"http.url\":\"https://api.example.com/users/junit\"}"
"Value": "{\"http.method\":\"GET\",\"http.status_code\":200,\"http.url\":\"https://api.example.com/users/junit\"}"
},
{
"Key": "statusCode",
Expand Down Expand Up @@ -144,7 +144,7 @@
},
{
"Key": "attribute",
"Value": "{\"component\":\"http\",\"http.client_ip\":\"192.168.15.32\",\"http.method\":\"GET\",\"http.status_code\":200,\"http.url\":\"https://api.example.com/users/junit\"}"
"Value": "{\"http.client_ip\":\"192.168.15.32\",\"http.method\":\"GET\",\"http.status_code\":200,\"http.url\":\"https://api.example.com/users/junit\"}"
},
{
"Key": "statusCode",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ func fillResource(resource pdata.Resource) {

func fillHTTPClientSpan(span pdata.Span) {
attributes := make(map[string]interface{})
attributes[semconventions.AttributeComponent] = semconventions.ComponentTypeHTTP
attributes[semconventions.AttributeHTTPMethod] = "GET"
attributes[semconventions.AttributeHTTPURL] = "https://api.example.com/users/junit"
attributes[semconventions.AttributeHTTPStatusCode] = 200
Expand Down Expand Up @@ -146,7 +145,6 @@ func fillHTTPClientSpan(span pdata.Span) {

func fillHTTPServerSpan(span pdata.Span) {
attributes := make(map[string]interface{})
attributes[semconventions.AttributeComponent] = semconventions.ComponentTypeHTTP
attributes[semconventions.AttributeHTTPMethod] = "GET"
attributes[semconventions.AttributeHTTPURL] = "https://api.example.com/users/junit"
attributes[semconventions.AttributeHTTPClientIP] = "192.168.15.32"
Expand Down
2 changes: 0 additions & 2 deletions exporter/awsxrayexporter/awsxray_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ func constructResource() pdata.Resource {

func constructHTTPClientSpan() pdata.Span {
attributes := make(map[string]interface{})
attributes[semconventions.AttributeComponent] = semconventions.ComponentTypeHTTP
attributes[semconventions.AttributeHTTPMethod] = "GET"
attributes[semconventions.AttributeHTTPURL] = "https://api.example.com/users/junit"
attributes[semconventions.AttributeHTTPStatusCode] = 200
Expand Down Expand Up @@ -128,7 +127,6 @@ func constructHTTPClientSpan() pdata.Span {

func constructHTTPServerSpan() pdata.Span {
attributes := make(map[string]interface{})
attributes[semconventions.AttributeComponent] = semconventions.ComponentTypeHTTP
attributes[semconventions.AttributeHTTPMethod] = "GET"
attributes[semconventions.AttributeHTTPURL] = "https://api.example.com/users/junit"
attributes[semconventions.AttributeHTTPClientIP] = "192.168.15.32"
Expand Down
1 change: 0 additions & 1 deletion exporter/awsxrayexporter/translator/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ func makeXRayAttributes(attributes map[string]string, resource pdata.Resource, s
metadata = map[string]map[string]interface{}{}
user string
)
delete(attributes, semconventions.AttributeComponent)
userid, ok := attributes[semconventions.AttributeEnduserID]
if ok {
user = userid
Expand Down
5 changes: 0 additions & 5 deletions exporter/awsxrayexporter/translator/segment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func TestClientSpanWithAwsSdkClient(t *testing.T) {
parentSpanID := newSegmentID()
user := "testingT"
attributes := make(map[string]interface{})
attributes[semconventions.AttributeComponent] = semconventions.ComponentTypeHTTP
attributes[semconventions.AttributeHTTPMethod] = "POST"
attributes[semconventions.AttributeHTTPScheme] = "https"
attributes[semconventions.AttributeHTTPHost] = "dynamodb.us-east-1.amazonaws.com"
Expand All @@ -70,15 +69,13 @@ func TestClientSpanWithAwsSdkClient(t *testing.T) {
assert.Nil(t, err)
assert.True(t, strings.Contains(jsonStr, "DynamoDB"))
assert.False(t, strings.Contains(jsonStr, user))
assert.False(t, strings.Contains(jsonStr, semconventions.AttributeComponent))
assert.False(t, strings.Contains(jsonStr, "user"))
}

func TestClientSpanWithPeerService(t *testing.T) {
spanName := "AmazonDynamoDB.getItem"
parentSpanID := newSegmentID()
attributes := make(map[string]interface{})
attributes[semconventions.AttributeComponent] = semconventions.ComponentTypeHTTP
attributes[semconventions.AttributeHTTPMethod] = "POST"
attributes[semconventions.AttributeHTTPScheme] = "https"
attributes[semconventions.AttributeHTTPHost] = "dynamodb.us-east-1.amazonaws.com"
Expand All @@ -102,7 +99,6 @@ func TestServerSpanWithInternalServerError(t *testing.T) {
userAgent := "PostmanRuntime/7.21.0"
enduser := "go.tester@example.com"
attributes := make(map[string]interface{})
attributes[semconventions.AttributeComponent] = semconventions.ComponentTypeHTTP
attributes[semconventions.AttributeHTTPMethod] = "POST"
attributes[semconventions.AttributeHTTPURL] = "https://api.example.org/api/locations"
attributes[semconventions.AttributeHTTPTarget] = "/api/locations"
Expand Down Expand Up @@ -269,7 +265,6 @@ func TestClientSpanWithRpcHost(t *testing.T) {
func TestSpanWithInvalidTraceId(t *testing.T) {
spanName := "platformapi.widgets.searchWidgets"
attributes := make(map[string]interface{})
attributes[semconventions.AttributeComponent] = semconventions.ComponentTypeGRPC
attributes[semconventions.AttributeHTTPMethod] = "GET"
attributes[semconventions.AttributeHTTPScheme] = "ipv6"
attributes[semconventions.AttributeNetPeerIP] = "2607:f8b0:4000:80c::2004"
Expand Down
3 changes: 0 additions & 3 deletions exporter/awsxrayexporter/translator/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (

func TestClientSpanWithStatementAttribute(t *testing.T) {
attributes := make(map[string]string)
attributes[semconventions.AttributeComponent] = "db"
attributes[semconventions.AttributeDBSystem] = "mysql"
attributes[semconventions.AttributeDBName] = "customers"
attributes[semconventions.AttributeDBStatement] = "SELECT * FROM user WHERE user_id = ?"
Expand All @@ -49,7 +48,6 @@ func TestClientSpanWithStatementAttribute(t *testing.T) {

func TestClientSpanWithNonSQLDatabase(t *testing.T) {
attributes := make(map[string]string)
attributes[semconventions.AttributeComponent] = "db"
attributes[semconventions.AttributeDBSystem] = "redis"
attributes[semconventions.AttributeDBName] = "0"
attributes[semconventions.AttributeDBStatement] = "SET key value"
Expand All @@ -65,7 +63,6 @@ func TestClientSpanWithNonSQLDatabase(t *testing.T) {

func TestClientSpanWithoutDBurlAttribute(t *testing.T) {
attributes := make(map[string]string)
attributes[semconventions.AttributeComponent] = "db"
attributes[semconventions.AttributeDBSystem] = "postgresql"
attributes[semconventions.AttributeDBName] = "customers"
attributes[semconventions.AttributeDBStatement] = "SELECT * FROM user WHERE user_id = ?"
Expand Down
1 change: 0 additions & 1 deletion exporter/awsxrayexporter/translator/writer_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func BenchmarkWithPool(b *testing.B) {

func constructWriterPoolSpan() pdata.Span {
attributes := make(map[string]interface{})
attributes[semconventions.AttributeComponent] = semconventions.ComponentTypeHTTP
attributes[semconventions.AttributeHTTPMethod] = "GET"
attributes[semconventions.AttributeHTTPURL] = "https://api.example.com/users/junit"
attributes[semconventions.AttributeHTTPClientIP] = "192.168.15.32"
Expand Down
10 changes: 1 addition & 9 deletions exporter/signalfxexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,6 @@ func TestDefaultTranslationRules(t *testing.T) {
require.Equal(t, 1, len(dps))
require.Equal(t, 3, len(dps[0].Dimensions))
require.Equal(t, int64(10e9), *dps[0].Value.IntValue)

// memory page faults and working set renames
_, ok = metrics["container_memory_working_set_bytes"]
require.True(t, ok, "container_memory_working_set_bytes not found")
_, ok = metrics["container_memory_page_faults"]
require.True(t, ok, "container_memory_page_faults not found")
_, ok = metrics["container_memory_major_page_faults"]
require.True(t, ok, "container_memory_major_page_faults not found")
}

func TestCreateMetricsExporterWithDefaultExcludeMetrics(t *testing.T) {
Expand Down Expand Up @@ -1067,7 +1059,7 @@ func TestDefaultExcludes_not_translated(t *testing.T) {
require.NoError(t, err)

rms := getResourceMetrics(metrics)
require.Equal(t, 72, rms.InstrumentationLibraryMetrics().At(0).Metrics().Len())
require.Equal(t, 71, rms.InstrumentationLibraryMetrics().At(0).Metrics().Len())
dps := converter.MetricDataToSignalFxV2(rms)
require.Equal(t, 0, len(dps))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@
{
"container.memory.rss": null
},
{
"container.memory.usage": null
},
{
"container.memory.working_set": null
},
Expand Down Expand Up @@ -224,4 +221,4 @@
{
"k8s.volume.inodes.used": null
}
]
]
Loading

0 comments on commit a3aae22

Please sign in to comment.