feat: [#726] Add HTTP server and client telemetry instrumentation [5]#1326
feat: [#726] Add HTTP server and client telemetry instrumentation [5]#1326krishankumar01 merged 49 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds HTTP server and client telemetry instrumentation capabilities to the Goravel framework, enabling automatic tracing and metrics collection for HTTP requests and responses. This is part of the broader telemetry instrumentation feature set (issue #726).
Key Changes:
- Implemented HTTP middleware for server-side request instrumentation with configurable filtering
- Created HTTP client transport wrapper for outbound request instrumentation
- Added configuration support for HTTP server instrumentation with exclusion patterns
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
telemetry/setup/stubs.go |
Adds instrumentation configuration section with http_server settings for enabled state and path/method exclusions |
telemetry/instrumentation/http/middleware.go |
Implements Telemetry middleware that captures traces, metrics, and handles panics for incoming HTTP requests |
telemetry/instrumentation/http/middleware_test.go |
Provides test suite with test helpers for middleware functionality including success cases, exclusions, disabled state, and panic handling |
telemetry/instrumentation/http/config.go |
Defines ServerConfig structure and option functions for customizing HTTP server instrumentation behavior |
telemetry/instrumentation/http/transport.go |
Implements NewTransport function to wrap HTTP clients with telemetry instrumentation |
telemetry/instrumentation/http/transport_test.go |
Tests for transport wrapper covering fallback scenarios and successful wrapping cases |
go.mod |
Adds dependency on otelhttp instrumentation library |
go.sum |
Updates dependency checksums for otelhttp and its transitive dependency httpsnoop |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1326 +/- ##
========================================
Coverage 68.80% 68.81%
========================================
Files 283 286 +3
Lines 17884 18043 +159
========================================
+ Hits 12305 12416 +111
- Misses 5065 5101 +36
- Partials 514 526 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@krishankumar01 No, just using the default configuration and run the project. |
|
Okay, I’ll check. I’m thinking of using a kill switch for all instrumentation in Instrumentation:
HttpServer:
Enabled: true
HttpClient:
Enabled: false
Log:
Enabled: falseIn this case, regardless of whether the log driver or HTTP middleware is registered, telemetry will not be published when it is disabled. |
@hwbrzzl I think the issue is in |
foundation/application_builder.go
Outdated
| } | ||
|
|
||
| // Register routes | ||
| for _, route := range r.routes { |
There was a problem hiding this comment.
Moving the route registration to the end, because if a user registers any gRPC stats handler or interceptors after calling routes.Grpc() (since in this file we usually call facades.Grpc().Server()), they will be ignored as the server is initialized only once in grpc/application.go.
log/application.go
Outdated
| } | ||
| case log.DriverOtel: | ||
| logLogger := telemetrylog.NewTelemetryChannel() | ||
| logLogger := telemetrylog.NewTelemetryChannel(config) |
There was a problem hiding this comment.
This won’t work if we call the otel driver logger inside providers or from the application builder callbacks, or any callback that runs before provider bootstrap, because telemetry.TelemetryFacade won’t be initialized and therefore won’t be able to lazily initialize the logger. This is expected, as telemetry is typically available only within the request lifecycle context.
There was a problem hiding this comment.
How about passing TelemetryFacade here instead of using telemetry.TelemetryFacade directly? telemetry/instrumentation/* should not use the global telemetry.TelemetryFacade and telemetry.ConfigFacade. They should be passed into.
There was a problem hiding this comment.
Then how do we ensure that a telemetry log channel can accept a telemetry facade instance? When we initialize the telemetry channel in NewApplication, the telemetry facade won’t be available yet. This would require making telemetry a dependency of the log facade.
There was a problem hiding this comment.
When we initialize the telemetry channel in NewApplication, the telemetry facade won’t be available yet.
It should be impossible if the telemetry facade is registered, the telemetry channel should not be initialized during registering service providers but during booting. Return an error here if the telemetry facade is nil during booting.
There was a problem hiding this comment.
But if the user sets the OTEL driver as the default or includes it in the stack, then log.NewApplication will try to resolve the telemetry channel instance, which depends on the telemetry facade. Since telemetry depends on log facade it will register and boot after it.
There was a problem hiding this comment.
Basically,
facades.*should be used inside a callback function if users want to use them inbootstrap.go.
Can we also add an annotation here explaining the different scenarios in which this(WithCallback) should be used? Since this is called before bootstrapping the service providers, it would be helpful to clarify that. Could you please add that?
There was a problem hiding this comment.
The optimization is a bit complex, I need about two or three days. Please continue other parts for this PR.
There was a problem hiding this comment.
No problem, In mean time I will work on #1339.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThis PR introduces comprehensive telemetry instrumentation support across HTTP clients, HTTP servers, logging, and gRPC services. It adds a telemetry resolver abstraction, configuration-driven feature flags for each instrumentation domain, lazy telemetry initialization, and conditional transport/handler wrapping to enable observability without breaking existing functionality. Changes
Sequence Diagram(s)sequenceDiagram
actor App as Application
participant Config as Config Service
participant Factory as Component Factory
participant TelemetryResolver as Telemetry Resolver
participant Telemetry as Telemetry Instance
participant Component as Instrumented Component
App->>Config: Load instrumentation config
App->>Factory: Initialize with TelemetryResolver
Factory->>Config: Check if instrumentation enabled
alt Instrumentation Disabled
Factory->>Component: Create base component (no wrapping)
else Instrumentation Enabled
Factory->>TelemetryResolver: Resolve telemetry
TelemetryResolver->>Telemetry: Return Telemetry instance
Factory->>Component: Create and wrap with OTEL instrumentation
Component->>Telemetry: Use TracerProvider, MeterProvider, Propagator
end
App->>Component: Use instrumented component
Component->>Telemetry: Emit traces/metrics
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
http/client/factory.go (1)
213-221: Bug: Fake transport wrapping bypasses telemetry transport.When both telemetry is enabled and fake state is active, the fake transport wraps
baseTransportinstead oftransport, which loses the telemetry instrumentation layer.The wrapping chain should be:
FakeTransport → TelemetryTransport → baseTransport, but currently it becomesFakeTransport → baseTransport.Suggested fix
var transport http.RoundTripper = baseTransport if cfg.EnableTelemetry && r.telemetryResolver != nil { transport = telemetryhttp.NewTransport(r.config, r.telemetryResolver(), transport) } if state != nil { // If testing mode is active, wrap the real transport with our interceptor. - transport = NewFakeTransport(state, baseTransport, r.json) + transport = NewFakeTransport(state, transport, r.json) }
🤖 Fix all issues with AI agents
In `@telemetry/instrumentation/http/middleware.go`:
- Around line 137-146: The slice baseAttrs is reused then appended to (when
combining with r.cfg.MetricAttributes and other attributes), which can mutate
shared backing storage across concurrent requests; fix by making a
capacity-limited copy before appending (e.g., create a new slice with capacity
== len(baseAttrs) via baseCopy := baseAttrs[:len(baseAttrs):len(baseAttrs)] or
baseCopy := append([]telemetry.KeyValue(nil), baseAttrs...) and then append to
baseCopy) and use that copy wherever you currently call append(baseAttrs, ...)
so each request gets its own backing array.
In `@telemetry/instrumentation/log/channel.go`:
- Around line 29-40: The Handle method on TelemetryChannel calls
r.config.GetBool and r.config.GetString without guarding r.config; add a
nil-check for r.config at the start of TelemetryChannel.Handle and if r.config
is nil return a disabled &handler{enabled:false} (similar to the gRPC handlers)
to avoid a panic; ensure subsequent uses (instrumentName retrieval and
enabled=true) only run when r.config is non-nil so references to
r.config.GetBool/GetString are safe.
🧹 Nitpick comments (3)
telemetry/instrumentation/http/middleware_test.go (1)
32-165: Good test coverage for core middleware functionality.The test suite covers the essential scenarios: successful tracing, custom filter blocking, excluded paths, config-based disabling, and panic propagation. The table-driven approach with setup callbacks is clean and maintainable.
As noted in previous reviews, consider adding tests for:
WithSpanNameFormatteroptionWithMetricAttributesoptionExcludedMethodsconfiguration- Nil telemetry facade handling
These can be addressed in a follow-up to complete the coverage.
telemetry/instrumentation/http/middleware.go (1)
68-70: Consider handling histogram creation errors.The errors from
Float64HistogramandInt64Histogramare silently discarded. While metric creation failures are typically non-fatal, logging a warning would aid debugging when telemetry isn't working as expected.♻️ Suggested improvement
- durationHist, _ := meter.Float64Histogram(metricRequestDuration, metric.WithUnit(unitSeconds), metric.WithDescription("Duration of HTTP server requests")) - requestSizeHist, _ := meter.Int64Histogram(metricRequestBodySize, metric.WithUnit(unitBytes), metric.WithDescription("Size of HTTP server request body")) - responseSizeHist, _ := meter.Int64Histogram(metricResponseBodySize, metric.WithUnit(unitBytes), metric.WithDescription("Size of HTTP server response body")) + durationHist, err := meter.Float64Histogram(metricRequestDuration, metric.WithUnit(unitSeconds), metric.WithDescription("Duration of HTTP server requests")) + if err != nil { + color.Warningln("Failed to create duration histogram:", err) + } + requestSizeHist, err := meter.Int64Histogram(metricRequestBodySize, metric.WithUnit(unitBytes), metric.WithDescription("Size of HTTP server request body")) + if err != nil { + color.Warningln("Failed to create request size histogram:", err) + } + responseSizeHist, err := meter.Int64Histogram(metricResponseBodySize, metric.WithUnit(unitBytes), metric.WithDescription("Size of HTTP server response body")) + if err != nil { + color.Warningln("Failed to create response size histogram:", err) + }http/client/factory_test.go (1)
473-506: Good integration test, minor redundancy.The test properly verifies telemetry integration by checking that the transport is wrapped with
otelhttp.Transport. However, lines 504-505 are redundant sinces.IsType(&otelhttp.Transport{}, ...)on line 502 already verifies the type.Optional: Remove redundant assertion
s.NotNil(httpClient.Transport) s.IsType(&otelhttp.Transport{}, httpClient.Transport) - - _, isPlainTransport := httpClient.Transport.(*http.Transport) - s.False(isPlainTransport) }
hwbrzzl
left a comment
There was a problem hiding this comment.
Awesome, left some questions. Could you add some screenshots for the real effect?
hwbrzzl
left a comment
There was a problem hiding this comment.
Awesome, LGTM basically. I'll make a deeper test locally.
* chore: Update upgrade DB packages (#1374) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Internalize file rotation logic from goravel/file-rotatelogs (#1375) * Initial plan * Implement internal file rotation to replace goravel/file-rotatelogs Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Improve cleanup logic with glob pattern matching and add comprehensive tests Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Address code review feedback: fix trailing whitespace, add cleanup wait, and make tests deterministic Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * optimize --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> Co-authored-by: Bowen <hwbrzzl@gmail.com> * chore: Update non-major dependencies (#1373) * chore: Update non-major dependencies * optimize * optimize * renovate/non-major-dependencies * optimize --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Bowen <hwbrzzl@gmail.com> * feat: [#726] Add HTTP server and client telemetry instrumentation [5] (#1326) * add http middleware * add http transport * optimise http telemetry package * add test cases for Telemetry middleware * add auto instrumentation configs * add config to enable Telemetry for http clients * add docs for config facade * add ConfigFacade nil warning * disable default telemetry * optimise transport * add kill switch for instrumentation * update the stubs * remove unnecessary handler * optimise log instrumentation * move route registration in the end * lazily initialize middleware and transport to work with new application_builder * optimise channel test * optimise channel test * accept telemetry facade as an input instead of using global instance * use a callback to resolve the telemetry facade instance * optimise grpc handler to remove usage of telemetry and config facade * optimise the grpc handler * use telemetry transport if enabled * optimise http auto instrumentation * optimize log test cases * optimise * optimise * optimise * optimise * revert PR#1357 * fix log test cases * revert GRPC changes * optimise middleware * remove zipkin trace driver * correct GRPC enable condition * correct http transport enable condition * correct log channel enable condition * update go mod * fix test cases * fix test cases * fix test cases * fix tests --------- Co-authored-by: Bowen <hwbrzzl@gmail.com> * chore: optimize runner tests for Windows (#1377) Co-authored-by: Bowen <hwbrzzl@github.com> * chore: Update non-major dependencies (#1378) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix: runner stuck (#1381) * fix: runner stuck * optimize * optimize * optimize * optimize * optimize * chore: Update non-major dependencies (#1382) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: [#849] Add table support to the console context (#1380) * add table function in cli * add test cases for new method Table * update mocks * add column level styles * fix lint error * move style vars to new file * add GlobalHuhTheme * update go mod tidy * feat: [#546] artisan command up and down to set website Maintenance mode (#1198) * Add up and down command * Use file helper to create files and add unit tests * Fix the foundation.App dependency * Use support/path instead of foundation.App * Add unit test case * Add some missing checks * Add more missing checks * One more * Fix tmpfile path * Use T.TempDir instead of os.TempDir in tests * Add reason to the down command * Add option to the tests * Change the maintenance file name * close created file handles * Defer abort * Fix the linter issue * Add more options to the down command * Use options * Check for maintenance mode respond * Fix down_command_test * Add more unit test cases * Fix more lint issues * Fix lint issue * fix tests * fix tests * fix tests * fix tests * Address PR comments * Fix check_for_maintenance_test * Check Aborts in check_for_maintenance * Rename check_for_maintenance_mode * Fix and Write more unit tests for check_for_maintenance_mode middleware * fix down command * Fix down_command_test * Fix up_command --------- Co-authored-by: Bowen <hwbrzzl@gmail.com> * feat: Laravel-style Collection library (#1134) Merges comprehensive Collection library with 100+ methods for data manipulation. Implements both eager (Collection) and lazy (LazyCollection) evaluation strategies. Closes goravel/goravel#566 Follow-up improvements tracked in: goravel/goravel#883 * Increase route module coverage for factory, provider, and runner wiring paths (#1384) * Initial plan * test(route): cover route factory and service provider paths Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * optimize * optimize --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> Co-authored-by: Bowen <hwbrzzl@gmail.com> * chore: optimize interface (#1389) * Increase crypt module coverage by exercising AES key validation and failure paths (#1385) * Initial plan * test: add crypt AES edge-case coverage Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: improve readability of crypt key-length cases Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: address crypt PR feedback and simplify test structure Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: use configmock EXPECT style in TestNewAES Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: standardize config mock setup across aes tests Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Increase filesystem module test coverage for storage, service provider, and file facade paths (#1387) * Initial plan * Add filesystem application and provider coverage tests Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Polish filesystem coverage tests after review feedback Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Refine filesystem tests based on review feedback Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Apply review style suggestions in filesystem tests Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Increase mail module test coverage to 70%+ with focused unit tests (#1386) * Initial plan * test(mail): add focused unit coverage for application, options, and service provider Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test(mail): address review feedback on test specificity and readability Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test(mail): merge application unit tests and remove untyped mock matchers Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test(mail): deduplicate matchers and tighten queue job assertion Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test(mail): use AnythingOfType and any in application tests Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test(mail): derive bind callback type string from any signature Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test(mail): simplify bind callback type matcher Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test(mail): use AnythingOfType for template render expectations Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test(mail): restore specific MatchedBy assertions per review clarification Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Increase hash module coverage with targeted tests for driver selection and service provider paths (#1388) * Initial plan * test: increase hash module coverage for driver and provider paths Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: cover hash provider and driver selection paths Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: address hash module review feedback Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: merge hash module tests into application_test Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: use EXPECT API in hash service provider test Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: use any alias in hash singleton callback test Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: add AI instructions file (#1393) * Increase core framework coverage via targeted service provider and builder-path tests (#1391) * Initial plan * Add service provider coverage tests for core modules Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Expand core module coverage tests and validate suite Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Revert unintended test module dependency drift Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Address actionable PR review suggestions in coverage tests Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Finalize review feedback handling Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Revert unintended tests module dependency updates Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Tighten provider test matchers per review feedback Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * Increase infrastructure module coverage by adding Process/Packages/Log/Schedule tests and fixing errors.As target forwarding (#1392) * Initial plan * test(errors): cover As/Unwrap/Ignore/Join edge cases Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test(errors): use wrapped error in As coverage test Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: revert unintended tests module file changes Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: add coverage for process packages log schedule modules Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: refine schedule coverage tests per review Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: revert unintended tests module dependency updates Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: assert boot no-panic in log and process providers Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: finalize review feedback responses for boot test assertions Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: revert unintended tests module file changes Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: expand service-layer coverage across Event, Queue, gRPC, Cache, and Console (#1390) * Initial plan * test(event): cover service provider and queued listener dispatch paths Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: finalize event coverage validation Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: revert unintended tests module dependency updates Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test(event): address review suggestions for robust command matching and queue error path Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: finalize PR feedback follow-up Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: revert unintended tests module file updates Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: add focused coverage cases for queue grpc cache console Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: clarify queue nil args in empty chain test Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: revert unintended tests module dependency updates Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * test: avoid nil context in console usage-error test Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: finalize lint ci fix validation Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: revert unintended tests module dependency drift Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: Update non-major dependencies (#1399) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: add generate flag to artisan build command (#1402) * feat: [#911] add query context accessor (#1401) * chore: optimize agents (#1396) * chore: optimize agents * optimize * address comments * Initial plan * fix: backport migrate rollback default handling to v1.17.x Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * chore: align branch tree with v1.17.x before backporting rollback fix Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> * optimize * optimize --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Bowen <hwbrzzl@gmail.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: hwbrzzl <24771476+hwbrzzl@users.noreply.github.com> Co-authored-by: krishan kumar <84431594+krishankumar01@users.noreply.github.com> Co-authored-by: Bowen <hwbrzzl@github.com> Co-authored-by: Mohan Raj <praem1990@gmail.com> Co-authored-by: Ahmed M. Ammar <ahmed3mar@outlook.com> Co-authored-by: 耗子 <haozi@loli.email> Co-authored-by: ALMAS <almas.cc@icloud.com>


📑 Description
RelatedTo goravel/goravel#726
This pull request introduces OpenTelemetry instrumentation and configuration support to the HTTP client, improves dependency injection for telemetry components, and updates related tests and service provider registration. The changes make it possible to enable tracing and metrics for HTTP client requests through configuration, and ensure that telemetry dependencies are properly injected throughout the codebase.
OpenTelemetry integration and configuration:
EnableTelemetryfield to thehttp/client/config.goConfigstruct, allowing HTTP clients to enable OpenTelemetry tracing and metrics via configuration.http/client/factory.go) to accept a telemetry resolver and wrap the transport with OpenTelemetry instrumentation when enabled. [1] [2] [3]Dependency injection and service provider updates:
http/service_provider.go) to inject the telemetry resolver and config facade when creating the HTTP client factory, ensuring proper wiring of dependencies. [1] [2]Testing improvements:
http/client/factory_test.go) to use mock telemetry and config, and added an integration test verifying telemetry instrumentation is applied to the HTTP client transport. [1] [2]Telemetry contract changes:
Resolvertype alias to the telemetry contract for improved dependency injection.Go module dependency updates:
httpsnoopas dependencies ingo.mod. [1] [2]✅ Checks
Summary by CodeRabbit
Release Notes
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.