Skip to content

Commit b44083d

Browse files
committed
Update receiver.go
1 parent 78f6a36 commit b44083d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

collector/receiver/awstelemetryapi/receiver.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,21 @@ func (r *telemetryAPIReceiver) Start(ctx context.Context, host component.Host) e
9393

9494
mux := http.NewServeMux()
9595
mux.HandleFunc("/", r.httpHandler)
96-
r.httpServer = &http.Server{Addr: address, Handler: mux}
96+
r.httpServer = &http.Server{
97+
Addr: address,
98+
Handler: mux,
99+
ReadHeaderTimeout: 10 * time.Second,
100+
ReadTimeout: 15 * time.Second,
101+
WriteTimeout: 15 * time.Second,
102+
IdleTimeout: 60 * time.Second,
103+
}
97104

98105
go func() {
99106
if err := r.httpServer.ListenAndServe(); err != http.ErrServerClosed {
100107
r.logger.Fatal("HTTP server failed to start", zap.Error(err))
101108
}
102109
}()
103110

104-
// Create and use our new client to register and subscribe.
105111
apiClient, err := telemetryapi.NewClient(r.logger)
106112
if err != nil {
107113
return fmt.Errorf("failed to create telemetry api client: %w", err)

0 commit comments

Comments
 (0)