otel: Default metrics protocol to http/protobuf
Buildkit added support for exporting metrics in:
7de2e4fb32
Explicitly set the protocol for exporting metrics like we do for the
traces. We need that because Buildkit defaults to grpc.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
60358bfcab
commit
2d31532a00
1 changed files with 12 additions and 4 deletions
|
@ -380,12 +380,20 @@ func (cli *DaemonCli) start(opts *daemonOptions) (err error) {
|
|||
// TODO: This can be removed after buildkit is updated to use http/protobuf as the default.
|
||||
func setOTLPProtoDefault() {
|
||||
const (
|
||||
tracesEnv = "OTEL_EXPORTER_OTLP_TRACES_PROTOCOL"
|
||||
protoEnv = "OTEL_EXPORTER_OTLP_PROTOCOL"
|
||||
tracesEnv = "OTEL_EXPORTER_OTLP_TRACES_PROTOCOL"
|
||||
metricsEnv = "OTEL_EXPORTER_OTLP_METRICS_PROTOCOL"
|
||||
protoEnv = "OTEL_EXPORTER_OTLP_PROTOCOL"
|
||||
|
||||
defaultProto = "http/protobuf"
|
||||
)
|
||||
|
||||
if os.Getenv(tracesEnv) == "" && os.Getenv(protoEnv) == "" {
|
||||
os.Setenv(tracesEnv, "http/protobuf")
|
||||
if os.Getenv(protoEnv) == "" {
|
||||
if os.Getenv(tracesEnv) == "" {
|
||||
os.Setenv(tracesEnv, defaultProto)
|
||||
}
|
||||
if os.Getenv(metricsEnv) == "" {
|
||||
os.Setenv(metricsEnv, defaultProto)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue