Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

Observability with a Service Mesh

By Kokil Thapa | Last reviewed: August 2026

Debugging latency in a distributed system is painful when you rely solely on application-level instrumentation. Observability with a service mesh solves this by intercepting traffic at the infrastructure layer, providing automatic metrics, distributed traces, and access logs without requiring code changes. For teams running Kubernetes or complex microservices, this shifts visibility from a development burden to a platform capability.

While my primary work involves building monolithic Laravel applications and legal-tech portals where a service mesh would be overkill, I frequently consult on architecture for teams migrating from monoliths to microservices. When helping clients plan these transitions, understanding the trade-offs of migrating from monolith to microservices is critical. A service mesh is often the missing piece that makes distributed systems actually manageable in production. If you are managing complex API-driven systems, adopting proper Laravel API best practices alongside infrastructure observability ensures your application logic remains clean while the mesh handles cross-cutting concerns.

How does observability with a service mesh actually work?

A service mesh implements observability through a data plane consisting of lightweight network proxies deployed as sidecars alongside every service instance. In 2026, Envoy remains the dominant proxy engine, used by Istio, Linkerd, and Cilium. Unlike traditional monitoring where you embed Datadog or OpenTelemetry SDKs into your PHP or Node.js code, the sidecar sits transparently in the network path.

The mechanism relies on kernel-level networking primitives. The sidecar uses iptables or eBPF to redirect all inbound and outbound TCP traffic through itself before it reaches the application container. Because the proxy terminates and re-establishes connections, it has full visibility into HTTP/gRPC semantics, TLS handshakes, and payload metadata. It generates telemetry locally and exports it to backend collectors using the OpenTelemetry Protocol (OTLP).

Pod / InstanceApp ContainerEnvoy SidecarOTel CollectorPrometheusJaeger / TempoLoki / ELKOTLP Export
Sidecar proxies intercept traffic and export telemetry via OTLP to centralized backends for observability with a service mesh

This architecture means your application code remains completely unaware of the mesh. A Laravel API handling court marriage applications doesn't need to know it's being traced; the Envoy sidecar injects W3C Trace Context headers automatically. This decoupling is the primary value proposition for teams maintaining polyglot environments where instrumenting legacy PHP, Python, and Go services uniformly would take months.

What telemetry data does a service mesh capture automatically?

Out of the box, modern service meshes provide the "Three Pillars" of observability without any application modification. Understanding exactly what you get for free versus what requires configuration prevents costly gaps in coverage.

Golden Signals and L7 Metrics

The mesh captures Layer 7 metrics for every request passing through the sidecar. These include request rate, error rate (broken down by HTTP status code family), and latency percentiles (p50, p90, p99). Crucially, these metrics are tagged with source and destination workload labels, enabling granular filtering in Prometheus or Grafana. In Istio 1.24+, these metrics align with the OpenTelemetry semantic conventions, reducing vendor lock-in.

Distributed Traces

The sidecar acts as a trace span creator. It generates spans for ingress and egress calls, propagating context across service boundaries. While the mesh captures the network hop, it cannot see inside your business logic. For end-to-end traces, your application must still propagate the traceparent header. Fortunately, most modern frameworks including Laravel 12, Symfony 7, and Node.js 22 support W3C Trace Context natively or via lightweight middleware.

Access Logs and Topology

Every request generates a structured access log containing timestamps, upstream clusters, response flags, and bytes transferred. These logs form the basis for real-time topology maps, showing exactly which services communicate and how frequently. This is invaluable during incident response when documentation is outdated.

Telemetry TypeAutomatic (Mesh Only)Requires App IntegrationPrimary Use Case
HTTP MetricsRate, Errors, Latency, RetriesBusiness-specific dimensionsSLO Monitoring, Alerting
Distributed TracesNetwork hops, Service boundariesIntra-function spans, DB queriesRoot Cause Analysis
Access LogsFull request/response metadataCorrelation IDs in app logsAudit, Debugging, Compliance
mTLS StatusCertificate validity, Cipher suitesNoneSecurity Posture Verification

How do you configure Istio for OpenTelemetry observability?

Istio has fully embraced OpenTelemetry as its native telemetry backend, deprecating the legacy Mixer architecture years ago. Configuring observability with a service mesh in Istio 1.24+ involves defining Telemetry resources rather than editing global mesh configs. This allows namespace-level overrides, essential for multi-tenant clusters.

Below is a production-ready configuration that enables tracing sampling, custom metric tags, and access log formatting. Apply this to your target namespace:

<!-- istio-telemetry-config.yaml -->
apiVersion: telemetry.istio.io/v1
kind: Telemetry
metadata:
  name: mesh-observability
  namespace: production
spec:
  tracing:
    - providers:
        - name: otel-collector
      randomSamplingPercentage: 10.00
      customTags:
        user.tenant_id:
          header:
            name: X-Tenant-ID
            defaultValue: "anonymous"
  metrics:
    - providers:
        - name: prometheus
      overrides:
        - match:
            metric: REQUEST_COUNT
          tagOverrides:
            response_code:
              operation: UPSERT
              value: "response.code"
  accessLogging:
    - providers:
        - name: envoy
      filter:
        expression: "response.code >= 400"

This configuration demonstrates three critical patterns. First, head-based sampling at 10% prevents storage costs from exploding while capturing sufficient signal for latency analysis. Second, extracting custom headers like X-Tenant-ID into trace tags allows filtering traces by customer, which is vital for SaaS platforms serving multiple law firms or businesses. Third, filtering access logs to only errors reduces log volume by 90%+ compared to logging every successful health check.

Telemetry CRDNamespace ScopeTracing ConfigMetrics OverrideAccess Log FilterEnvoy Sidecar• Sample @ 10%• Tag Tenant-ID• Upsert Codes• Log 4xx/5xx Only
Istio Telemetry CRD propagates configuration to Envoy sidecars for consistent observability policies

For teams concerned about performance, note that Istio 1.24 uses eBPF-based telemetry collection on supported kernels (Linux 5.15+), reducing CPU overhead by 30-40% compared to userspace interception. Always verify your node kernel version before enabling this optimization.

Service mesh vs application instrumentation: Which approach wins?

A common mistake is treating the mesh as a complete replacement for application instrumentation. In practice, observability with a service mesh complements rather than replaces code-level telemetry. The decision matrix below reflects lessons learned from production deployments across varied architectures.

  • Use the mesh for: Service-to-service latency, error rates, retry budgets, mTLS verification, and topology mapping. These are infrastructure concerns that shouldn't pollute business logic.
  • Use application instrumentation for: Database query performance, cache hit ratios, business transaction states, queue processing times, and internal function profiling. The mesh cannot see inside your PHP-FPM worker or Node.js event loop.
  • Combine both for: End-to-end distributed traces. The mesh provides the outer spans (network hops), while your app provides inner spans (business logic). Correlate them using W3C Trace Context propagation.

For Nepal-based teams operating on constrained budgets, starting with mesh-only observability provides immediate value. You can achieve 80% visibility into production issues before investing developer time in custom instrumentation. This is particularly relevant when maintaining legacy systems where adding SDKs carries regression risk. As discussed in guides on improving web performance with caching strategies, understanding where bottlenecks exist at the network level often reveals that application optimization isn't even necessary.

Service Mesh LayerNetwork Latency & ErrorsmTLS & Security PolicyRetry / Timeout / Circuit BreakerCross-Service Trace SpansApplication LayerDB Queries & ORM PerformanceCache Hit Ratios & MemoryBusiness Logic & Queue JobsInternal Function SpansW3C Trace Context
Service mesh and application instrumentation cover complementary layers connected via trace context propagation

What are the performance costs and operational gotchas?

Adopting observability with a service mesh is not free. Every request now traverses two additional network stacks (ingress and egress sidecars). In benchmark tests on Kubernetes 1.30 with Istio 1.24, expect 2-5ms added latency per hop and 50-100MB additional memory per pod. For high-throughput APIs processing thousands of requests per second, this compounds quickly.

Mitigate this through selective deployment. Not every namespace needs full mesh coverage. Use Istio's discovery selectors to exclude batch processing jobs or internal tooling from the data plane. Configure telemetry sampling aggressively; 1% sampling is often sufficient for high-volume services while 100% may be appropriate for critical payment flows.

