Skip to content

Conversation

@aaronc
Copy link
Member

@aaronc aaronc commented Oct 29, 2025

Description

This PR:

  • adds out of the box global OpenTelemetry declarative configuration support to the telemetry/ package via https://pkg.go.dev/go.opentelemetry.io/contrib/otelconf/v0.3.0
  • deprecates all the existing methods in telemetry/ which are based on https://pkg.go.dev/github.com/hashicorp/go-metrics which is under-maintained and requires mutex locks and map lookups on every telemetry method
  • provides default routing of go-metrics telemetry data to OpenTelemetry when OpenTelemetry is enabled
  • instruments BaseApp with OpenTelemetry spans and block and tx counter metrics
  • integrates OpenTelemetry shutdown into server and provides a TestingMain function for tests to export telemetry data
  • configures the log/slog default logger to send logs to OpenTelemetry and allows otelslog bridged to be used for logging. NOTE: this leaves a bit of a disconnect between the SDK's existing logging infrastructure which currently just writes to stdout - this can either be default with in this PR or dealt with in a follow up

The OpenTelemetry go libraries are very actively maintained, most vendors in the space are adding OpenTelemetry support and generally it seems like the industry is headed in this direction. Much of our existing telemetry code is to configure basic telemetry exporting, but with otelconf declarative config, we don't need to maintain any of this ourselves and the out of the box experience is quite simple even for usage in testing.

Closes: SDK-427

@github-actions github-actions bot removed the C:log label Oct 31, 2025
@aljo242
Copy link
Contributor

aljo242 commented Dec 4, 2025

lint failing just on deprecated fields

@technicallyty
Copy link
Contributor

lint failing just on deprecated fields

should be fixed

@technicallyty technicallyty requested a review from aljo242 December 5, 2025 19:16
@aaronc
Copy link
Member Author

aaronc commented Dec 9, 2025

Guess what? otelconf just did a new release upstream: https://pkg.go.dev/go.opentelemetry.io/contrib/otelconf

@technicallyty technicallyty added this pull request to the merge queue Dec 10, 2025
Merged via the queue into main with commit f2d4a98 Dec 10, 2025
41 of 42 checks passed
@technicallyty technicallyty deleted the aaronc/tracing-metrics branch December 10, 2025 23:18
warpbuild-benchmark-bot bot added a commit to WarpBuilds/cosmos-sdk that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants