Skip to content

[BUG] superfluous response.WriteHeader calls made by telemetryWriterWrapper #55745

Description

@deadok22

Agent version

7.81.1

Bug Report

The logs of cluster-agent version 7.81.1 have many log lines like this one:

2026-09-02 08:22:05 UTC | CLUSTER | WARN | (log/log.go:267 in Printf) | Error from the agent http API server: http: superfluous response.WriteHeader call from github.com/DataDog/datadog-agent/pkg/clusteragent/api.(*telemetryWriterWrapper).WriteHeader (handler_telemetry.go:110)

This is due to telemetryWriterWrapper failing to track whether or not the response headers were written out. It fails to update its wroteHeader field when the delegate http.ResponseWriter implementation calls its WriteHeader method as part of the Write implementation (see the godoc of http.ResponseWriter.Write here).

To fix this, telemetryWriterWrapper should implement Write and update wroteHeader in it along with, perhaps, some other state.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    oss/0External contributions priority 0pendingLabel for issues waiting a Datadog member's response.team/container-platformThe Container Platform Team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions