-
Notifications
You must be signed in to change notification settings - Fork 104
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
OpenTelemetry integration #246
Conversation
OpenTelemetry and Grafana LGTM integration See merge request product/starhub/starhub-server!829
Linter Issue ReportDuring the code review, a list issues were found. These issues could affect the code quality, maintainability, and consistency. Below is the detailed Linter issue report: linters/gincontext/main.goLint Issue: "go/types" imported and not used
Please make the suggested changes to improve the code quality. |
Possible Issues And Suggestions:
MR Evaluation:This feature is still under test, evaluation are given by AI and might be inaccurate. After evaluation, the code changes in the Merge Request get score: 100. TipsCodeReview Commands (invoked as MR or PR comments)
CodeReview Discussion ChatThere are 2 ways to chat with Starship CodeReview:
Note: Be mindful of the bot's finite context window. CodeReview Documentation and Community
About Us:Visit the OpenCSG StarShip website for the Dashboard and detailed information on CodeReview, CodeGen, and other StarShip modules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The TipsCodeReview Commands (invoked as MR or PR comments)
CodeReview Discussion ChatThere are 2 ways to chat with Starship CodeReview:
Note: Be mindful of the bot's finite context window. CodeReview Documentation and Community
|
This pull request introduces observability enhancements by integrating the OpenTelemetry SDK for tracing, logging, and metrics collection. It also includes an example Grafana LGTM Docker Compose setup for easy local development and monitoring. Additionally, improvements to API context management are made through a refactor and the addition of a custom Gin context linter. Idea from docker-otel-lgtm.
This PR does the following:
docker-compose
file to quickly launch a Grafana instance for visualizing telemetry data.gin.Context
is not mistakenly used ascontext.Context
and refactor all api/handler context.How to Set Up:
Set up Grafana LGTM:
Clone the repository and navigate to the
builder/instrumentation/compose-example
directory.Start the Grafana LGTM instance using Docker Compose:
Access the Grafana dashboard at
http://localhost:3000
.Import Example Dashboards:
builder/instrumentation/grafana-dashboards-example
. Import them into Grafana for quick monitoring.Enable OpenTelemetry SDK Reporting:
To enable reporting to the OpenTelemetry Collector, update your configuration file as follows:
Alternatively, you can use environment variables:
Restart the Server: