Skip to content

feat: support opentelemetry#583

Merged
Stream29 merged 1 commit into
langgenius:mainfrom
fatelei:opentelemetry
Jan 27, 2026
Merged

feat: support opentelemetry#583
Stream29 merged 1 commit into
langgenius:mainfrom
fatelei:opentelemetry

Conversation

@fatelei

@fatelei fatelei commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Description

fix #582

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

image

dify chain of dify-plugin-daemon

image

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Bug Fix (if applicable)

  • I have used GitHub syntax to close the related issue (e.g., Fixes #123 or Closes #123)

Additional Information

Please provide any additional context that would help reviewers understand the changes.

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 26, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @fatelei, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the application's observability by integrating OpenTelemetry. This enables detailed tracing and metric collection across key services, including HTTP communications, database interactions, and Redis caching. The changes allow for easier monitoring and debugging of the application's behavior, particularly within the local plugin runtime's Python environment setup, without requiring intrusive code modifications in many areas.

Highlights

  • OpenTelemetry Integration: Introduced comprehensive OpenTelemetry support for enhanced observability, including tracing and metrics, across various components of the application.
  • Configuration via Environment Variables: Added a suite of new environment variables in .env.example to configure OpenTelemetry settings such as endpoints, API keys, sampling rates, and batch export parameters.
  • Automated Instrumentation: Implemented automatic instrumentation for HTTP clients (dify invocation, serverless connector), GORM database operations, Redis client interactions, and Gin HTTP server requests.
  • Python Environment Tracing: Extended tracing capabilities to the local plugin runtime's Python environment initialization process, allowing for better visibility into dependency management and virtual environment setup.
  • Dependency Updates: Updated numerous Go module dependencies to their latest versions, including OpenTelemetry specific libraries for Gin, HTTP, Redis, and GORM.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot Bot added enhancement New feature or request go Pull requests that update go code labels Jan 26, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces OpenTelemetry support for distributed tracing and metrics, enhancing observability across the application. Key changes include adding OpenTelemetry configuration to .env.example, integrating OTLP exporters for traces and metrics, instrumenting HTTP clients (dify invocation, serverless connector), GORM, and Gin with OpenTelemetry, and adding tracing to Python environment initialization steps. The changes are well-structured and provide a solid foundation for observability. However, there are a few areas for improvement regarding error handling, consistency in attribute naming, and potential for more granular control over tracing configuration.

Comment thread go.mod
Comment thread internal/server/otel.go Outdated
Comment thread internal/core/local_runtime/setup_python_environment.go Outdated
Comment thread cmd/server/main.go Outdated
Comment thread cmd/server/main.go Outdated
Comment thread internal/core/local_runtime/setup_python_environment.go Outdated
Comment thread internal/core/local_runtime/setup_python_environment.go Outdated
Comment thread internal/db/init.go
Comment thread internal/server/otel.go
Comment thread .env.example Outdated
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 26, 2026
@Stream29 Stream29 self-requested a review January 26, 2026 09:55
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jan 26, 2026
@Stream29 Stream29 requested a review from Yeuoly January 26, 2026 10:44
@Stream29

Copy link
Copy Markdown
Contributor

@Yeuoly It looks good to me.

@Stream29 Stream29 merged commit 35825a7 into langgenius:main Jan 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support opentelemetry

2 participants