Skip to content

Conversation

Degfy
Copy link
Member

@Degfy Degfy commented May 6, 2025

  • Add g.CtxLogger for goner/g
  • Support goner/zap using openTelemetry log to export log, and add traceId in log using openTelemetry tracer
  • Add more examples and docs

dapeng added 16 commits May 1, 2025 10:50
…r log, meter, and tracer providers

- Update config keys for gRPC and HTTP log exporters
- Implement proper shutdown sequence for log, meter, and tracer providers
- Add ForceFlush call before Shutdown for proper data handling
- Optimize logger configuration in helper structs
- Integrate OpenTelemetry logging bridge
- Add configuration options for OpenTelemetry logging
- Implement conditional OpenTelemetry support based on configuration- Update dependencies for OpenTelemetry integration
- Create new example for OpenTelemetry log collection
- Set up OTel collector and configure for log ingestion- Implement basic logging in Go using OTel SDK
- Include configuration files and README for setup instructions
…lper for independent implementation, avoiding circular dependencies

- Add isOtelLogLoadedProvider struct to handle IsOtelLogLoaded functionality
- Implement Provide method for isOtelLogLoadedProvider
- Update go.uber.org/mock from v0.5.1 to v0.5.2 in multiple modules
- This change affects various components including apollo, balancer, cmux, consul, deepseek, etcd, and several examples
- Add CtxLogger interface in g/logger.go for context-based logging
- Implement ctxLogger in zap/ctx_logger.go to extract trace ID from context
- Refactor gone_logger.go to use new ctxLogger
- Update load.go to register ctxLogger as default CtxLogger
- Remove sugarProvider and related code
- Rename mock_http_test.go to http_mock.go- Add comprehensive mock implementations for various gin interfaces
- Update mock generation command in the file header
- Add support for retrieving trace IDs from OpenTelemetry context
- Update go.mod files to include necessary dependencies
- Modify Gin and gRPC middlewares to check for OpenTelemetry trace IDs
- Fall back to existing trace ID retrieval methods if OpenTelemetry is not used
…er/gid, which can be used separately to reduce dependencies.

- Add new tracer implementations using goid and gls libraries
- Improve performance with high-performance gid implementation
- Update loader and interface to support new tracer components
- Add tests for new tracer implementations
- Update documentation and README with new usage instructions
- Add go.uber.org/mock v0.5.2 to multiple modules
- Add github.com/gone-io/goner/tracer/gid and gls to go.mod
- Update go.mod with new dependencies and remove commented replacements
- Add OpenTelemetry tracing to the log collection example
- Implement context-based logging with trace ID
- Update configuration to enable trace logging
- Refactor logger initialization and error handling
- Optimize trace encoder to prevent duplicate trace IDs
- Update README.md with new features and configuration options
- Add detailed guide for integrating with OpenTelemetry
- Remove unused code and simplify examples
- Update Chinese README with similar changes
…e framework

- Create new directory for Zap logger example
- Add main.go file with example usage of Zap logger
- Include README.md and README_CN.md files with detailed documentation
- Provide examples of using native Zap logger and Gone logger interface
- Demonstrate custom encoder implementation
- Show integration with tracer
…mples

- Add log collection example using OpenTelemetry and Zap- Add distributed tracing example over HTTP and gRPC protocols
- Update existing tracer-over-oltp-http example
- Add Chinese and English README files for new examples
- Remove GetTraceIdFromCtx function
- Use trace.SpanContextFromContext to get span context
- Check for valid trace ID using HasTraceID
- Add unit tests for ctxLogger.Ctx method
- Update mock tracer implementation
- Adjust trace encoder tests
- Remove unused dependencies in various go.mod files
- Add IsLoaded function in g/help.go to track loaded Goner instances
- Update otel/helper.go to use IsLoaded for checking if helper is already loaded- Modify examples to reflect changes in dependency structure
Copy link

codecov bot commented May 6, 2025

Codecov Report

Attention: Patch coverage is 82.23684% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
zap/provider.go 76.19% 9 Missing and 1 partial ⚠️
gin/sys_middleware.go 40.00% 5 Missing and 1 partial ⚠️
grpc/server.go 50.00% 5 Missing and 1 partial ⚠️
zap/encoder.go 78.94% 3 Missing and 1 partial ⚠️
otel/helper.go 75.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
g/help.go 100.00% <100.00%> (ø)
otel/log/grpc/grpc.go 92.68% <ø> (ø)
otel/log/helper.go 92.30% <100.00%> (+9.45%) ⬆️
otel/log/http/http.go 92.85% <ø> (ø)
otel/meter/helper.go 92.10% <100.00%> (+8.32%) ⬆️
otel/tracer/helper.go 91.42% <100.00%> (+9.07%) ⬆️
tracer/gid/tracer.go 100.00% <100.00%> (ø)
tracer/gls/tracer.go 100.00% <100.00%> (ø)
tracer/loader.go 100.00% <100.00%> (ø)
zap/ctx_logger.go 100.00% <100.00%> (ø)
... and 7 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Degfy Degfy merged commit 24a8a14 into main May 6, 2025
5 of 6 checks passed
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.

1 participant