influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.7k stars 5.59k forks source link

fix(common.http): Keep timeout after creating oauth client #15900

Closed lestrozi closed 1 month ago

lestrozi commented 2 months ago

Summary

The HTTP client created by httpconfig loses Timeout configuration when oauth is enabled. More information on issue #15899

This is the fix with the least moving parts I could come up with.
For the future it's probably advisable to have oauth config return a properly wrapped client instead of a new client; or having a mechanism to keep the configuration of the original client.

Checklist

Related issues

resolves #15899

telegraf-tiger[bot] commented 2 months ago

Thanks so much for the pull request! :handshake: :black_nib: Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

lestrozi commented 2 months ago

!signed-cla

telegraf-tiger[bot] commented 2 months ago

Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. Downloads for additional architectures and packages are available below.

:relaxed: This pull request doesn't significantly change the Telegraf binary size (less than 1%)

:package: Click here to get additional PR build artifacts ## Artifact URLs | DEB | RPM | TAR GZ | ZIP | |------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [amd64.deb](https://output.circle-artifacts.com/output/job/cff9b78d-f3b5-431d-9af1-cbeaedaa1ce4/artifacts/0/build/dist/telegraf_1.33.0~d6430fd3-0_amd64.deb) | [aarch64.rpm](https://output.circle-artifacts.com/output/job/65e0c35e-9628-412e-ba5b-6331b649cbe2/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3-0.aarch64.rpm) | [darwin_amd64.tar.gz](https://output.circle-artifacts.com/output/job/1380a732-41cb-4f31-a790-65cc885a3bf2/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_darwin_amd64.tar.gz) | [windows_amd64.zip](https://output.circle-artifacts.com/output/job/a621e40e-60c5-4c5f-8fe5-cf6d898dfa1b/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_windows_amd64.zip) | | [arm64.deb](https://output.circle-artifacts.com/output/job/65e0c35e-9628-412e-ba5b-6331b649cbe2/artifacts/0/build/dist/telegraf_1.33.0~d6430fd3-0_arm64.deb) | [armel.rpm](https://output.circle-artifacts.com/output/job/a77649d1-9f2c-4e33-9c8d-2c6504821269/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3-0.armel.rpm) | [darwin_arm64.tar.gz](https://output.circle-artifacts.com/output/job/785bcaad-93e8-41dd-871b-7c61cdc35afc/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_darwin_arm64.tar.gz) | [windows_arm64.zip](https://output.circle-artifacts.com/output/job/a621e40e-60c5-4c5f-8fe5-cf6d898dfa1b/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_windows_arm64.zip) | | [armel.deb](https://output.circle-artifacts.com/output/job/a77649d1-9f2c-4e33-9c8d-2c6504821269/artifacts/0/build/dist/telegraf_1.33.0~d6430fd3-0_armel.deb) | [armv6hl.rpm](https://output.circle-artifacts.com/output/job/7b1a5ab9-6b7d-4712-aaa6-04f8f9c9e7f6/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3-0.armv6hl.rpm) | [freebsd_amd64.tar.gz](https://output.circle-artifacts.com/output/job/cff9b78d-f3b5-431d-9af1-cbeaedaa1ce4/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_freebsd_amd64.tar.gz) | [windows_i386.zip](https://output.circle-artifacts.com/output/job/a621e40e-60c5-4c5f-8fe5-cf6d898dfa1b/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_windows_i386.zip) | | [armhf.deb](https://output.circle-artifacts.com/output/job/7b1a5ab9-6b7d-4712-aaa6-04f8f9c9e7f6/artifacts/0/build/dist/telegraf_1.33.0~d6430fd3-0_armhf.deb) | [i386.rpm](https://output.circle-artifacts.com/output/job/ec499275-995d-4fb4-916a-3e27b5b8f3b1/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3-0.i386.rpm) | [freebsd_armv7.tar.gz](https://output.circle-artifacts.com/output/job/7b1a5ab9-6b7d-4712-aaa6-04f8f9c9e7f6/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_freebsd_armv7.tar.gz) | | | [i386.deb](https://output.circle-artifacts.com/output/job/ec499275-995d-4fb4-916a-3e27b5b8f3b1/artifacts/0/build/dist/telegraf_1.33.0~d6430fd3-0_i386.deb) | [ppc64le.rpm](https://output.circle-artifacts.com/output/job/df948d1e-8c38-42c2-88f6-079ecde39049/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3-0.ppc64le.rpm) | [freebsd_i386.tar.gz](https://output.circle-artifacts.com/output/job/ec499275-995d-4fb4-916a-3e27b5b8f3b1/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_freebsd_i386.tar.gz) | | | [mips.deb](https://output.circle-artifacts.com/output/job/83483e64-70c5-45e3-93e0-036717c3e874/artifacts/0/build/dist/telegraf_1.33.0~d6430fd3-0_mips.deb) | [riscv64.rpm](https://output.circle-artifacts.com/output/job/2d6ab5d8-7589-4d6d-abd2-ccbf2990a697/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3-0.riscv64.rpm) | [linux_amd64.tar.gz](https://output.circle-artifacts.com/output/job/cff9b78d-f3b5-431d-9af1-cbeaedaa1ce4/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_linux_amd64.tar.gz) | | | [mipsel.deb](https://output.circle-artifacts.com/output/job/6ff1955d-560e-4932-92d4-94f0c225c573/artifacts/0/build/dist/telegraf_1.33.0~d6430fd3-0_mipsel.deb) | [s390x.rpm](https://output.circle-artifacts.com/output/job/8decd125-638a-4b12-a1ec-12198453f338/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3-0.s390x.rpm) | [linux_arm64.tar.gz](https://output.circle-artifacts.com/output/job/65e0c35e-9628-412e-ba5b-6331b649cbe2/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_linux_arm64.tar.gz) | | | [ppc64el.deb](https://output.circle-artifacts.com/output/job/df948d1e-8c38-42c2-88f6-079ecde39049/artifacts/0/build/dist/telegraf_1.33.0~d6430fd3-0_ppc64el.deb) | [x86_64.rpm](https://output.circle-artifacts.com/output/job/cff9b78d-f3b5-431d-9af1-cbeaedaa1ce4/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3-0.x86_64.rpm) | [linux_armel.tar.gz](https://output.circle-artifacts.com/output/job/a77649d1-9f2c-4e33-9c8d-2c6504821269/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_linux_armel.tar.gz) | | | [riscv64.deb](https://output.circle-artifacts.com/output/job/2d6ab5d8-7589-4d6d-abd2-ccbf2990a697/artifacts/0/build/dist/telegraf_1.33.0~d6430fd3-0_riscv64.deb) | | [linux_armhf.tar.gz](https://output.circle-artifacts.com/output/job/7b1a5ab9-6b7d-4712-aaa6-04f8f9c9e7f6/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_linux_armhf.tar.gz) | | | [s390x.deb](https://output.circle-artifacts.com/output/job/8decd125-638a-4b12-a1ec-12198453f338/artifacts/0/build/dist/telegraf_1.33.0~d6430fd3-0_s390x.deb) | | [linux_i386.tar.gz](https://output.circle-artifacts.com/output/job/ec499275-995d-4fb4-916a-3e27b5b8f3b1/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_linux_i386.tar.gz) | | | | | [linux_mips.tar.gz](https://output.circle-artifacts.com/output/job/83483e64-70c5-45e3-93e0-036717c3e874/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_linux_mips.tar.gz) | | | | | [linux_mipsel.tar.gz](https://output.circle-artifacts.com/output/job/6ff1955d-560e-4932-92d4-94f0c225c573/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_linux_mipsel.tar.gz) | | | | | [linux_ppc64le.tar.gz](https://output.circle-artifacts.com/output/job/df948d1e-8c38-42c2-88f6-079ecde39049/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_linux_ppc64le.tar.gz) | | | | | [linux_riscv64.tar.gz](https://output.circle-artifacts.com/output/job/2d6ab5d8-7589-4d6d-abd2-ccbf2990a697/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_linux_riscv64.tar.gz) | | | | | [linux_s390x.tar.gz](https://output.circle-artifacts.com/output/job/8decd125-638a-4b12-a1ec-12198453f338/artifacts/0/build/dist/telegraf-1.33.0~d6430fd3_linux_s390x.tar.gz) | |