Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds profiles as another signal #1

Merged
merged 26 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ coverage.html

# golang
go.work*

# TODO(@petethepig): remove this
pdata/pprofile/profiles
pdata/pprofile/profiles-all
*.pprof
26 changes: 22 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ OPENTELEMETRY_PROTO_SRC_DIR=pdata/internal/opentelemetry-proto
OPENTELEMETRY_PROTO_VERSION=v0.20.0

# Find all .proto files.
OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto))
OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/alternatives/*/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto))

# Target directory to write generated files to.
PROTO_TARGET_GEN_DIR=pdata/internal/data/protogen
Expand All @@ -210,9 +210,11 @@ genproto-cleanup:

# Generate OTLP Protobuf Go files. This will place generated files in PROTO_TARGET_GEN_DIR.
genproto: genproto-cleanup
mkdir -p ${OPENTELEMETRY_PROTO_SRC_DIR}
curl -sSL https://api.github.com/repos/open-telemetry/opentelemetry-proto/tarball/${OPENTELEMETRY_PROTO_VERSION} | tar xz --strip 1 -C ${OPENTELEMETRY_PROTO_SRC_DIR}
# Call a sub-make to ensure OPENTELEMETRY_PROTO_FILES is populated
# TODO(@petethepig): undo this
# mkdir -p ${OPENTELEMETRY_PROTO_SRC_DIR}
# curl -sSL https://api.github.com/repos/open-telemetry/opentelemetry-proto/tarball/${OPENTELEMETRY_PROTO_VERSION} | tar xz --strip 1 -C ${OPENTELEMETRY_PROTO_SRC_DIR}
# # Call a sub-make to ensure OPENTELEMETRY_PROTO_FILES is populated
rsync -av ../opentelemetry-proto/ ${OPENTELEMETRY_PROTO_SRC_DIR}
$(MAKE) genproto_sub
$(MAKE) fmt
$(MAKE) genproto-cleanup
Expand All @@ -235,6 +237,8 @@ genproto_sub:
# HACK: Workaround for istio 1.15 / envoy 1.23.1 mistakenly emitting deprecated field.
# reserved 1000 -> repeated ScopeLogs deprecated_scope_logs = 1000;
sed 's/reserved 1000;/repeated ScopeLogs deprecated_scope_logs = 1000;/g' $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/logs/v1/logs.proto 1<> $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/logs/v1/logs.proto
# reserved 1000 -> repeated ScopeProfiles deprecated_scope_profiles = 1000;
sed 's/reserved 1000;/repeated ScopeProfiles deprecated_scope_profiles = 1000;/g' $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/profiles/v1/profiles.proto 1<> $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/profiles/v1/profiles.proto
# reserved 1000 -> repeated ScopeMetrics deprecated_scope_metrics = 1000;
sed 's/reserved 1000;/repeated ScopeMetrics deprecated_scope_metrics = 1000;/g' $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/metrics/v1/metrics.proto 1<> $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/metrics/v1/metrics.proto
# reserved 1000 -> repeated ScopeSpans deprecated_scope_spans = 1000;
Expand Down Expand Up @@ -504,3 +508,17 @@ chlog-update: $(CHLOG)
.PHONY: builder-integration-test
builder-integration-test: $(ENVSUBST)
cd ./cmd/builder && ./test/test.sh

.PHONY: profile-benchmark
profile-benchmark: $(ENVSUBST)
cd ./pdata/pprofile && go test -bench . -run=^$$ | tee /tmp/benchmarks.txt
@echo "Benchmark results for posting to Google Sheets:"
cat /tmp/benchmarks.txt | grep 'Benchmark' | grep 'retained_objects' | grep -v 'not found' | sed -E "s/[[:space:]]+/ /g"

.PHONY: profile-benchmark-generate
profile-benchmark-generate:
cd pdata/pprofile && go run ./benchmarks-generator

.PHONY: profile-maligned
profile-maligned:
cd pdata/internal/data/protogen/profiles/v1 && maligned .
2 changes: 2 additions & 0 deletions cmd/otelcorecol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ require (
github.com/google/uuid v1.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/jzelinskie/must v0.0.1 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/knadh/koanf v1.5.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
Expand Down Expand Up @@ -89,6 +90,7 @@ require (
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/exp v0.0.0-20230725012225-302865e7556b // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/text v0.9.0 // indirect
gonum.org/v1/gonum v0.13.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions cmd/otelcorecol/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/jzelinskie/must v0.0.1 h1:LT7fxrQCW9yWDkjnF75XFvODjKb6Su7qlx2LO8967Y8=
github.com/jzelinskie/must v0.0.1/go.mod h1:BTPQ0S/fIbENkk9zFU4JBtdtB+B4vibfTyeDC48z6zc=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
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=
Expand Down Expand Up @@ -1068,6 +1070,8 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE=
golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
golang.org/x/exp v0.0.0-20230725012225-302865e7556b h1:tK7yjGqVRzYdXsBcfD2MLhFAhHfDgGLm2rY1ub7FA9k=
golang.org/x/exp v0.0.0-20230725012225-302865e7556b/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
Expand Down
3 changes: 3 additions & 0 deletions component/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,7 @@ const (

// DataTypeLogs is the data type tag for logs.
DataTypeLogs DataType = "logs"

// DataTypeProfiles is the data type tag for profiles.
DataTypeProfiles DataType = "profiles"
)
Loading