Skip to content

Commit

Permalink
Merge tag 'v1.4.0' of github.com:open-telemetry/opentelemetry-proto-g…
Browse files Browse the repository at this point in the history
…o into mike/update-proto-2

Module set all, Version v1.4.0
-----BEGIN SSH SIGNATURE-----
U1NIU0lHAAAAAQAAAhcAAAAHc3NoLXJzYQAAAAMBAAEAAAIBAKPZJFEnbUEMpjgH+rae0P
F71PPgEX77tsI8HSkSLfnhj9mdZhTWmVtMkM1y5thLnmY5BFMXgATsKQadB/E/qNDYs0kT
F7oYjHaAp9jkwIL69bGf5M+RFhV4NxQo90A86Bh3yWFkfG3RidmEfWthvknRYw4E1QRiyR
zgBSIZ9VZgaMtu3cK5MHgNchAF0jkQBZ4YYAhCBSsFWwr/JYCFQxgBeG5tGBEfWjjDg+RQ
Vh+lU0iKForTV8/S0LzPdLI2MBexaG0eEVUMt3GQnCX/b/IpUSPmjyEo52Z9EBIRMUjlS6
89ibY62qXryktv85yqK5DJb+d2AvaavN39bakwSzkSOrRcTFyhC2j1w1WsUx1Jw8bFRQkb
ImUp1SDErizQRFKdFQGxeXDw+a4oXZrALJ9ABoCgjbXCPsc0Yq5w0QwJkA80zBxuyouC0g
PQwx9ZxwNgKfLox0ytjSXs+XuUKgHWN9qFfIUO6RZ8Aq9TxX+VfZTp2IsuUX5x/pw4Rv+9
F8jrUuWlCFxBs4kPtVZQ5gUkVtggslVPY2Pn67KOj5Uy1oIQTw5BCzcLO8GdcQ4yDXlpso
LSvp1AWQeC1mWVbBc9EOTkKo/tEYbyb2bOJSbQfzG+dvND29W6eJVdhkNmya5H/AdCV06U
kbFo97K46wpRF4GelldOXNFm5DbZ7S2nAAAAA2dpdAAAAAAAAAAGc2hhNTEyAAACFAAAAA
xyc2Etc2hhMi0yNTYAAAIAAL8gc41EJAvXAcF2UnQVoOAJnLHKB9snsORMHn1z5HRcVULr
7Z8IfPBFUbQ7y09PQboL7SnaxutTb61KaFH+9GBBaXBDc6LHh0Q9CmARhTkyjAcsD/srVU
avkp7+2rphpl/5K6EaXcBIN8SmTim9w7TZiRBNenx2dNDKy2N2++Ugj0zKvQMIIjd3kuDc
NKYfIiAlE5TlO+9iIemvKLmh1ySPK5o6LIKKBZ7BEvgnHHadeFLTDa/HIS6zicZVhzP6F+
H4xJhMO/KWOsGUfi/SM+iiP9dvIL3Po2BX1AmGLo6oSEUB2I0eTcnz4YS1i02nkrJVS5zA
9WLVfgRcj/ed6vKxSgeESen9/KODn2mOLp4fin9dzGE2EogRRsHXO4p86LYte0gHV+GvQo
+iQ+VVcFelaZBnT3Y6MvXDNWMEUg/rwbVGSF63vf+5o/lEjAq/+KVRYkR8WvYo5msbbuOl
QCOpBdKWLbzvrCeSFk1CEbTpOg2YUVgBrP7M+p1fYSKp37zxxWWrhOYZ1WUIWvj70Dkhl+
mpsZM8EMZGYWTSBxX9rGRag8y133QfFy1tHVR2mws9a+bCWDrcfhykGOVpkFIH3NDA6zWC
7WJXS0+BYtbuppe5uQi+yosy6sV1TL1TPoYmI/f3o/sPJc53RTxY/XCE+y5IgXObCXqCtO
a4RjU=
-----END SSH SIGNATURE-----

