-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
Copy pathports.go
64 lines (53 loc) · 2.21 KB
/
ports.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Copyright (c) 2019 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0
package ports
import (
"strconv"
"strings"
)
const (
// AgentJaegerThriftCompactUDP is the default port for receiving Jaeger Thrift over UDP in compact encoding
AgentJaegerThriftCompactUDP = 6831
// AgentJaegerThriftBinaryUDP is the default port for receiving Jaeger Thrift over UDP in binary encoding
AgentJaegerThriftBinaryUDP = 6832
// AgentZipkinThriftCompactUDP is the default port for receiving Zipkin Thrift over UDP in binary encoding
AgentZipkinThriftCompactUDP = 5775
// AgentConfigServerHTTP is the default port for the agent's HTTP config server (e.g. /sampling endpoint)
AgentConfigServerHTTP = 5778
// AgentAdminHTTP is the default admin HTTP port (health check, metrics, etc.)
AgentAdminHTTP = 14271
// CollectorGRPC is the default port for gRPC server for sending spans
CollectorGRPC = 14250
// CollectorHTTP is the default port for HTTP server for sending spans (e.g. /api/traces endpoint)
CollectorHTTP = 14268
// CollectorAdminHTTP is the default admin HTTP port (health check, metrics, etc.)
CollectorAdminHTTP = 14269
// CollectorZipkin is the port for Zipkin server for sending spans
CollectorZipkin = 9411
// QueryGRPC is the default port of GRPC requests for Query trace retrieval
QueryGRPC = 16685
// QueryHTTP is the default port for UI and Query API (e.g. /api/* endpoints)
QueryHTTP = 16686
// QueryAdminHTTP is the default admin HTTP port (health check, metrics, etc.)
QueryAdminHTTP = 16687
// IngesterAdminHTTP is the default admin HTTP port (health check, metrics, etc.)
IngesterAdminHTTP = 14270
// RemoteStorageGRPC is the default port of GRPC requests for Remote Storage
RemoteStorageGRPC = 17271
// RemoteStorageHTTP is the default admin HTTP port (health check, metrics, etc.)
RemoteStorageAdminHTTP = 17270
)
// PortToHostPort converts the port into a host:port address string
func PortToHostPort(port int) string {
return ":" + strconv.Itoa(port)
}
// FormatHostPort returns hostPort in a usable format (host:port) if it wasn't already
func FormatHostPort(hostPort string) string {
if hostPort == "" {
return ""
}
if strings.Contains(hostPort, ":") {
return hostPort
}
return ":" + hostPort
}