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

feat: OTEL wiring in grpcserver interceptor #21029

Closed
wants to merge 6 commits into from

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Jul 23, 2024

Description

Closes: #XXXX

This PR wires up OTEL tracing in gprcserver interceptor, allowing tracing requests that originate from external services.

I had to bump up go as 1.20 did not support some of the otel grpc dependencies.

This has led to bumping up go versions of a lot of the CI stuff.

Tested on Osmosis node.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Upgraded to Go version 1.21 for improved performance and features in the build environment.
    • Enhanced gRPC server functionality with OpenTelemetry integration for better observability and monitoring.
    • Added dependencies for improved logging and OpenTelemetry capabilities across multiple modules.
    • Documented changes in the CHANGELOG regarding the integration of OpenTelemetry within the gRPC server.
  • Bug Fixes

    • Improved error handling in the gRPC request processing to accurately reflect success or failure in tracing.

* OTEL wiring in grpcserver

* updates

* updates

* grpc headers

* updates

* updates

* updates

* go 1.21

* updates

* test go1.21

* update lint go

* go mod for tests

* more updates

* bump linter version

* updates

* remove nakedret

* codeql go version
Copy link
Contributor

coderabbitai bot commented Jul 23, 2024

Walkthrough

Walkthrough

The recent changes focus on upgrading the Go version in Continuous Integration (CI) configurations and enhancing the gRPC server's observability through OpenTelemetry integration. New logging and instrumentation libraries have been added to improve monitoring capabilities. These updates emphasize improvements in performance and logging practices by adopting newer versions of dependencies while maintaining the overall functionality.

Changes

