Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: http transport ignored when using instrumentation #642

Merged
merged 1 commit into from
Mar 26, 2025

Conversation

lukasmetzner
Copy link
Contributor

@lukasmetzner lukasmetzner commented Mar 26, 2025

Configuration that set a custom HTTP client transport would be ignored. For example in this snippet, the otelhttp.NewTransport would not come into effect.

httpClient := &http.Client{
	Transport: otelhttp.NewTransport(
		http.DefaultTransport,
	),
}

opts := []hcloud.ClientOption{
	hcloud.WithInstrumentation(reg),
	hcloud.WithHTTPClient(httpClient),
}

client := hcloud.NewClient(opts...)

@lukasmetzner lukasmetzner requested a review from a team as a code owner March 26, 2025 09:35
@lukasmetzner lukasmetzner self-assigned this Mar 26, 2025
@lukasmetzner lukasmetzner changed the title fix: http transport override when configuring instrumentation fix: http transport ignored when using instrumentation Mar 26, 2025
Copy link

codecov bot commented Mar 26, 2025

Codecov Report

Attention: Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 79.18%. Comparing base (bdb3d26) to head (b1cde02).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hcloud/internal/instrumentation/metrics.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #642      +/-   ##
==========================================
- Coverage   79.28%   79.18%   -0.10%     
==========================================
  Files          50       50              
  Lines        4407     4411       +4     
==========================================
- Hits         3494     3493       -1     
- Misses        699      703       +4     
- Partials      214      215       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lukasmetzner lukasmetzner merged commit 8362dc0 into main Mar 26, 2025
7 checks passed
@lukasmetzner lukasmetzner deleted the fix-transport-override-instrumentation branch March 26, 2025 09:44
jooola pushed a commit that referenced this pull request Mar 27, 2025
<!-- section-start changelog -->
### Features

- consistent argument errors (#637)

### Bug Fixes

- http transport ignored when using instrumentation (#642)

<!-- section-end changelog -->

---

<details>
<summary><h4>PR by <a
href="https://github.com/apricote/releaser-pleaser">releaser-pleaser</a>
🤖</h4></summary>

If you want to modify the proposed release, add you overrides here. You
can learn more about the options in the docs.

## Release Notes

### Prefix / Start

This will be added to the start of the release notes.

```rp-prefix
```

### Suffix / End

This will be added to the end of the release notes.

```rp-suffix
```

</details>

Co-authored-by: releaser-pleaser <>
apricote pushed a commit to hetznercloud/fleeting-plugin-hetzner that referenced this pull request Mar 27, 2025
…1.0 (hetznercloud/fleeting-plugin-hetzner!234)

This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/hetznercloud/hcloud-go/v2](https://github.com/hetznercloud/hcloud-go) | require | minor | `v2.20.1` -> `v2.21.0` |

---

### Release Notes

<details>
<summary>hetznercloud/hcloud-go (github.com/hetznercloud/hcloud-go/v2)</summary>

### [`v2.21.0`](https://github.com/hetznercloud/hcloud-go/blob/HEAD/CHANGELOG.md#v2210)

[Compare Source](hetznercloud/hcloud-go@v2.20.1...v2.21.0)

##### Features

-   consistent argument errors ([#&#8203;637](hetznercloud/hcloud-go#637))

##### Bug Fixes

-   http transport ignored when using instrumentation ([#&#8203;642](hetznercloud/hcloud-go#642))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMTkuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIxOS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants