| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
//go:generate mdatagen metadata.yaml |
| 5 |
|
| 6 |
package httpsprovider // import "go.opentelemetry.io/collector/confmap/provider/httpsprovider" |
| 7 |
|
| 8 |
import ( |
| 9 |
"go.opentelemetry.io/collector/confmap" |
| 10 |
"go.opentelemetry.io/collector/confmap/provider/internal/configurablehttpprovider" |
| 11 |
) |
| 12 |
|
| 13 |
// NewFactory returns a factory for a confmap.Provider that reads the configuration from a https server. |
| 14 |
// |
| 15 |
// This Provider supports "https" scheme. One example of an HTTPS URI is: https://localhost:3333/getConfig |
| 16 |
// |
| 17 |
// To add extra CA certificates you need to install certificates in the system pool. This procedure is operating system |
| 18 |
// dependent. E.g.: on Linux please refer to the `update-ca-trust` command. |
| 19 |
func NewFactory() confmap.ProviderFactory { |
| 20 |
return confmap.NewProviderFactory(newProvider) |
| 21 |
} |
| 22 |
|
| 23 |
func newProvider(set confmap.ProviderSettings) confmap.Provider { |
| 24 |
return configurablehttpprovider.New(configurablehttpprovider.HTTPSScheme, set) |
| 25 |
} |