Commit Graph

4 Commits

Author SHA1 Message Date
Vihas Makwana cdc6dff545
[confighttp] - Expose an option to set ForceAttemptHttp2 setting (#13426)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

We make use golang's `DefaultTransport`, which forces the use of [HTTP/2
by
default](https://cs.opensource.google/go/go/+/refs/tags/go1.24.5:src/net/http/transport.go;l=51).

However, some of our settings are only applicable while using HTTP/1
transport (`MaxConnsPerHost`, `MaxIdleConnsPerHost` and `MaxIdleConns`).
Users wanting to force such settings should have an option to use HTTP/1
by disabling `ForceAttemptHTTP2` to `false`. This PR adds that option.

By default, `ForceAttemptHTTP2` is set to `true` for backward
compatibility.
2025-07-30 20:49:34 +00:00
Pablo Baeyens ac9adbf016
[confighttp] Use `configoptional.Optional` for optional fields (#13109)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Makes the following changes to confighttp:
1. Uses `configoptional.Optional` in `confighttp` for all optional
sections

This means a bunch of breaking changes. I think it is unfeasible to do
this in two steps and I hereby promise that I will fix contrib tests and
help anybody affected by this

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes #9478
2025-07-07 13:03:21 +00:00
Pablo Baeyens 8cd019139f
[chore][confighttp] Fix NewDefaultServerConfig (#13129)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Sets `TLSSetting` to nil on `ServerConfig` since any non-nil value with
no certificates would fail at runtime.
2025-06-02 15:36:21 +00:00
Evan Bradley a9bca17f1a
[confighttp] Add `omitempty` tag to fields (#12482)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Depends on
https://github.com/open-telemetry/opentelemetry-collector/pull/12481.

Note that I didn't add the tag to any fields where we set a default
value. This is because the zero value is significant in these cases and
omitting it from the output would cause it to be set to the default
instead of the zero value. We could fix this with a custom interface
implemented by our config structs, but that will have to be a separate
effort, and simply using the `omitempty` tag is still an improvement for
most fields.

<!-- Issue number if applicable -->
#### Link to tracking issue

Works toward
https://github.com/open-telemetry/opentelemetry-collector/issues/12191
2025-03-03 10:20:58 +00:00