Another frequent production issue involves header propagation failures. If your application strips unknown headers or uses non-standard casing, trace context breaks. Validate header forwarding in staging with tools like istioctl analyze and explicit integration tests. For PHP applications running on Apache or Nginx, ensure CGIPassAuth or equivalent directives allow authorization and trace headers to pass through to PHP-FPM.

Finally, monitor the mesh itself. Sidecars can crash, misconfigure, or exhaust resources. Set up alerts for envoy_server_live, proxy restart counts, and configuration push failures. A blind mesh is worse than no mesh because it creates false confidence. Treat the control plane as a tier-0 dependency with its own SLOs and runbooks.

Implementing Observability with a Service Mesh Effectively

Successful adoption of observability with a service mesh requires treating it as a platform product, not a set-and-forget infrastructure component. Start with a pilot namespace, validate telemetry accuracy against known baselines, and gradually expand coverage. Document your tagging conventions, sampling strategies, and dashboard templates before scaling to prevent observability debt.

For teams in Nepal evaluating whether this complexity is justified, consider your actual pain points. If you're debugging distributed transactions weekly, the investment pays for itself rapidly. If you're running a well-structured monolith with clear module boundaries, focus on application-level profiling first. The goal is actionable insight, not architectural fashion.

Ready to architect observable microservices or optimize your existing distributed system? Contact me to discuss your specific infrastructure challenges and build a pragmatic observability strategy that balances visibility with operational simplicity.

Frequently Asked Questions

It is the automated collection of distributed traces, metrics, and logs via sidecar proxies like Envoy, providing visibility into microservice communication without modifying application code.

Infrastructure costs typically increase 15-25% due to sidecar resource overhead, plus engineering time for configuration and maintenance, ranging Rs 50,000–200,000 monthly (~USD 375–1,500) for mid-scale deployments.

Only when managing 20+ microservices with complex inter-service debugging needs; smaller systems benefit more from direct OpenTelemetry instrumentation without the operational overhead of proxy infrastructure.

Istio remains the most mature option with native OpenTelemetry support and deep integration with Prometheus and Grafana, while Linkerd offers lighter-weight observability with lower memory footprint. Cilium Service Mesh provides eBPF-based visibility without sidecars for Kubernetes-native environments. In my experience maintaining production systems, Istio suits teams needing granular traffic policies alongside telemetry, whereas Linkerd works better when observability is the primary goal and resource constraints matter. Choose based on existing ecosystem expertise rather than feature checklists alone.

No, it complements it. Service meshes capture network-layer telemetry like latency, error rates, and request volumes between services, but cannot see business logic errors, database query performance, or application state. You still need structured application logging and tracing instrumentation within your code. On real client projects, I have seen teams mistakenly assume mesh observability eliminates the need for application metrics, leading to blind spots during incident response. Treat mesh data as infrastructure context that enriches, not replaces, your existing application observability stack.

Enable tracing in the Istio mesh config by setting defaultProviders to your OpenTelemetry collector endpoint. Configure trace sampling rates appropriately, typically 1% for production to avoid overhead. Ensure services propagate W3C Trace Context headers; Istio handles this automatically for HTTP but requires manual header forwarding for gRPC or message queues. Deploy an OpenTelemetry Collector as a DaemonSet or sidecar to receive, batch, and export spans to Jaeger or Tempo. Test end-to-end trace correlation before relying on it for production debugging, as missing context propagation breaks trace continuity across service boundaries.

Sidecar injection failures silently disable telemetry for affected pods, creating observability gaps. High cardinality metrics from unbounded labels overwhelm Prometheus storage. Trace sampling misconfiguration either drops critical errors or generates excessive data costs. mTLS enforcement can break legacy integrations that bypass the mesh. On production Laravel applications I have maintained, the most frequent issue was stale sidecar configurations after deployments causing inconsistent metrics until pods were manually restarted. Always validate observability pipelines in staging with realistic traffic patterns before enabling in production, and implement alerting on telemetry health itself.

Sidecar proxies add 2-5ms latency per hop and consume 50-150MB RAM per pod depending on traffic volume and configuration. Metrics collection intervals below 15 seconds significantly increase CPU usage. Trace sampling above 10% in high-throughput services creates measurable overhead. In practice, most teams observe acceptable impact at default settings, but performance-sensitive paths may require selective mesh exclusion or eBPF-based alternatives like Cilium. Benchmark your specific workload with mesh enabled versus disabled under production-like load before committing. The observability gain must justify the resource tax, especially for budget-constrained deployments where every gigabyte of RAM costs real money.

Yes, most meshes allow enabling telemetry independently of routing rules, retries, or circuit breakers. Istio supports this through separate Telemetry resources, and Linkerd enables observability by default without requiring traffic policies. This incremental approach lets teams gain visibility before adopting advanced mesh features. However, running proxies solely for observability still incurs resource costs and operational complexity. Evaluate whether direct OpenTelemetry instrumentation achieves similar visibility with less overhead. On projects where teams only needed metrics and traces, I have recommended starting with library instrumentation and reserving mesh adoption for when traffic management becomes necessary.

Enable mTLS between all mesh components including telemetry exporters. Restrict access to Prometheus, Grafana, and trace backends using RBAC and network policies. Sanitize sensitive headers and payload data before export using mesh filtering rules. Store observability data encrypted at rest and enforce retention policies compliant with your regulatory requirements. Audit log access to dashboards and query interfaces. On legal-tech portals handling sensitive documents, I ensure observability pipelines never capture request bodies or authentication tokens. Treat telemetry infrastructure with the same security rigor as application data, as aggregated metrics can reveal system architecture and user behavior patterns.

Sidecar proxies like Envoy run as separate containers intercepting all traffic, providing protocol-aware telemetry but consuming significant resources. eBPF-based approaches like Cilium instrument the kernel directly, eliminating per-pod overhead and reducing latency to microseconds. However, eBPF has limited protocol parsing compared to Envoy and requires newer Linux kernels, typically 5.15+. Sidecars offer richer application-layer visibility including HTTP headers and gRPC metadata, while eBPF excels at network-layer metrics with minimal footprint. For Nepal-based deployments on shared hosting with kernel restrictions, sidecars remain more practical despite higher costs.

First verify sidecar injection succeeded by checking pod annotations and container status. Confirm Prometheus scrape targets include your mesh endpoints and relabeling rules match expected label formats. Check proxy logs for configuration errors or connection failures to telemetry backends. Validate that metric names and labels align with your dashboard queries, as version upgrades often change naming conventions. On one production deployment, missing metrics traced back to a namespace selector excluding newly created environments from mesh injection. Systematically verify each pipeline stage from proxy emission through scraping to storage, as failures can occur at any point.

Direct OpenTelemetry SDK instrumentation provides equivalent traces and metrics without proxy overhead. API gateways like Kong or APISIX offer centralized observability for ingress traffic. Cloud-native platforms such as AWS X-Ray or Google Cloud Trace integrate managed telemetry without self-hosted infrastructure. Library-based solutions like Micrometer for Java or Laravel Telescope for PHP frameworks provide application-centric visibility. For teams with fewer than 15 services, these alternatives often deliver sufficient observability at lower operational cost. Reserve service mesh adoption for genuine multi-team, polyglot environments where standardized network-layer telemetry justifies the complexity investment.

Budget 100-200MB RAM and 0.2-0.5 CPU cores per sidecar proxy under moderate load. Prometheus requires approximately 2GB RAM per million active series with 15-second scrape intervals. OpenTelemetry Collectors need 512MB-1GB RAM depending on throughput and batching configuration. Trace storage scales linearly with sampling rate and retention period. On a mid-scale eCommerce platform, adding Istio observability increased total cluster resource needs by roughly 20%. Always conduct load testing with mesh enabled to establish actual baselines rather than relying on vendor estimates, as real-world traffic patterns and configuration choices significantly affect consumption.

Teams require proficiency in Kubernetes networking, Prometheus query language, OpenTelemetry configuration, and proxy debugging. Understanding distributed tracing concepts like context propagation and span relationships is essential. Operational knowledge of certificate rotation, mTLS troubleshooting, and mesh upgrade procedures prevents outages. Familiarity with observability backend administration including retention tuning and query optimization matters at scale. In my experience, the steepest learning curve involves correlating mesh telemetry with application behavior during incidents. Budget two to three months for teams new to service mesh to reach production competency, and consider managed offerings if internal expertise is insufficient.

Share this article

Quick Contact Options
Choose how you want to connect me: