Skip to content

Commit

Permalink
Merge pull request #2094 from aws-observability/hotfix/backport22707
Browse files Browse the repository at this point in the history
Backport fix for X-Ray
  • Loading branch information
Aneurysm9 authored May 23, 2023
2 parents 25a5639 + 6bbccd5 commit 6047ebf
Show file tree
Hide file tree
Showing 12,886 changed files with 3,811,617 additions and 2 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ jobs:
echo "replace go.opentelemetry.io/collector => ./pkg/opentelemetry-collector" >> go.mod
cat go.mod
ls pkg
- name: Apply patches
run: make apply-patches

#Cache go build and dependencies before making unit testing and build
#Samples codes for different OS: https://github.com/actions/cache/blob/main/examples.md#go---modules
#Since we are using Linux, the go packages are in /go/pkg/mod and build are in /.cache/go-build
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/PR-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ jobs:
- name: Checkout
if: ${{ needs.changes.outputs.changed == 'true' }}
uses: actions/checkout@v3

- name: apply patches
if: ${{ needs.changes.outputs.changed == 'true' }}
run: make apply-patches

- name: install tools
if: ${{ needs.changes.outputs.changed == 'true' }}
run: make install-tools
Expand Down Expand Up @@ -115,6 +120,10 @@ jobs:
if: ${{ needs.changes.outputs.changed == 'true' }}
uses: actions/checkout@v3

- name: Apply patches
if: ${{ needs.changes.outputs.changed == 'true' }}
run: make apply-patches

- name: Cache go
if: ${{ needs.changes.outputs.changed == 'true' }}
uses: actions/cache@v3
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ALL_SHELL_SCRIPTS := "tools/ctl/linux/aws-otel-collector-ctl"

BUILD_INFO_IMPORT_PATH=$(AOC_IMPORT_PATH)/tools/version

GOBUILD=GO111MODULE=on CGO_ENABLED=0 installsuffix=cgo go build -trimpath
GOBUILD=GO111MODULE=on CGO_ENABLED=0 GOPROXY=off installsuffix=cgo go build -trimpath

# Use linker flags to provide version/build settings
LDFLAGS=-ldflags "-s -w -X $(BUILD_INFO_IMPORT_PATH).GitHash=$(GIT_SHA) \
Expand All @@ -50,7 +50,9 @@ $(GOMODULES):
.PHONY: for-all-target
for-all-target: $(GOMODULES)


PATCHES := $(shell find ./patches -name *.patch)
apply-patches: $(PATCHES)
$(foreach patch,$(PATCHES), patch --posix --forward -p1 < $(patch))

all-modules:
@echo $(ALL_MODULES) | tr ' ' '\n' | sort
Expand Down
28 changes: 28 additions & 0 deletions patches/2079-xray-ddb-attrs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--- a/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter/internal/translator/aws.go
+++ b/vendor/github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsxrayexporter/internal/translator/aws.go
@@ -157,14 +157,19 @@ func makeAws(attributes map[string]pcommon.Value, resource pcommon.Resource, log
queueURL = value.Str()
}
if value, ok := attributes[conventions.AttributeAWSDynamoDBTableNames]; ok {
- if value.Slice().Len() == 1 {
- tableName = value.Slice().At(0).Str()
- } else if value.Slice().Len() > 1 {
- tableName = ""
- tableNames = []string{}
- for i := 0; i < value.Slice().Len(); i++ {
- tableNames = append(tableNames, value.Slice().At(i).Str())
+ switch value.Type() {
+ case pcommon.ValueTypeSlice:
+ if value.Slice().Len() == 1 {
+ tableName = value.Slice().At(0).Str()
+ } else if value.Slice().Len() > 1 {
+ tableName = ""
+ tableNames = []string{}
+ for i := 0; i < value.Slice().Len(); i++ {
+ tableNames = append(tableNames, value.Slice().At(i).Str())
+ }
}
+ case pcommon.ValueTypeStr:
+ tableName = value.Str()
}
}
202 changes: 202 additions & 0 deletions vendor/cloud.google.com/go/compute/LICENSE

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

18 changes: 18 additions & 0 deletions vendor/cloud.google.com/go/compute/internal/version.go

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

19 changes: 19 additions & 0 deletions vendor/cloud.google.com/go/compute/metadata/CHANGES.md

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

Loading

0 comments on commit 6047ebf

Please sign in to comment.