Files Change Summary
.github/workflows/test.yml Updated Go version from 1.20 to 1.21 in multiple job configurations.
baseapp/grpcserver.go Enhanced gRPC server with OpenTelemetry tracing; added a tracing interceptor and improved error handling.
client/v2/go.mod, go.mod, x/*/go.mod Introduced new indirect dependencies for logging and OpenTelemetry: github.com/go-logr/logr, github.com/go-logr/stdr, and go.opentelemetry.io/otel packages.
CHANGELOG.md Added entry for OpenTelemetry integration in the gRPC server interceptor, enhancing observability and monitoring capabilities.
.golangci.yml Removed staticcheck linter from the list of enabled linters, simplifying the linting process.
simapp/go.mod, simapp/v2/go.mod, tests/go.mod, x/upgrade/go.mod Updated OpenTelemetry package versions from v1.27.0 to v1.28.0.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant gRPC Server
    participant OpenTelemetry

    Client->>gRPC Server: Send gRPC Request
    gRPC Server->>OpenTelemetry: Start Span
    gRPC Server->>gRPC Server: Process Request
    alt Success
        gRPC Server-->>OpenTelemetry: Mark Span as Successful
    else Error
        gRPC Server-->>OpenTelemetry: Log Error and Update Span
    end
    gRPC Server-->>Client: Send Response
Loading
sequenceDiagram
    participant Developer
    participant CI/CD Pipeline
    participant Build Environment

    Developer->>CI/CD Pipeline: Trigger Build
    CI/CD Pipeline->>Build Environment: Use Go 1.21
    Build Environment-->>CI/CD Pipeline: Build Successful
    CI/CD Pipeline-->>Developer: Notify Build Success
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@p0mvn
Copy link
Member Author

p0mvn commented Jul 23, 2024

I think that the failing CI test stems from the go cache as it passes for me locally.

accounts git:(roman/datadog-grpc-intercept) go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... -count=1
        cosmossdk.io/x/accounts/accountstd              coverage: 0.0% of statements
        cosmossdk.io/x/accounts/defaults/base/v1                coverage: 0.0% of statements
        cosmossdk.io/x/accounts/interfaces/account_abstraction/v1               coverage: 0.0% of statements
        cosmossdk.io/x/accounts/testing/counter/v1              coverage: 0.0% of statements
        cosmossdk.io/x/accounts/testing/account_abstraction             coverage: 0.0% of statements
        cosmossdk.io/x/accounts/internal/prefixstore            coverage: 0.0% of statements
        cosmossdk.io/x/accounts/testing/counter         coverage: 0.0% of statements
        cosmossdk.io/x/accounts/testing/rotation/v1             coverage: 0.0% of statements
        cosmossdk.io/x/accounts/v1              coverage: 0.0% of statements
ok      cosmossdk.io/x/accounts 0.468s  coverage: 5.1% of statements
ok      cosmossdk.io/x/accounts/cli     1.221s  coverage: 11.7% of statements
ok      cosmossdk.io/x/accounts/defaults/base   0.795s  coverage: 2.3% of statements
ok      cosmossdk.io/x/accounts/internal/implementation 1.462s  coverage: 46.7% of statements

Would appreciate pointers if I am wrong.

This comment has been minimized.

@p0mvn p0mvn requested a review from alpe July 23, 2024 04:16
go-version: "1.20"
go-version: "1.21"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewer - I had to bump these up because some GRPC dependencies are supported starting from Go 1.21

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe you had to bump CI for those. Those are standalone components that do not import the SDK. It should stay on 1.20, and do not required a go version bump

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @p0mvn

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
server/grpc/server.go (1)

39-39: Ensure NewGRPCServer is adequately tested

The addition of grpc.StatsHandler(otelgrpc.NewServerHandler()) enhances observability and monitoring capabilities. However, there are no direct tests found for NewGRPCServer. It is recommended to add tests to verify the new functionality and ensure it works correctly.

  • Add tests for NewGRPCServer to verify the integration of otelgrpc.NewServerHandler.
Analysis chain

LGTM! Integration of OpenTelemetry StatsHandler.

The addition of grpc.StatsHandler(otelgrpc.NewServerHandler()) is appropriate and enhances observability and monitoring capabilities.

However, ensure that all function calls to NewGRPCServer are tested with the new functionality.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `NewGRPCServer` are tested with the new functionality.

# Test: Search for the function usage. Expect: Function calls are tested with the new functionality.
rg --type go -A 5 $'NewGRPCServer'

Length of output: 1234


Script:

#!/bin/bash
# Description: Verify that `NewGRPCServer` is tested.

# Search for test functions related to `NewGRPCServer` in the codebase.
rg --type go -A 5 'func Test' | grep -i 'grpcserver'

Length of output: 52


Script:

#!/bin/bash
# Description: Verify that `NewGRPCServer` is tested.

# Search for test files in the directories where `NewGRPCServer` is called.
fd --type f --extension go --search-path testutil/network --search-path server --exec rg 'NewGRPCServer'

Length of output: 434


Script:

#!/bin/bash
# Description: Verify that `NewGRPCServer` is tested.

# Search for test functions across the entire codebase that might be testing `NewGRPCServer`.
rg --type go -l 'NewGRPCServer' | xargs rg --type go 'func Test'

Length of output: 64


Script:

#!/bin/bash
# Description: Verify that `NewGRPCServer` is tested.

# Search for test files in the entire codebase and look for references to `NewGRPCServer`.
fd --type f --extension go --exec rg 'NewGRPCServer'

Length of output: 382

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c2df06c and 5356585.

Files ignored due to path filters (27)
  • client/v2/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
  • server/v2/cometbft/go.sum is excluded by !**/*.sum
  • simapp/go.sum is excluded by !**/*.sum
  • simapp/v2/go.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/lockup/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/multisig/go.sum is excluded by !**/*.sum
  • x/accounts/go.sum is excluded by !**/*.sum
  • x/auth/go.sum is excluded by !**/*.sum
  • x/authz/go.sum is excluded by !**/*.sum
  • x/bank/go.sum is excluded by !**/*.sum
  • x/circuit/go.sum is excluded by !**/*.sum
  • x/consensus/go.sum is excluded by !**/*.sum
  • x/distribution/go.sum is excluded by !**/*.sum
  • x/epochs/go.sum is excluded by !**/*.sum
  • x/evidence/go.sum is excluded by !**/*.sum
  • x/feegrant/go.sum is excluded by !**/*.sum
  • x/gov/go.sum is excluded by !**/*.sum
  • x/group/go.sum is excluded by !**/*.sum
  • x/mint/go.sum is excluded by !**/*.sum
  • x/nft/go.sum is excluded by !**/*.sum
  • x/params/go.sum is excluded by !**/*.sum
  • x/protocolpool/go.sum is excluded by !**/*.sum
  • x/slashing/go.sum is excluded by !**/*.sum
  • x/staking/go.sum is excluded by !**/*.sum
  • x/upgrade/go.sum is excluded by !**/*.sum
Files selected for processing (30)
  • .github/workflows/test.yml (8 hunks)
  • baseapp/grpcserver.go (3 hunks)
  • client/v2/go.mod (1 hunks)
  • go.mod (3 hunks)
  • server/grpc/server.go (2 hunks)
  • server/v2/cometbft/go.mod (2 hunks)
  • simapp/go.mod (1 hunks)
  • simapp/v2/go.mod (1 hunks)
  • tests/go.mod (1 hunks)
  • x/accounts/defaults/lockup/go.mod (1 hunks)
  • x/accounts/defaults/multisig/go.mod (2 hunks)
  • x/accounts/go.mod (1 hunks)
  • x/auth/go.mod (2 hunks)
  • x/authz/go.mod (1 hunks)
  • x/bank/go.mod (1 hunks)
  • x/circuit/go.mod (2 hunks)
  • x/consensus/go.mod (2 hunks)
  • x/distribution/go.mod (1 hunks)
  • x/epochs/go.mod (1 hunks)
  • x/evidence/go.mod (2 hunks)
  • x/feegrant/go.mod (1 hunks)
  • x/gov/go.mod (1 hunks)
  • x/group/go.mod (2 hunks)
  • x/mint/go.mod (1 hunks)
  • x/nft/go.mod (2 hunks)
  • x/params/go.mod (2 hunks)
  • x/protocolpool/go.mod (2 hunks)
  • x/slashing/go.mod (2 hunks)
  • x/staking/go.mod (1 hunks)
  • x/upgrade/go.mod (1 hunks)
Files skipped from review due to trivial changes (3)
  • .github/workflows/test.yml
  • simapp/v2/go.mod
  • x/upgrade/go.mod
Additional context used
Path-based instructions (3)
server/grpc/server.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

baseapp/grpcserver.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

tests/go.mod (1)

Pattern tests/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"

Additional comments not posted (129)
server/grpc/server.go (1)

8-8: LGTM! Import statement for OpenTelemetry.

The import statement for otelgrpc is correct and necessary for the new functionality.

baseapp/grpcserver.go (3)

11-15: LGTM! Import statements for OpenTelemetry.

The import statements for OpenTelemetry packages (otel, attribute, otelcodes, propagation, trace) are correct and necessary for the new functionality.


29-29: LGTM! Addition of tracerName constant.

The addition of the tracerName constant improves code readability and maintainability.


Line range hint 33-109:
LGTM! Integration of OpenTelemetry tracing interceptor.

The addition of the tracing interceptor that captures and manages tracing spans for each gRPC request is appropriate and enhances observability and monitoring capabilities.

However, ensure that all function calls to RegisterGRPCServer are tested with the new functionality.

x/auth/go.mod (2)

82-83: LGTM! Addition of logging dependencies.

The addition of github.com/go-logr/logr and github.com/go-logr/stdr dependencies is appropriate for enhanced logging capabilities.


159-162: LGTM! Addition of OpenTelemetry dependencies.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc, go.opentelemetry.io/otel, go.opentelemetry.io/otel/metric, and go.opentelemetry.io/otel/trace dependencies is appropriate for integrating OpenTelemetry tracing and metrics collection.

x/consensus/go.mod (2)

74-75: New Logging Dependencies Added

The new logging dependencies github.com/go-logr/logr and github.com/go-logr/stdr will enhance the logging capabilities of the project.


153-156: New OpenTelemetry Dependencies Added

The new OpenTelemetry dependencies go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc, go.opentelemetry.io/otel, go.opentelemetry.io/otel/metric, and go.opentelemetry.io/otel/trace will enhance the observability and tracing capabilities of the project.

x/staking/go.mod (2)

175-176: New Logging Dependencies Added

The new logging dependencies github.com/go-logr/logr and github.com/go-logr/stdr will enhance the logging capabilities of the project.


178-181: New OpenTelemetry Dependencies Added

The new OpenTelemetry dependencies go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc, go.opentelemetry.io/otel, go.opentelemetry.io/otel/metric, and go.opentelemetry.io/otel/trace will enhance the observability and tracing capabilities of the project.

x/bank/go.mod (2)

173-174: New Logging Dependencies Added

The new logging dependencies github.com/go-logr/logr and github.com/go-logr/stdr will enhance the logging capabilities of the project.


176-179: New OpenTelemetry Dependencies Added

The new OpenTelemetry dependencies go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc, go.opentelemetry.io/otel, go.opentelemetry.io/otel/metric, and go.opentelemetry.io/otel/trace will enhance the observability and tracing capabilities of the project.

x/evidence/go.mod (6)

78-78: LGTM! Added dependency for structured logging.

The addition of github.com/go-logr/logr v1.4.2 enhances the logging capabilities of the project.


79-79: LGTM! Added dependency for standard library logger implementation.

The addition of github.com/go-logr/stdr v1.2.2 complements the go-logr library by providing a standard library logger implementation.


156-156: LGTM! Added dependency for gRPC instrumentation with OpenTelemetry.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 enables gRPC instrumentation for distributed tracing.


157-157: LGTM! Added core OpenTelemetry dependency.

The addition of go.opentelemetry.io/otel v1.28.0 is crucial for integrating OpenTelemetry's tracing and metrics capabilities.


158-158: LGTM! Added dependency for OpenTelemetry metrics.

The addition of go.opentelemetry.io/otel/metric v1.28.0 enhances the project's capability to collect and export metrics using OpenTelemetry.


159-159: LGTM! Added dependency for OpenTelemetry tracing.

The addition of go.opentelemetry.io/otel/trace v1.28.0 is essential for implementing distributed tracing using OpenTelemetry.

x/protocolpool/go.mod (6)

78-78: LGTM! Added dependency for structured logging.

The addition of github.com/go-logr/logr v1.4.2 enhances the logging capabilities of the project.


79-79: LGTM! Added dependency for standard library logger implementation.

The addition of github.com/go-logr/stdr v1.2.2 complements the go-logr library by providing a standard library logger implementation.


157-157: LGTM! Added dependency for gRPC instrumentation with OpenTelemetry.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 enables gRPC instrumentation for distributed tracing.


158-158: LGTM! Added core OpenTelemetry dependency.

The addition of go.opentelemetry.io/otel v1.28.0 is crucial for integrating OpenTelemetry's tracing and metrics capabilities.


159-159: LGTM! Added dependency for OpenTelemetry metrics.

The addition of go.opentelemetry.io/otel/metric v1.28.0 enhances the project's capability to collect and export metrics using OpenTelemetry.


160-160: LGTM! Added dependency for OpenTelemetry tracing.

The addition of go.opentelemetry.io/otel/trace v1.28.0 is essential for implementing distributed tracing using OpenTelemetry.

x/epochs/go.mod (6)

171-171: LGTM! Added dependency for structured logging.

The addition of github.com/go-logr/logr v1.4.2 enhances the logging capabilities of the project.


172-172: LGTM! Added dependency for standard library logger implementation.

The addition of github.com/go-logr/stdr v1.2.2 complements the go-logr library by providing a standard library logger implementation.


175-175: LGTM! Added dependency for gRPC instrumentation with OpenTelemetry.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 enables gRPC instrumentation for distributed tracing.


176-176: LGTM! Added core OpenTelemetry dependency.

The addition of go.opentelemetry.io/otel v1.28.0 is crucial for integrating OpenTelemetry's tracing and metrics capabilities.


177-177: LGTM! Added dependency for OpenTelemetry metrics.

The addition of go.opentelemetry.io/otel/metric v1.28.0 enhances the project's capability to collect and export metrics using OpenTelemetry.


178-178: LGTM! Added dependency for OpenTelemetry tracing.

The addition of go.opentelemetry.io/otel/trace v1.28.0 is essential for implementing distributed tracing using OpenTelemetry.

x/slashing/go.mod (6)

79-79: Dependency addition approved: github.com/go-logr/logr v1.4.2.

This dependency enhances structured logging capabilities.


80-80: Dependency addition approved: github.com/go-logr/stdr v1.2.2.

This dependency provides a standard library logger implementation for logr.


158-158: Dependency addition approved: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0.

This dependency provides OpenTelemetry instrumentation for gRPC.


159-159: Dependency addition approved: go.opentelemetry.io/otel v1.28.0.

This dependency is the core OpenTelemetry library for Go.


160-160: Dependency addition approved: go.opentelemetry.io/otel/metric v1.28.0.

This dependency provides OpenTelemetry metrics support for Go.


161-161: Dependency addition approved: go.opentelemetry.io/otel/trace v1.28.0.

This dependency provides OpenTelemetry tracing support for Go.

x/nft/go.mod (6)

76-76: Dependency addition approved: github.com/go-logr/logr v1.4.2.

This dependency enhances structured logging capabilities.


77-77: Dependency addition approved: github.com/go-logr/stdr v1.2.2.

This dependency provides a standard library logger implementation for logr.


155-155: Dependency addition approved: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0.

This dependency provides OpenTelemetry instrumentation for gRPC.


156-156: Dependency addition approved: go.opentelemetry.io/otel v1.28.0.

This dependency is the core OpenTelemetry library for Go.


157-157: Dependency addition approved: go.opentelemetry.io/otel/metric v1.28.0.

This dependency provides OpenTelemetry metrics support for Go.


158-158: Dependency addition approved: go.opentelemetry.io/otel/trace v1.28.0.

This dependency provides OpenTelemetry tracing support for Go.

x/circuit/go.mod (6)

75-75: Dependency addition approved: github.com/go-logr/logr v1.4.2.

This dependency enhances structured logging capabilities.


76-76: Dependency addition approved: github.com/go-logr/stdr v1.2.2.

This dependency provides a standard library logger implementation for logr.


155-155: Dependency addition approved: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0.

This dependency provides OpenTelemetry instrumentation for gRPC.


156-156: Dependency addition approved: go.opentelemetry.io/otel v1.28.0.

This dependency is the core OpenTelemetry library for Go.


157-157: Dependency addition approved: go.opentelemetry.io/otel/metric v1.28.0.

This dependency provides OpenTelemetry metrics support for Go.


158-158: Dependency addition approved: go.opentelemetry.io/otel/trace v1.28.0.

This dependency provides OpenTelemetry tracing support for Go.

x/distribution/go.mod (6)

36-36: Add github.com/go-logr/logr dependency.

The addition of github.com/go-logr/logr (version 1.4.2) as an indirect dependency is appropriate for enhanced logging capabilities.


37-37: Add github.com/go-logr/stdr dependency.

The addition of github.com/go-logr/stdr (version 1.2.2) as an indirect dependency complements the logging capabilities provided by logr.


40-40: Add go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc (version 0.49.0) as an indirect dependency is aligned with the PR objective of integrating OpenTelemetry tracing.


41-41: Add go.opentelemetry.io/otel dependency.

The addition of go.opentelemetry.io/otel (version 1.28.0) as an indirect dependency is essential for OpenTelemetry integration.


42-42: Add go.opentelemetry.io/otel/metric dependency.

The addition of go.opentelemetry.io/otel/metric (version 1.28.0) as an indirect dependency supports metrics collection in OpenTelemetry.


43-43: Add go.opentelemetry.io/otel/trace dependency.

The addition of go.opentelemetry.io/otel/trace (version 1.28.0) as an indirect dependency is crucial for tracing capabilities in OpenTelemetry.

x/mint/go.mod (6)

168-168: Add github.com/go-logr/logr dependency.

The addition of github.com/go-logr/logr (version 1.4.2) as an indirect dependency is appropriate for enhanced logging capabilities.


169-169: Add github.com/go-logr/stdr dependency.

The addition of github.com/go-logr/stdr (version 1.2.2) as an indirect dependency complements the logging capabilities provided by logr.


177-177: Add go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc (version 0.49.0) as an indirect dependency is aligned with the PR objective of integrating OpenTelemetry tracing.


178-178: Add go.opentelemetry.io/otel dependency.

The addition of go.opentelemetry.io/otel (version 1.28.0) as an indirect dependency is essential for OpenTelemetry integration.


179-179: Add go.opentelemetry.io/otel/metric dependency.

The addition of go.opentelemetry.io/otel/metric (version 1.28.0) as an indirect dependency supports metrics collection in OpenTelemetry.


180-180: Add go.opentelemetry.io/otel/trace dependency.

The addition of go.opentelemetry.io/otel/trace (version 1.28.0) as an indirect dependency is crucial for tracing capabilities in OpenTelemetry.

x/authz/go.mod (6)

174-174: Add github.com/go-logr/logr dependency.

The addition of github.com/go-logr/logr (version 1.4.2) as an indirect dependency is appropriate for enhanced logging capabilities.


175-175: Add github.com/go-logr/stdr dependency.

The addition of github.com/go-logr/stdr (version 1.2.2) as an indirect dependency complements the logging capabilities provided by logr.


177-177: Add go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc (version 0.49.0) as an indirect dependency is aligned with the PR objective of integrating OpenTelemetry tracing.


178-178: Add go.opentelemetry.io/otel dependency.

The addition of go.opentelemetry.io/otel (version 1.28.0) as an indirect dependency is essential for OpenTelemetry integration.


179-179: Add go.opentelemetry.io/otel/metric dependency.

The addition of go.opentelemetry.io/otel/metric (version 1.28.0) as an indirect dependency supports metrics collection in OpenTelemetry.


180-180: Add go.opentelemetry.io/otel/trace dependency.

The addition of go.opentelemetry.io/otel/trace (version 1.28.0) as an indirect dependency is crucial for tracing capabilities in OpenTelemetry.

x/accounts/defaults/lockup/go.mod (5)

26-26: Dependency Addition Approved: github.com/go-logr/logr v1.4.2.

The addition of github.com/go-logr/logr v1.4.2 is appropriate for enhancing structured logging capabilities.


27-27: Dependency Addition Approved: github.com/go-logr/stdr v1.2.2.

The addition of github.com/go-logr/stdr v1.2.2 is suitable for providing a standard library logger implementation for logr.


33-33: Dependency Addition Approved: go.opentelemetry.io/otel v1.28.0.

The addition of go.opentelemetry.io/otel v1.28.0 is crucial for integrating OpenTelemetry tracing into the application.


34-34: Dependency Addition Approved: go.opentelemetry.io/otel/metric v1.28.0.

The addition of go.opentelemetry.io/otel/metric v1.28.0 is appropriate for enabling metrics instrumentation in the application.


35-35: Dependency Addition Approved: go.opentelemetry.io/otel/trace v1.28.0.

The addition of go.opentelemetry.io/otel/trace v1.28.0 is suitable for enabling tracing instrumentation in the application.

x/gov/go.mod (6)

177-177: Dependency Addition Approved: github.com/go-logr/logr v1.4.2.

The addition of github.com/go-logr/logr v1.4.2 is appropriate for enhancing structured logging capabilities.


178-178: Dependency Addition Approved: github.com/go-logr/stdr v1.2.2.

The addition of github.com/go-logr/stdr v1.2.2 is suitable for providing a standard library logger implementation for logr.


179-179: Dependency Addition Approved: go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 is appropriate for enabling OpenTelemetry instrumentation for gRPC.


180-180: Dependency Addition Approved: go.opentelemetry.io/otel v1.28.0.

The addition of go.opentelemetry.io/otel v1.28.0 is crucial for integrating OpenTelemetry tracing into the application.


181-181: Dependency Addition Approved: go.opentelemetry.io/otel/metric v1.28.0.

The addition of go.opentelemetry.io/otel/metric v1.28.0 is appropriate for enabling metrics instrumentation in the application.


182-182: Dependency Addition Approved: go.opentelemetry.io/otel/trace v1.28.0.

The addition of go.opentelemetry.io/otel/trace v1.28.0 is suitable for enabling tracing instrumentation in the application.

server/v2/cometbft/go.mod (5)

101-101: Dependency Addition Approved: github.com/go-logr/logr v1.4.2.

The addition of github.com/go-logr/logr v1.4.2 is appropriate for enhancing structured logging capabilities.


102-102: Dependency Addition Approved: github.com/go-logr/stdr v1.2.2.

The addition of github.com/go-logr/stdr v1.2.2 is suitable for providing a standard library logger implementation for logr.


178-178: Dependency Addition Approved: go.opentelemetry.io/otel v1.28.0.

The addition of go.opentelemetry.io/otel v1.28.0 is crucial for integrating OpenTelemetry tracing into the application.


179-179: Dependency Addition Approved: go.opentelemetry.io/otel/metric v1.28.0.

The addition of go.opentelemetry.io/otel/metric v1.28.0 is appropriate for enabling metrics instrumentation in the application.


180-180: Dependency Addition Approved: go.opentelemetry.io/otel/trace v1.28.0.

The addition of go.opentelemetry.io/otel/trace v1.28.0 is suitable for enabling tracing instrumentation in the application.

x/params/go.mod (6)

78-78: Approved: Addition of logging library.

The addition of github.com/go-logr/logr v1.4.2 enhances the logging framework.


79-79: Approved: Addition of standard library adapter for logging.

The addition of github.com/go-logr/stdr v1.2.2 provides a standard library adapter for logr.


156-156: Approved: Addition of OpenTelemetry instrumentation for gRPC.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 enhances observability for gRPC.


157-157: Approved: Addition of core OpenTelemetry library.

The addition of go.opentelemetry.io/otel v1.28.0 provides the core functionalities for OpenTelemetry.


158-158: Approved: Addition of OpenTelemetry metrics library.

The addition of go.opentelemetry.io/otel/metric v1.28.0 enhances the metrics tracking capabilities.


159-159: Approved: Addition of OpenTelemetry tracing library.

The addition of go.opentelemetry.io/otel/trace v1.28.0 enhances the tracing capabilities.

x/feegrant/go.mod (6)

177-177: Approved: Addition of logging library.

The addition of github.com/go-logr/logr v1.4.2 enhances the logging framework.


178-178: Approved: Addition of standard library adapter for logging.

The addition of github.com/go-logr/stdr v1.2.2 provides a standard library adapter for logr.


180-180: Approved: Addition of OpenTelemetry instrumentation for gRPC.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 enhances observability for gRPC.


181-181: Approved: Addition of core OpenTelemetry library.

The addition of go.opentelemetry.io/otel v1.28.0 provides the core functionalities for OpenTelemetry.


182-182: Approved: Addition of OpenTelemetry metrics library.

The addition of go.opentelemetry.io/otel/metric v1.28.0 enhances the metrics tracking capabilities.


183-183: Approved: Addition of OpenTelemetry tracing library.

The addition of go.opentelemetry.io/otel/trace v1.28.0 enhances the tracing capabilities.

x/accounts/defaults/multisig/go.mod (6)

73-73: Approved: Addition of logging library.

The addition of github.com/go-logr/logr v1.4.2 enhances the logging framework.


74-74: Approved: Addition of standard library adapter for logging.

The addition of github.com/go-logr/stdr v1.2.2 provides a standard library adapter for logr.


154-154: Approved: Addition of OpenTelemetry instrumentation for gRPC.

The addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 enhances observability for gRPC.


155-155: Approved: Addition of core OpenTelemetry library.

The addition of go.opentelemetry.io/otel v1.28.0 provides the core functionalities for OpenTelemetry.


156-156: Approved: Addition of OpenTelemetry metrics library.

The addition of go.opentelemetry.io/otel/metric v1.28.0 enhances the metrics tracking capabilities.


157-157: Approved: Addition of OpenTelemetry tracing library.

The addition of go.opentelemetry.io/otel/trace v1.28.0 enhances the tracing capabilities.

x/accounts/go.mod (6)

27-27: Approved: Addition of github.com/go-logr/logr dependency.

The github.com/go-logr/logr library provides a structured logger interface, which aligns with the PR's objective to enhance logging capabilities.


28-28: Approved: Addition of github.com/go-logr/stdr dependency.

The github.com/go-logr/stdr library provides a standard logger implementation for logr, enhancing the logging capabilities.


30-30: Approved: Addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency.

The go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc library provides OpenTelemetry instrumentation for gRPC, enhancing observability and tracing.


31-31: Approved: Addition of go.opentelemetry.io/otel dependency.

The go.opentelemetry.io/otel library is the core OpenTelemetry library, essential for tracing and metrics.


32-32: Approved: Addition of go.opentelemetry.io/otel/metric dependency.

The go.opentelemetry.io/otel/metric library supports metric collection and reporting, complementing the tracing capabilities.


33-33: Approved: Addition of go.opentelemetry.io/otel/trace dependency.

The go.opentelemetry.io/otel/trace library supports tracing functionalities, enhancing observability.

client/v2/go.mod (6)

176-176: Approved: Addition of github.com/go-logr/logr dependency.

The github.com/go-logr/logr library provides a structured logger interface, which aligns with the PR's objective to enhance logging capabilities.


177-177: Approved: Addition of github.com/go-logr/stdr dependency.

The github.com/go-logr/stdr library provides a standard logger implementation for logr, enhancing the logging capabilities.


179-179: Approved: Addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency.

The go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc library provides OpenTelemetry instrumentation for gRPC, enhancing observability and tracing.


180-180: Approved: Addition of go.opentelemetry.io/otel dependency.

The go.opentelemetry.io/otel library is the core OpenTelemetry library, essential for tracing and metrics.


181-181: Approved: Addition of go.opentelemetry.io/otel/metric dependency.

The go.opentelemetry.io/otel/metric library supports metric collection and reporting, complementing the tracing capabilities.


182-182: Approved: Addition of go.opentelemetry.io/otel/trace dependency.

The go.opentelemetry.io/otel/trace library supports tracing functionalities, enhancing observability.

go.mod (6)

59-59: Approved: Addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc dependency.

The go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc library provides OpenTelemetry instrumentation for gRPC, enhancing observability and tracing.


60-60: Approved: Addition of go.opentelemetry.io/otel dependency.

The go.opentelemetry.io/otel library is the core OpenTelemetry library, essential for tracing and metrics.


61-61: Approved: Addition of go.opentelemetry.io/otel/trace dependency.

The go.opentelemetry.io/otel/trace library supports tracing functionalities, enhancing observability.


107-107: Approved: Addition of github.com/go-logr/logr dependency.

The github.com/go-logr/logr library provides a structured logger interface, which aligns with the PR's objective to enhance logging capabilities.


108-108: Approved: Addition of github.com/go-logr/stdr dependency.

The github.com/go-logr/stdr library provides a standard logger implementation for logr, enhancing the logging capabilities.


171-171: Approved: Addition of go.opentelemetry.io/otel/metric dependency.

The go.opentelemetry.io/otel/metric library supports metric collection and reporting, complementing the tracing capabilities.

x/group/go.mod (5)

90-90: Approved: Addition of github.com/go-logr/logr.

The addition of this dependency aligns with the PR objective to enhance logging capabilities.


91-91: Approved: Addition of github.com/go-logr/stdr.

The addition of this dependency aligns with the PR objective to enhance logging capabilities.


168-168: Approved: Addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.

The addition of this dependency aligns with the PR objective to integrate OpenTelemetry tracing into the gRPC server interceptor.


169-169: Approved: Addition of go.opentelemetry.io/otel.

The addition of this dependency aligns with the PR objective to enhance observability and monitoring capabilities.


170-171: Approved: Addition of go.opentelemetry.io/otel/metric and go.opentelemetry.io/otel/trace.

The addition of these dependencies aligns with the PR objective to enhance observability and monitoring capabilities.

tests/go.mod (3)

207-207: Approved: Update of go.opentelemetry.io/otel from v1.27.0 to v1.28.0.

The update aligns with the PR objective to integrate the latest OpenTelemetry features and fixes.


208-208: Approved: Update of go.opentelemetry.io/otel/metric from v1.27.0 to v1.28.0.

The update aligns with the PR objective to integrate the latest OpenTelemetry features and fixes.


209-209: Approved: Update of go.opentelemetry.io/otel/trace from v1.27.0 to v1.28.0.

The update aligns with the PR objective to integrate the latest OpenTelemetry features and fixes.

simapp/go.mod (3)

206-206: Approved: Update of go.opentelemetry.io/otel from v1.27.0 to v1.28.0.

The update aligns with the PR objective to integrate the latest OpenTelemetry features and fixes.


207-207: Approved: Update of go.opentelemetry.io/otel/metric from v1.27.0 to v1.28.0.

The update aligns with the PR objective to integrate the latest OpenTelemetry features and fixes.


208-208: Approved: Update of go.opentelemetry.io/otel/trace from v1.27.0 to v1.28.0.

The update aligns with the PR objective to integrate the latest OpenTelemetry features and fixes.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5356585 and 9ddcd02.

Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
Additional context used
Path-based instructions (1)
CHANGELOG.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

Additional comments not posted (1)
CHANGELOG.md (1)

64-64: Changelog entry looks good.

The entry documenting the addition of OTEL wiring in the gRPC server interceptor is accurate and correctly formatted.

@p0mvn p0mvn force-pushed the roman/datadog-grpc-intercept branch from a86a57f to 9ddcd02 Compare July 23, 2024 05:09
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9ddcd02 and a86a57f.

Files selected for processing (1)
  • .golangci.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .golangci.yml

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #21029 (comment)

Could try revert CI and do a go mod tidy all (our script)

@julienrbrt
Copy link
Member

I think that the failing CI test stems from the go cache as it passes for me locally.

accounts git:(roman/datadog-grpc-intercept) go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./... -count=1
        cosmossdk.io/x/accounts/accountstd              coverage: 0.0% of statements
        cosmossdk.io/x/accounts/defaults/base/v1                coverage: 0.0% of statements
        cosmossdk.io/x/accounts/interfaces/account_abstraction/v1               coverage: 0.0% of statements
        cosmossdk.io/x/accounts/testing/counter/v1              coverage: 0.0% of statements
        cosmossdk.io/x/accounts/testing/account_abstraction             coverage: 0.0% of statements
        cosmossdk.io/x/accounts/internal/prefixstore            coverage: 0.0% of statements
        cosmossdk.io/x/accounts/testing/counter         coverage: 0.0% of statements
        cosmossdk.io/x/accounts/testing/rotation/v1             coverage: 0.0% of statements
        cosmossdk.io/x/accounts/v1              coverage: 0.0% of statements
ok      cosmossdk.io/x/accounts 0.468s  coverage: 5.1% of statements
ok      cosmossdk.io/x/accounts/cli     1.221s  coverage: 11.7% of statements
ok      cosmossdk.io/x/accounts/defaults/base   0.795s  coverage: 2.3% of statements
ok      cosmossdk.io/x/accounts/internal/implementation 1.462s  coverage: 46.7% of statements

Would appreciate pointers if I am wrong.

You are probably using a go.work. It currently fails on main or if you don't use go.work, there is a replace missing.

@p0mvn p0mvn requested a review from julienrbrt July 23, 2024 19:55
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a86a57f and 5eedd85.

Files ignored due to path filters (27)
  • client/v2/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
  • server/v2/cometbft/go.sum is excluded by !**/*.sum
  • simapp/go.sum is excluded by !**/*.sum
  • simapp/v2/go.sum is excluded by !**/*.sum
  • tests/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/lockup/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/multisig/go.sum is excluded by !**/*.sum
  • x/accounts/go.sum is excluded by !**/*.sum
  • x/auth/go.sum is excluded by !**/*.sum
  • x/authz/go.sum is excluded by !**/*.sum
  • x/bank/go.sum is excluded by !**/*.sum
  • x/circuit/go.sum is excluded by !**/*.sum
  • x/consensus/go.sum is excluded by !**/*.sum
  • x/distribution/go.sum is excluded by !**/*.sum
  • x/epochs/go.sum is excluded by !**/*.sum
  • x/evidence/go.sum is excluded by !**/*.sum
  • x/feegrant/go.sum is excluded by !**/*.sum
  • x/gov/go.sum is excluded by !**/*.sum
  • x/group/go.sum is excluded by !**/*.sum
  • x/mint/go.sum is excluded by !**/*.sum
  • x/nft/go.sum is excluded by !**/*.sum
  • x/params/go.sum is excluded by !**/*.sum
  • x/protocolpool/go.sum is excluded by !**/*.sum
  • x/slashing/go.sum is excluded by !**/*.sum
  • x/staking/go.sum is excluded by !**/*.sum
  • x/upgrade/go.sum is excluded by !**/*.sum
