Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

opentelemetry: upgrade all packages to v1.16/v0.81#54969

Merged
bobheadxi merged 9 commits into
mainfrom
opentelemetry-1-13-0-81
Jul 17, 2023
Merged

opentelemetry: upgrade all packages to v1.16/v0.81#54969
bobheadxi merged 9 commits into
mainfrom
opentelemetry-1-13-0-81

Conversation

@bobheadxi

@bobheadxi bobheadxi commented Jul 14, 2023

Copy link
Copy Markdown
Member

OpenTelemetry versioning scheme is a bit convoluted but this upgrades all OpenTelemetry-related packages together to around v1.16 (for Go SDK packages) and v0.81 (for Collector packages, and the Collector itself) - thankfully there were fewer breaking changes this time around. Big diff is almost entirely deps.bzl

One of the more significant changes is we now have access to the finalized OpenTelemetry Metrics API, which will come in handy for https://github.com/sourcegraph/sourcegraph/issues/53775, as well as various Collector improvements from recent releases: https://github.com/open-telemetry/opentelemetry-collector-contrib/releases I skimmed through the recent breaking changes and I don't think there's anything that affects us

Update: https://github.com/sourcegraph/sourcegraph/pull/54969#issuecomment-1638557302

Test plan

sg run otel-collector jaeger
sg start

See v0.81 collector running:

[ otel-collector] 2023-07-14T21:37:54.709Z      info    jaegerexporter@v0.81.0/exporter.go:173  State of the connection with the Jaeger Collector backend{"kind": "exporter", "data_type": "traces", "name": "jaeger", "state": "READY"}

Do a trace, get a result from multiple services:

image

@cla-bot cla-bot Bot added the cla-signed label Jul 14, 2023
@willdollman

Copy link
Copy Markdown
Contributor

I've rebuild the base image with the updated version of opentelemetry-collector. Running the image locally, I see the updated package:

$ docker load --input $(bazel cquery //docker-images/opentelemetry-co
llector:image_tarball --config darwin-docker --output=files)

$ docker run -it --entrypoint /bin/sh  opentelemetry-collector:candidate

# /bin/otelcol-sourcegraph  --config=/etc/otel-collector/configs/logging.yaml
2023-07-14T19:14:34.611Z        info    service/telemetry.go:81 Setting up own telemetry...
2023-07-14T19:14:34.619Z        info    service/telemetry.go:104        Serving Prometheus metrics      {"address": ":8888", "level": "Basic"}
2023-07-14T19:14:34.629Z        info    exporter@v0.81.0/exporter.go:275

@bobheadxi bobheadxi requested review from a team, camdencheek, jhchabran and willdollman July 14, 2023 21:42
@bobheadxi bobheadxi marked this pull request as ready for review July 14, 2023 21:42
@bobheadxi

Copy link
Copy Markdown
Member Author

Encountering a pretty cryptic error, something to do with Bazel patches for back-compat tests? https://buildkite.com/sourcegraph/sourcegraph/builds/234601#0189565e-f31a-4cb1-9a64-81b8b37546da/41-82