* tag 'v1.4.0' of github.com:open-telemetry/opentelemetry-proto-go: (89 commits)
  Upgrade proto to v1.4.0 (open-telemetry#193)
  Don't run clean-gen twice (open-telemetry#214)
  clean the gen folder before running tidy (open-telemetry#211)
  Remove compat from go mod tidy (open-telemetry#213)
  Update module github.com/grpc-ecosystem/grpc-gateway/v2 to v2.24.0 (open-telemetry#209)
  Update google.golang.org/genproto/googleapis/api digest to e639e21 (open-telemetry#197)
  Update module golang.org/x/net to v0.31.0 (open-telemetry#203)
  Update google.golang.org/genproto/googleapis/rpc digest to e639e21 (open-telemetry#198)
  Update module golang.org/x/text to v0.20.0 (open-telemetry#206)
  Update module go.opentelemetry.io/build-tools/multimod to v0.15.0 (open-telemetry#201)
  Prevent the use of toolchain in go.mod (open-telemetry#202)
  Document and test supported versions of Go (open-telemetry#205)
  Switch from dependabot to renovate (open-telemetry#196)
  Bump google.golang.org/protobuf from 1.35.1 to 1.35.2 in /slim/otlp (open-telemetry#192)
  Bump google.golang.org/protobuf from 1.35.1 to 1.35.2 in /otlp (open-telemetry#191)
  Bump github.com/grpc-ecosystem/grpc-gateway/v2 in /otlp (open-telemetry#188)
  Bump google.golang.org/protobuf from 1.34.2 to 1.35.1 in /slim/otlp (open-telemetry#187)
  Bump google.golang.org/protobuf from 1.34.2 to 1.35.1 in /otlp (open-telemetry#186)
  Bump github.com/grpc-ecosystem/grpc-gateway/v2 in /otlp (open-telemetry#185)
  Bump github.com/grpc-ecosystem/grpc-gateway/v2 in /otlp (open-telemetry#184)
  ...
  • Loading branch information
MikeGoldsmith committed Dec 12, 2024
2 parents 7aa5296 + 158176a commit 5a97322
Show file tree
Hide file tree
Showing 17 changed files with 2,949 additions and 923 deletions.
39 changes: 0 additions & 39 deletions .github/dependabot.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI
on:
push:
branches:
- main
pull_request:
env:
DEFAULT_GO_VERSION: "~1.23.0"
jobs:
generate-and-check:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Generate
run: make clean protobuf
- name: Check
run: make toolchain-check check-clean-work-tree
compatibility-test:
strategy:
matrix:
go-version: ["~1.23.0", "~1.22.4"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache-dependency-path: "**/go.sum"
- name: Generate
run: make clean protobuf go-mod-tidy
- name: Run tests
run: make test
test-compatibility:
runs-on: ubuntu-latest
needs: [compatibility-test]
if: always()
steps:
- name: Test if compatibility-test workflow passed
run: |
echo ${{ needs.compatibility-test.result }}
test ${{ needs.compatibility-test.result }} == "success"
13 changes: 0 additions & 13 deletions .github/workflows/dependabot-check.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/gen-check.yaml

This file was deleted.

116 changes: 85 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
PROTOC_VERSION := 3.14.0

TOOLS_MOD_DIR := ./internal/tools
PROTOBUF_VERSION := v1
PROTOBUF_VERSION := v1*
OTEL_PROTO_SUBMODULE := opentelemetry-proto
GEN_TEMP_DIR := gen
SUBMODULE_PROTO_FILES := $(wildcard $(OTEL_PROTO_SUBMODULE)/opentelemetry/proto/*/$(PROTOBUF_VERSION)/*.proto) $(wildcard $(OTEL_PROTO_SUBMODULE)/opentelemetry/proto/collector/*/$(PROTOBUF_VERSION)/*.proto)
Expand All @@ -36,14 +36,23 @@ ifeq ($(strip $(SUBMODULE_PROTO_FILES)),)
$(error Submodule at $(OTEL_PROTO_SUBMODULE) is not checked out, use "git submodule update --init")
endif

GO := go
PROTOBUF_GEN_DIR := opentelemetry-proto-gen
PROTOBUF_TEMP_DIR := $(GEN_TEMP_DIR)/go
GO := go
GO_MOD_ROOT := github.com/honeycombio/opentelemetry-proto-go
ALL_GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
ALL_GO_SUB_MOD_DIRS := $(shell find . -type f -name 'go.mod' -mindepth 2 -exec dirname {} \; | sort)
OTEL_GO_MOD_DIRS := $(filter-out $(TOOLS_MOD_DIR), $(ALL_GO_SUB_MOD_DIRS))
TIMEOUT = 60

PROTOBUF_GEN_DIR := opentelemetry-proto-gen
PROTOBUF_TEMP_DIR := $(GEN_TEMP_DIR)/go

PROTO_SOURCE_DIR := $(GEN_TEMP_DIR)/proto
SOURCE_PROTO_FILES := $(subst $(OTEL_PROTO_SUBMODULE),$(PROTO_SOURCE_DIR),$(SUBMODULE_PROTO_FILES))
GO_MOD_ROOT := github.com/honeycombio/opentelemetry-proto-go
OTLP_OUTPUT_DIR := otlp
GO_VERSION := 1.17

PROTOSLIM_SOURCE_DIR := $(GEN_TEMP_DIR)/slim/proto
SOURCE_PROTOSLIM_FILES := $(subst $(OTEL_PROTO_SUBMODULE),$(PROTOSLIM_SOURCE_DIR),$(SUBMODULE_PROTO_FILES))
OTLPSLIM_OUTPUT_DIR := slim/otlp

# Function to execute a command. Note the empty line before endef to make sure each command
# gets executed separately instead of concatenated with previous one.
Expand All @@ -55,6 +64,7 @@ endef

OTEL_DOCKER_PROTOBUF ?= otel/build-protobuf:0.24.0
PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${OTEL_DOCKER_PROTOBUF} --proto_path="$(PROTO_SOURCE_DIR)"
PROTOC_SLIM := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${OTEL_DOCKER_PROTOBUF} --proto_path="$(PROTOSLIM_SOURCE_DIR)"

.DEFAULT_GOAL := protobuf

Expand All @@ -71,14 +81,11 @@ $(TOOLS)/%: | $(TOOLS)
MULTIMOD = $(TOOLS)/multimod
$(TOOLS)/multimod: PACKAGE=go.opentelemetry.io/build-tools/multimod

DBOTCONF = $(TOOLS)/dbotconf
$(TOOLS)/dbotconf: PACKAGE=go.opentelemetry.io/build-tools/dbotconf

.PHONY: tools
tools: $(DBOTCONF) $(MULTIMOD)
tools: $(MULTIMOD)

.PHONY: protobuf
protobuf: protobuf-source gen-otlp-protobuf copy-otlp-protobuf
protobuf: protobuf-source gen-otlp-protobuf copy-otlp-protobuf gen-otlp-protobuf-slim copy-otlp-protobuf-slim

.PHONY: protobuf-source
protobuf-source: $(SOURCE_PROTO_FILES)
Expand All @@ -96,6 +103,19 @@ $(PROTO_SOURCE_DIR)/%.proto: $(OTEL_PROTO_SUBMODULE)/%.proto
sed -e $(SED_EXPR) "$<" >"$@.tmp"; \
mv "$@.tmp" "$@"

# The sed expression for replacing the go_package option in proto
# file with a one that's valid for us.
SED_EXPR_SLIM := 's,go_package = "go.opentelemetry.io/proto/otlp/,go_package = "$(GO_MOD_ROOT)/$(OTLPSLIM_OUTPUT_DIR)/,'

# This copies proto files from submodule into $(PROTO_SOURCE_DIR),
# thus satisfying the $(SOURCE_PROTOSLIM_FILES) prerequisite. The copies
# have their package name replaced by go.opentelemetry.io/proto.
$(PROTOSLIM_SOURCE_DIR)/%.proto: $(OTEL_PROTO_SUBMODULE)/%.proto
@ \
mkdir -p $(@D); \
sed -e $(SED_EXPR_SLIM) "$<" >"$@.tmp"; \
mv "$@.tmp" "$@"

.PHONY: gen-otlp-protobuf
gen-otlp-protobuf: $(SOURCE_PROTO_FILES)
rm -rf ./$(PROTOBUF_TEMP_DIR)
Expand All @@ -104,21 +124,60 @@ gen-otlp-protobuf: $(SOURCE_PROTO_FILES)
$(PROTOC) --grpc-gateway_out=logtostderr=true,grpc_api_configuration=$(OTEL_PROTO_SUBMODULE)/opentelemetry/proto/collector/trace/v1/trace_service_http.yaml:./$(PROTOBUF_TEMP_DIR) --go_out=./$(PROTOBUF_TEMP_DIR) --go-grpc_out=./$(PROTOBUF_TEMP_DIR) $(PROTO_SOURCE_DIR)/opentelemetry/proto/collector/trace/v1/trace_service.proto
$(PROTOC) --grpc-gateway_out=logtostderr=true,grpc_api_configuration=$(OTEL_PROTO_SUBMODULE)/opentelemetry/proto/collector/metrics/v1/metrics_service_http.yaml:./$(PROTOBUF_TEMP_DIR) --go_out=./$(PROTOBUF_TEMP_DIR) --go-grpc_out=./$(PROTOBUF_TEMP_DIR) $(PROTO_SOURCE_DIR)/opentelemetry/proto/collector/metrics/v1/metrics_service.proto
$(PROTOC) --grpc-gateway_out=logtostderr=true,grpc_api_configuration=$(OTEL_PROTO_SUBMODULE)/opentelemetry/proto/collector/logs/v1/logs_service_http.yaml:./$(PROTOBUF_TEMP_DIR) --go_out=./$(PROTOBUF_TEMP_DIR) --go-grpc_out=./$(PROTOBUF_TEMP_DIR) $(PROTO_SOURCE_DIR)/opentelemetry/proto/collector/logs/v1/logs_service.proto
$(PROTOC) --grpc-gateway_out=logtostderr=true,grpc_api_configuration=$(OTEL_PROTO_SUBMODULE)/opentelemetry/proto/collector/profiles/v1development/profiles_service_http.yaml:./$(PROTOBUF_TEMP_DIR) --go_out=./$(PROTOBUF_TEMP_DIR) --go-grpc_out=./$(PROTOBUF_TEMP_DIR) $(PROTO_SOURCE_DIR)/opentelemetry/proto/collector/profiles/v1development/profiles_service.proto


.PHONY: copy-otlp-protobuf
copy-otlp-protobuf:
rm -rf ./$(OTLP_OUTPUT_DIR)
mkdir -p ./$(OTLP_OUTPUT_DIR)
rm -rf ./$(OTLP_OUTPUT_DIR)/*/
@rsync -a $(PROTOBUF_TEMP_DIR)/go.opentelemetry.io/proto/otlp/ ./$(OTLP_OUTPUT_DIR)
cd ./$(OTLP_OUTPUT_DIR) \
&& go mod init $(GO_MOD_ROOT)/$(OTLP_OUTPUT_DIR) \
&& go mod edit -go=$(GO_VERSION) \
&& go mod tidy
cd ./$(OTLP_OUTPUT_DIR) && go mod tidy

.PHONY: gen-otlp-protobuf-slim
gen-otlp-protobuf-slim: $(SOURCE_PROTOSLIM_FILES)
rm -rf ./$(PROTOBUF_TEMP_DIR)
mkdir -p ./$(PROTOBUF_TEMP_DIR)
$(foreach file,$(SOURCE_PROTOSLIM_FILES),$(call exec-command,$(PROTOC_SLIM) $(PROTO_INCLUDES) --go_out=./$(PROTOBUF_TEMP_DIR) $(file)))

.PHONY: copy-otlp-protobuf-slim
copy-otlp-protobuf-slim:
rm -rf $(OTLPSLIM_OUTPUT_DIR)/*/
@rsync -a $(PROTOBUF_TEMP_DIR)/go.opentelemetry.io/proto/slim/otlp/ ./$(OTLPSLIM_OUTPUT_DIR)
cd ./$(OTLPSLIM_OUTPUT_DIR) && go mod tidy

.PHONY: toolchain-check
toolchain-check:
@toolchainRes=$$(for f in $(ALL_GO_MOD_DIRS); do \
awk '/^toolchain/ { found=1; next } END { if (found) print FILENAME }' $$f/go.mod; \
done); \
if [ -n "$${toolchainRes}" ]; then \
echo "toolchain checking failed:"; echo "$${toolchainRes}"; \
exit 1; \
fi

.PHONY: clean-gen
clean-gen:
rm -rf $(GEN_TEMP_DIR)

.PHONY: clean
clean:
rm -rf $(GEN_TEMP_DIR) $(OTLP_OUTPUT_DIR)
rm -rf $(GEN_TEMP_DIR)
rm -rf $(OTLP_OUTPUT_DIR)/*/ $(OTLPSLIM_OUTPUT_DIR)/*/

.PHONY: go-mod-tidy
go-mod-tidy: clean-gen $(ALL_GO_MOD_DIRS:%=go-mod-tidy/%)
go-mod-tidy/%: DIR=$*
go-mod-tidy/%:
@echo "$(GO) mod tidy in $(DIR)" \
&& cd $(DIR) \
&& $(GO) mod tidy

test: $(OTEL_GO_MOD_DIRS:%=test/%)
test/%: DIR=$*
test/%:
@echo "$(GO) test -timeout $(TIMEOUT)s $(ARGS) $(DIR)/..." \
&& cd $(DIR) \
&& $(GO) test -timeout $(TIMEOUT)s $(ARGS) ./...

.PHONY: check-clean-work-tree
check-clean-work-tree:
Expand All @@ -130,15 +189,6 @@ check-clean-work-tree:
exit 1; \
fi

DEPENDABOT_CONFIG = .github/dependabot.yml
.PHONY: dependabot-check
dependabot-check: | $(DBOTCONF)
@$(DBOTCONF) verify $(DEPENDABOT_CONFIG) || printf "\n(run: make dependabot-generate)\n"

.PHONY: dependabot-generate
dependabot-generate: | $(DBOTCONF)
@$(DBOTCONF) generate > $(DEPENDABOT_CONFIG)

# Releasing

.PHONY: submodule-version
Expand All @@ -159,7 +209,11 @@ verify-versions: | $(MULTIMOD)
$(MULTIMOD) verify

COMMIT ?= "HEAD"
.PHONY: add-tags
add-tags: | $(MULTIMOD)
@[ "${MODSET}" ] || ( echo "MODSET unset: set to taget module set from versions.yaml"; exit 1 )
$(MULTIMOD) verify && $(MULTIMOD) tag -m ${MODSET} -c ${COMMIT}
REMOTE ?= upstream
.PHONY: push-tags
push-tags: | $(MULTIMOD)
$(MULTIMOD) verify
set -e; for tag in `$(MULTIMOD) tag -m all -c ${COMMIT} --print-tags | grep -v "Using" `; do \
echo "pushing tag $${tag}"; \
git push ${REMOTE} $${tag}; \
done;
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,26 @@ This is a modified version of the Go OpenTelemtry protobuf files to re-add depre
You should not depend on this module directly but instead use a replace in your go.mod to swap out the official proto package with this one like this:

```golang
replace go.opentelemetry.io/proto/otlp => github.com/honeycombio/opentelemetry-proto-go/otlp v0.19.0
replace go.opentelemetry.io/proto/otlp => github.com/honeycombio/opentelemetry-proto-go/otlp v1.4.0-compat
```

## Versioning Policy

The auto-generated Go code follows the stability guarantees as defined in
[maturity
level](https://github.com/open-telemetry/opentelemetry-proto?tab=readme-ov-file#maturity-level).

Versioning of modules in this project will be idiomatic of a Go project using [Go modules](https://github.com/golang/go/wiki/Modules).
They will use [semantic import versioning](https://github.com/golang/go/wiki/Modules#semantic-import-versioning).
Meaning modules will comply with [semver 2.0](https://semver.org/spec/v2.0.0.html) with the following exception:

- Packages with a `development` suffix do not comply with [semver 2.0](https://semver.org/spec/v2.0.0.html).
- Backwards incompatible changes may be introduced to these packages between minor versions.
- These packages are intended to be temporary.
They will be deprecated and removed when the protobuf definition stabilizes or is removed.
If the protobuf definition stabilizes, the package will be replaced with a stable "non-development" package.
If the protobuf definition is removed, the package will be removed without a replacement.

## Getting Started

Install the latest version in your project.
Expand All @@ -36,3 +53,32 @@ import (
tracepb "go.opentelemetry.io/proto/otlp/trace/v1"
)
```

### Compatibility

OpenTelemetry Proto Go ensures compatibility with the current supported
versions of
the [Go language](https://golang.org/doc/devel/release#policy):

> Each major Go release is supported until there are two newer major releases.
> For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release.
For versions of Go that are no longer supported upstream, opentelemetry-proto-go will
stop ensuring compatibility with these versions in the following manner:

- A minor release of opentelemetry-proto-go will be made to add support for the new
supported release of Go.
- The following minor release of opentelemetry-proto-go will remove compatibility
testing for the oldest (now archived upstream) version of Go. This, and
future, releases of opentelemetry-proto-=go may include features only supported by
the currently supported versions of Go.

This project is tested on the following systems.

| OS | Go Version |
| -------- | ---------- |
| Ubuntu | 1.23 |
| Ubuntu | 1.22 |

While this project should work for other systems, no compatibility guarantees
are made for those systems currently.
Loading

0 comments on commit 5a97322

Please sign in to comment.