Files selected for processing (27)
  • client/v2/go.mod (1 hunks)
  • go.mod (3 hunks)
  • server/v2/cometbft/go.mod (2 hunks)
  • simapp/go.mod (1 hunks)
  • simapp/v2/go.mod (1 hunks)
  • tests/go.mod (1 hunks)
  • x/accounts/defaults/lockup/go.mod (1 hunks)
  • x/accounts/defaults/multisig/go.mod (2 hunks)
  • x/accounts/go.mod (1 hunks)
  • x/auth/go.mod (2 hunks)
  • x/authz/go.mod (1 hunks)
  • x/bank/go.mod (1 hunks)
  • x/circuit/go.mod (2 hunks)
  • x/consensus/go.mod (2 hunks)
  • x/distribution/go.mod (1 hunks)
  • x/epochs/go.mod (1 hunks)
  • x/evidence/go.mod (2 hunks)
  • x/feegrant/go.mod (2 hunks)
  • x/gov/go.mod (2 hunks)
  • x/group/go.mod (2 hunks)
  • x/mint/go.mod (1 hunks)
  • x/nft/go.mod (2 hunks)
  • x/params/go.mod (2 hunks)
  • x/protocolpool/go.mod (2 hunks)
  • x/slashing/go.mod (2 hunks)
  • x/staking/go.mod (1 hunks)
  • x/upgrade/go.mod (1 hunks)