(21:47:28) ERROR: An error occurred during the fetch of repository 'com_github_grpc_ecosystem_grpc_gateway_v2':
--
  | Traceback (most recent call last):
  | File "/root/.cache/bazel/_bazel_root/7f591ba99ab6de7d28cd799d612ead0b/external/bazel_gazelle/internal/go_repository.bzl", line 294, column 10, in _go_repository_impl
  | patch(ctx)
  | File "/root/.cache/bazel/_bazel_root/7f591ba99ab6de7d28cd799d612ead0b/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 167, column 22, in patch
  | ctx.patch(patchfile, strip)
  | Error in patch: Error applying patch /buildkite/builds/buildkite-agent-bazel-85dff99848-6sr6z-1/sourcegraph/sourcegraph/third_party/com_github_grpc_ecosystem_grpc_gateway_v2/grpc_gateway.patch: Incorrect Chunk: the chunk content doesn't match the target
  | **Original Position**: 1910
  |  
  | **Original Content**:
  |  
  | go_repository(
  | name = "org_golang_x_xerrors",
  | importpath = "golang.org/x/xerrors",
  | sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
  | version = "v0.0.0-20200804184101-5ec99f83aff1",
  |  
  | **Revised Content**:
  |  
  | go_repository(
  | name = "org_golang_x_xerrors",
  | build_file_proto_mode = "disable_global",
  | importpath = "golang.org/x/xerrors",
  | sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
  | version = "v0.0.0-20200804184101-5ec99f83aff1",
  | (21:47:28) ERROR: /buildkite/builds/buildkite-agent-bazel-85dff99848-6sr6z-1/sourcegraph/sourcegraph/WORKSPACE:275:16: fetching go_repository rule //external:com_github_grpc_ecosystem_grpc_gateway_v2: Traceback (most recent call last):
  | File "/root/.cache/bazel/_bazel_root/7f591ba99ab6de7d28cd799d612ead0b/external/bazel_gazelle/internal/go_repository.bzl", line 294, column 10, in _go_repository_impl
  | patch(ctx)
  | File "/root/.cache/bazel/_bazel_root/7f591ba99ab6de7d28cd799d612ead0b/external/bazel_tools/tools/build_defs/repo/utils.bzl", line 167, column 22, in patch
  | ctx.patch(patchfile, strip)
  | Error in patch: Error applying patch /buildkite/builds/buildkite-agent-bazel-85dff99848-6sr6z-1/sourcegraph/sourcegraph/third_party/com_github_grpc_ecosystem_grpc_gateway_v2/grpc_gateway.patch: Incorrect Chunk: the chunk content doesn't match the target
  | **Original Position**: 1910
  |  
  | **Original Content**:
  |  
  | go_repository(
  | name = "org_golang_x_xerrors",
  | importpath = "golang.org/x/xerrors",
  | sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
  | version = "v0.0.0-20200804184101-5ec99f83aff1",
  |  
  | **Revised Content**:
  |  
  | go_repository(
  | name = "org_golang_x_xerrors",
  | build_file_proto_mode = "disable_global",
  | importpath = "golang.org/x/xerrors",
  | sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
  | version = "v0.0.0-20200804184101-5ec99f83aff1",
  | (21:47:28) ERROR: /root/.cache/bazel/_bazel_root/7f591ba99ab6de7d28cd799d612ead0b/external/io_opentelemetry_go_proto_otlp/collector/trace/v1/BUILD.bazel:3:11: @io_opentelemetry_go_proto_otlp//collector/trace/v1:trace depends on @com_github_grpc_ecosystem_grpc_gateway_v2//runtime:runtime in repository @com_github_grpc_ecosystem_grpc_gateway_v2 which failed to fetch. no such package '@com_github_grpc_ecosystem_grpc_gateway_v2//runtime': Error applying patch /buildkite/builds/buildkite-agent-bazel-85dff99848-6sr6z-1/sourcegraph/sourcegraph/third_party/com_github_grpc_ecosystem_grpc_gateway_v2/grpc_gateway.patch: Incorrect Chunk: the chunk content doesn't match the target
  | **Original Position**: 1910
  |  
  | **Original Content**:
  |  
  | go_repository(
  | name = "org_golang_x_xerrors",
  | importpath = "golang.org/x/xerrors",
  | sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
  | version = "v0.0.0-20200804184101-5ec99f83aff1",
  |  
  | **Revised Content**:
  |  
  | go_repository(
  | name = "org_golang_x_xerrors",
  | build_file_proto_mode = "disable_global",
  | importpath = "golang.org/x/xerrors",
  | sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
  | version = "v0.0.0-20200804184101-5ec99f83aff1",
  | (21:47:28) ERROR: /root/.cache/bazel/_bazel_root/7f591ba99ab6de7d28cd799d612ead0b/external/io_opentelemetry_go_proto_otlp/collector/trace/v1/BUILD.bazel:3:11: @io_opentelemetry_go_proto_otlp//collector/trace/v1:trace depends on @com_github_grpc_ecosystem_grpc_gateway_v2//utilities:utilities in repository @com_github_grpc_ecosystem_grpc_gateway_v2 which failed to fetch. no such package '@com_github_grpc_ecosystem_grpc_gateway_v2//utilities': Error applying patch /buildkite/builds/buildkite-agent-bazel-85dff99848-6sr6z-1/sourcegraph/sourcegraph/third_party/com_github_grpc_ecosystem_grpc_gateway_v2/grpc_gateway.patch: Incorrect Chunk: the chunk content doesn't match the target
  | **Original Position**: 1910
  |  
  | **Original Content**:
  |  
  | go_repository(
  | name = "org_golang_x_xerrors",
  | importpath = "golang.org/x/xerrors",
  | sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
  | version = "v0.0.0-20200804184101-5ec99f83aff1",
  |  
  | **Revised Content**:
  |  
  | go_repository(
  | name = "org_golang_x_xerrors",
  | build_file_proto_mode = "disable_global",
  | importpath = "golang.org/x/xerrors",
  | sum = "h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=",
  | version = "v0.0.0-20200804184101-5ec99f83aff1",
  | (21:47:28) ERROR: /root/.cache/bazel/_bazel_root/7f591ba99ab6de7d28cd799d612ead0b/external/sourcegraph_back_compat/cmd/frontend/internal/app/otlpadapter/BUILD.bazel:3:11: no such package '@io_opentelemetry_go_collector//config/confighttp': BUILD file not found in directory 'config/confighttp' of external repository @io_opentelemetry_go_collector. Add a BUILD file to a directory to mark it as a package. and referenced by '@sourcegraph_back_compat//cmd/frontend/internal/app/otlpadapter:otlpadapter'
  | (21:47:28) ERROR: /root/.cache/bazel/_bazel_root/7f591ba99ab6de7d28cd799d612ead0b/external/sourcegraph_back_compat/cmd/frontend/internal/app/otlpadapter/BUILD.bazel:3:11: no such package '@io_opentelemetry_go_collector//config/configtelemetry': BUILD file not found in directory 'config/configtelemetry' of external repository @io_opentelemetry_go_collector. Add a BUILD file to a directory to mark it as a package. and referenced by '@sourcegraph_back_compat//cmd/frontend/internal/app/otlpadapter:otlpadapter'


@bobheadxi

Copy link
Copy Markdown
Member Author

Turns out most of the upgrade was done in https://github.com/sourcegraph/sourcegraph/pull/54999, but this change still handles the upgrade of OpenTelemetry collector and some third-party deps that were missed in #54999

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants