diff --git a/.chloggen/influxdbreceiver-add_ping_endpoint.yaml b/.chloggen/influxdbreceiver-add_ping_endpoint.yaml new file mode 100755 index 0000000000000..ad4553afd5d0e --- /dev/null +++ b/.chloggen/influxdbreceiver-add_ping_endpoint.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: receiver/influxdbreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Endpoint `/ping` added to enhance compatibility with third party products" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29594] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/receiver/influxdbreceiver/receiver.go b/receiver/influxdbreceiver/receiver.go index a09baf0ffe2aa..d042d8c592cdf 100644 --- a/receiver/influxdbreceiver/receiver.go +++ b/receiver/influxdbreceiver/receiver.go @@ -73,6 +73,7 @@ func (r *metricsReceiver) Start(_ context.Context, host component.Host) error { router := http.NewServeMux() router.HandleFunc("/write", r.handleWrite) // InfluxDB 1.x router.HandleFunc("/api/v2/write", r.handleWrite) // InfluxDB 2.x + router.HandleFunc("/ping", r.handlePing) r.wg.Add(1) r.server, err = r.httpServerSettings.ToServer(host, r.settings, router) @@ -201,3 +202,7 @@ func (r *metricsReceiver) handleWrite(w http.ResponseWriter, req *http.Request) w.WriteHeader(http.StatusNoContent) } + +func (r *metricsReceiver) handlePing(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusNoContent) +}