Files skipped from review due to trivial changes (11)
  • client/v2/go.mod
  • go.mod
  • simapp/go.mod
  • tests/go.mod
  • x/accounts/defaults/lockup/go.mod
  • x/auth/go.mod
  • x/circuit/go.mod
  • x/distribution/go.mod
  • x/evidence/go.mod
  • x/feegrant/go.mod
  • x/upgrade/go.mod
Files skipped from review as they are similar to previous changes (15)
  • server/v2/cometbft/go.mod
  • simapp/v2/go.mod
  • x/accounts/defaults/multisig/go.mod
  • x/accounts/go.mod
  • x/authz/go.mod
  • x/bank/go.mod
  • x/consensus/go.mod
  • x/epochs/go.mod
  • x/group/go.mod
  • x/mint/go.mod
  • x/nft/go.mod
  • x/params/go.mod
  • x/protocolpool/go.mod
  • x/slashing/go.mod
  • x/staking/go.mod
Additional comments not posted (5)
x/gov/go.mod (5)

84-84: Addition of github.com/go-logr/logr is appropriate.

The inclusion of github.com/go-logr/logr enhances structured logging capabilities, aligning with the PR objectives.


85-85: Addition of github.com/go-logr/stdr is appropriate.

The inclusion of github.com/go-logr/stdr provides a standard library implementation for structured logging, aligning with the PR objectives.


161-161: Addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc is appropriate.

The inclusion of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc enables OpenTelemetry tracing for gRPC, aligning with the PR objectives.


162-162: Addition of go.opentelemetry.io/otel is appropriate.

The inclusion of go.opentelemetry.io/otel provides the core OpenTelemetry API, aligning with the PR objectives.


163-164: Addition of go.opentelemetry.io/otel/metric and go.opentelemetry.io/otel/trace is appropriate.

The inclusion of go.opentelemetry.io/otel/metric and go.opentelemetry.io/otel/trace enhances metrics and tracing capabilities, aligning with the PR objectives.

@p0mvn
Copy link
Member Author

p0mvn commented Jul 24, 2024

@julienrbrt R4R 🙏

@julienrbrt
Copy link
Member

@julienrbrt R4R 🙏

I still stand by this comment: #21029 (comment)

Copy link
Contributor

@alpe alpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Very nice to see telemetry landing in the SDK.
I was wondering about your custom span in the interceptor that seems to be redundant with what comes out of the box with the otel stats_handler .
It would be great if you can elaborate on this a bit more.

Would a custom stats_handler make sense to avoid the interceptor changes? This would be a better decoupling

@@ -35,6 +36,7 @@ func NewGRPCServer(clientCtx client.Context, app types.Application, cfg config.G
grpc.ForceServerCodec(codec.NewProtoCodec(clientCtx.InterfaceRegistry).GRPCCodec()),
grpc.MaxSendMsgSize(maxSendMsgSize),
grpc.MaxRecvMsgSize(maxRecvMsgSize),
grpc.StatsHandler(otelgrpc.NewServerHandler()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

grpcCtx, span := tracer.Start(parentCtx, grpcInfo.FullMethod, trace.WithSpanKind(trace.SpanKindServer))
defer span.End()

span.SetAttributes(attribute.String("http.method", grpcInfo.FullMethod))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you add the http.method attribute? A span for FullMethod is created in the stats handler already

span.SetStatus(otelcodes.Error, err.Error())
} else {
span.SetStatus(otelcodes.Ok, "OK")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The span status is also set in the stats handler. Can you elaborate why you need this here?

@github-actions github-actions bot added C:server/v2 Issues related to server/v2 and removed Type: CI labels Aug 16, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5eedd85 and 550032d.

Files ignored due to path filters (2)
  • client/v2/go.sum is excluded by !**/*.sum
  • go.sum is excluded by !**/*.sum
Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • client/v2/go.mod (1 hunks)
  • go.mod (3 hunks)
Additional context used
Path-based instructions (1)
CHANGELOG.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

Additional comments not posted (13)
client/v2/go.mod (6)

175-175: LGTM: Addition of github.com/go-logr/logr.

The structured logging library github.com/go-logr/logr is a valuable addition for improved logging practices.


176-176: LGTM: Addition of github.com/go-logr/stdr.

The adapter for logr to the standard library enhances logging flexibility.


178-178: LGTM: Addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.

This package supports the integration of OpenTelemetry for gRPC, enhancing observability.


179-179: LGTM: Addition of go.opentelemetry.io/otel.

The core OpenTelemetry package is essential for tracing and metrics.


180-180: LGTM: Addition of go.opentelemetry.io/otel/metric.

This package enhances observability by adding metrics capabilities.


181-181: LGTM: Addition of go.opentelemetry.io/otel/trace.

This package is crucial for implementing tracing capabilities in OpenTelemetry.

go.mod (6)

59-59: LGTM: Addition of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc.

This package supports the integration of OpenTelemetry for gRPC, enhancing observability.


60-60: LGTM: Addition of go.opentelemetry.io/otel.

The core OpenTelemetry package is essential for tracing and metrics.


61-61: LGTM: Addition of go.opentelemetry.io/otel/trace.

This package is crucial for implementing tracing capabilities in OpenTelemetry.


107-107: LGTM: Addition of github.com/go-logr/logr.

The structured logging library github.com/go-logr/logr is a valuable addition for improved logging practices.


108-108: LGTM: Addition of github.com/go-logr/stdr.

The adapter for logr to the standard library enhances logging flexibility.


171-171: LGTM: Addition of go.opentelemetry.io/otel/metric.

This package enhances observability by adding metrics capabilities.

CHANGELOG.md (1)

46-46: Changelog entry looks good.

The changelog entry for the OTEL wiring in the gRPC server interceptor is clear and correctly formatted. No grammatical or typographical issues are present.

Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Sep 16, 2024
@tac0turtle
Copy link
Member

closing due to stale, @romac if you have time to address the comments please reopen the pr

@tac0turtle tac0turtle closed this Sep 20, 2024
@julienrbrt julienrbrt deleted the roman/datadog-grpc-intercept branch December 10, 2024 17:20
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.

4 participants