Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions charts/linkerd-control-plane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,13 @@ proxy:
# -- Enables trace collection and export in the proxy
enabled: false
traceServiceName: linkerd-proxy
# -- Additional labels to add to the traces emitted by the proxy.
# These should generally not be set globally, and instead overridden on
# individual workloads via `resource.opentelemetry.io/<label>` annotations.
labels:
k8s.pod.ip: "$(_pod_ip)"
k8s.pod.uid: "$(_pod_uid)"
k8s.container.name: "$(_pod_containerName)"
collector:
# -- The collector endpoint to send traces to.
endpoint: ""
Expand Down
6 changes: 3 additions & 3 deletions charts/partials/templates/_proxy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ env:
value: {{ .Values.proxy.tracing.collector.meshIdentity.serviceAccountName }}.{{ .Values.proxy.tracing.collector.meshIdentity.namespace }}.serviceaccount.identity.{{.Release.Namespace}}.{{ .Values.clusterDomain }}
- name: LINKERD2_PROXY_TRACE_EXTRA_ATTRIBUTES
value: |
k8s.pod.ip=$(_pod_ip)
k8s.pod.uid=$(_pod_uid)
k8s.container.name=$(_pod_containerName)
{{- range $k, $v := .Values.proxy.tracing.labels }}
{{ $k }}={{ $v }}
{{- end }}
{{ end -}}
{{/* Configure inbound and outbound parameters, e.g. for HTTP/2 servers. */ -}}
{{ range $proxyK, $proxyV := (dict "inbound" .Values.proxy.inbound "outbound" .Values.proxy.outbound) -}}
Expand Down
18 changes: 17 additions & 1 deletion cli/cmd/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ func TestRender(t *testing.T) {
HostnameLabels: false,
},
Tracing: &charts.Tracing{
Enabled: false,
Enabled: false,
Labels: map[string]string{
"k8s.pod.ip": "$(_pod_ip)",
"k8s.pod.uid": "$(_pod_uid)",
"k8s.container.name": "$(_pod_containerName)",
},
TraceServiceName: "linkerd-proxy",
Collector: &charts.TracingCollector{
Endpoint: "",
Expand Down Expand Up @@ -263,6 +268,16 @@ func TestRender(t *testing.T) {
withCustomDestinationGetNetsValues.ClusterNetworks = "10.0.0.0/8,100.64.0.0/10,172.0.0.0/8"
addFakeTLSSecrets(withCustomDestinationGetNetsValues)

tracingValues, err := testInstallOptions()
if err != nil {
t.Fatalf("Unexpected error: %v\n", err)
}
tracingValues.Proxy.Tracing.Enabled = true
tracingValues.Proxy.Tracing.Collector.Endpoint = "tracing.foo:4317"
tracingValues.Proxy.Tracing.Collector.MeshIdentity.ServiceAccountName = "default"
tracingValues.Proxy.Tracing.Collector.MeshIdentity.Namespace = "foo"
addFakeTLSSecrets(tracingValues)

testCases := []struct {
values *charts.Values
goldenFileName string
Expand All @@ -282,6 +297,7 @@ func TestRender(t *testing.T) {
{defaultValues, "install_values_file.golden", values.Options{ValueFiles: []string{filepath.Join("testdata", "install_config.yaml")}}},
{defaultValues, "install_default_token.golden", values.Options{Values: []string{"identity.serviceAccountTokenProjection=false"}}},
{gidValues, "install_gid_output.golden", values.Options{}},
{tracingValues, "install_tracing.golden", values.Options{}},
}

for i, tc := range testCases {
Expand Down
5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_controlplane_tracing_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_custom_domain.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_custom_registry.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_default.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_default_token.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_gid_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_ha_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_ha_with_overrides_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_heartbeat_disabled_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_helm_control_plane_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_helm_output_ha_labels.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_no_init_container.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cli/cmd/testdata/install_output.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading