Skip to content

Commit

Permalink
fix: Exclude metric scraping from Istio interception (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrkl authored Mar 4, 2024
1 parent c232a4a commit 7b2d25a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions internal/resources/otelcollector/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ func makeIstioTLSPodAnnotations(istioCertPath string) map[string]string {
proxyMetadata:
OUTPUT_CERTS: %s
`, istioCertPath),
"sidecar.istio.io/userVolumeMount": fmt.Sprintf(`[{"name": "%s", "mountPath": "%s"}]`, istioCertVolumeName, istioCertPath),
"traffic.sidecar.istio.io/includeOutboundPorts": strconv.Itoa(ports.OTLPGRPC),
"traffic.sidecar.istio.io/excludeInboundPorts": strconv.Itoa(ports.Metrics),
"traffic.sidecar.istio.io/excludeOutboundPorts": strconv.Itoa(ports.IstioEnvoy),
"sidecar.istio.io/userVolumeMount": fmt.Sprintf(`[{"name": "%s", "mountPath": "%s"}]`, istioCertVolumeName, istioCertPath),
"traffic.sidecar.istio.io/includeOutboundPorts": strconv.Itoa(ports.OTLPGRPC),
"traffic.sidecar.istio.io/excludeInboundPorts": strconv.Itoa(ports.Metrics),
"traffic.sidecar.istio.io/includeOutboundIPRanges": "",
}
}
2 changes: 1 addition & 1 deletion internal/resources/otelcollector/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestApplyAgentResources(t *testing.T) {
require.Equal(t, "", podAnnotations["traffic.sidecar.istio.io/includeInboundPorts"])
require.Equal(t, "4317", podAnnotations["traffic.sidecar.istio.io/includeOutboundPorts"])
require.Equal(t, "8888", podAnnotations["traffic.sidecar.istio.io/excludeInboundPorts"])
require.Equal(t, "15090", podAnnotations["traffic.sidecar.istio.io/excludeOutboundPorts"])
require.Equal(t, "", podAnnotations["traffic.sidecar.istio.io/includeOutboundIPRanges"])

//collector container
require.Len(t, ds.Spec.Template.Spec.Containers, 1)
Expand Down

0 comments on commit 7b2d25a

Please sign in to comment.