You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exporter/loadbalancingexporter/README.md
+47-1
Original file line number
Diff line number
Diff line change
@@ -37,13 +37,16 @@ This also supports service name based exporting for traces. If you have two or m
37
37
Refer to [config.yaml](./testdata/config.yaml) for detailed examples on using the processor.
38
38
39
39
* The `otlp` property configures the template used for building the OTLP exporter. Refer to the OTLP Exporter documentation for information on which options are available. Note that the `endpoint` property should not be set and will be overridden by this exporter with the backend endpoint.
40
-
* The `resolver` accepts either a `static` node, or a `dns`. If both are specified, `dns` takes precedence.
40
+
* The `resolver` accepts a `static` node, a `dns`or a `k8s` service. If all three are specified, `k8s` takes precedence.
41
41
* The `hostname` property inside a `dns` node specifies the hostname to query in order to obtain the list of IP addresses.
42
42
* The `dns` node also accepts the following optional properties:
43
43
*`hostname` DNS hostname to resolve.
44
44
*`port` port to be used for exporting the traces to the IP addresses resolved from `hostname`. If `port` is not specified, the default port 4317 is used.
45
45
*`interval` resolver interval in go-Duration format, e.g. `5s`, `1d`, `30m`. If not specified, `5s` will be used.
46
46
*`timeout` resolver timeout in go-Duration format, e.g. `5s`, `1d`, `30m`. If not specified, `1s` will be used.
47
+
* The `k8s` node accepts the following optional properties:
48
+
*`service` Kubernetes service to resolve, e.g. `lb-svc.lb-ns`. If no namespace is specified, an attempt will be made to infer the namespace for this collector, and if this fails it will fall back to the `default` namespace.
49
+
*`ports` port to be used for exporting the traces to the addresses resolved from `service`. If `ports` is not specified, the default port 4317 is used. When multiple ports are specified, two backends are added to the load balancer as if they were at different pods.
47
50
* The `routing_key` property is used to route spans to exporters based on different parameters. This functionality is currently enabled only for `trace` pipeline types. It supports one of the following values:
48
51
*`service`: exports spans based on their service name. This is useful when using processors like the span metrics, so all spans for each service are sent to consistent collector instances for metric collection. Otherwise, metrics for the same services are sent to different collectors, making aggregations inaccurate.
49
52
*`traceID` (default): exports spans based on their `traceID`.
@@ -92,6 +95,49 @@ service:
92
95
- loadbalancing
93
96
```
94
97
98
+
Kubernetes resolver example
99
+
```yaml
100
+
receivers:
101
+
otlp:
102
+
protocols:
103
+
grpc:
104
+
endpoint: localhost:4317
105
+
106
+
processors:
107
+
108
+
exporters:
109
+
logging:
110
+
loadbalancing:
111
+
routing_key: "service"
112
+
protocol:
113
+
otlp:
114
+
# all options from the OTLP exporter are supported
115
+
# except the endpoint
116
+
timeout: 1s
117
+
resolver:
118
+
# use k8s service resolver, if collector runs in kubernetes environment
119
+
k8s:
120
+
service: lb-svc.kube-public
121
+
ports:
122
+
- 15317
123
+
- 16317
124
+
125
+
service:
126
+
pipelines:
127
+
traces:
128
+
receivers:
129
+
- otlp
130
+
processors: []
131
+
exporters:
132
+
- loadbalancing
133
+
logs:
134
+
receivers:
135
+
- otlp
136
+
processors: []
137
+
exporters:
138
+
- loadbalancing
139
+
```
140
+
95
141
For testing purposes, the following configuration can be used, where both the load balancer and all backends are running locally:
0 commit comments