mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user