TIS0902 - Using Tracing Configuration in MeshConfig Is Not Recommended
Configuring tracing directly in MeshConfig
is discouraged in recent versions of Istio. Instead, Istio’s Telemetry API is the recommended way to manage tracing configurations and providers, offering more flexibility and maintainability.
By using the Telemetry API to configure tracing, you can take advantage of fine-grained controls, future Istio enhancements, and best-practice approaches to observability.
Example
-
ConfigMap
Including Tracing inMeshConfig
apiVersion: v1
kind: ConfigMap
metadata:
name: istio
namespace: istio-system
data:
mesh: |-
defaultConfig:
discoveryAddress: istiod.istio-system.svc:15012
tracing:
sampling: 10
zipkin:
address: zipkin.istio-system:9411
defaultProviders:
metrics:
- prometheus
enablePrometheusMerge: true
rootNamespace: istio-system
trustDomain: cluster.local
meshNetworks: 'networks: {}'Explanation: This configuration uses
tracing
undermesh.defaultConfig
, which is an older pattern. While it may continue to function, it’s no longer recommended. Future Istio releases may deprecate this approach in favor of the Telemetry API, leading to potential issues or missing functionality if you rely solely onMeshConfig
tracing settings.
Recommendation
-
Migrate Tracing Configuration to the Telemetry API
Instead of embedding tracing settings in
MeshConfig
, define them via the Telemetry custom resource:apiVersion: telemetry.istio.io/v1alpha1
kind: Telemetry
metadata:
name: default
namespace: istio-system
spec:
tracing:
sampling: 10
providers:
- name: zipkin
zipkin:
address: zipkin.istio-system:9411This approach allows you to tailor tracing at different scopes (namespace, workloads, etc.) and stay aligned with current and future Istio best practices.
-
Gradually Phase Out Deprecated MeshConfig Fields
If you’re currently using
MeshConfig
for tracing, begin removing or disabling these fields once your Telemetry resource is in place. This helps ensure compatibility with new Istio versions and reduces the risk of configuration conflicts.