---
title: "Logs and tracing: not just for production, local development too"
description: "A small team wired its Go app to Google Cloud Trace via the OpenCensus Stackdriver exporter, then teed zap logs to both STDERR and Cloud Logging with trace and span IDs attached, so logs appear inline with traces."
url: "https://swe.quest/articles/logs-and-tracing-not-just-for-production-local-development-too-cd937ebe394aa48b"
canonical: "https://incident.io/blog/tracing"
source: "incident.io"
published: "2021-11-11"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["observability","go","developer-productivity","cloud"]
---

# Logs and tracing: not just for production, local development too

A post on [incident.io](https://swe.quest/sources/incident-io.md), published 2021-11-11, 5 min read, How-to. Original: [https://incident.io/blog/tracing](https://incident.io/blog/tracing)

## Summary

A small team wired its Go app to Google Cloud Trace via the OpenCensus Stackdriver exporter, then teed zap logs to both STDERR and Cloud Logging with trace and span IDs attached, so logs appear inline with traces. The same setup runs in local development: every log line carries a clickable Cloud Trace URL, letting developers jump from one interleaved log line to the full trace of a concurrent request or Pub/Sub handler. The payoff is faster local debugging plus fluency with the production tooling, for a small investment that avoids running any tracing infrastructure.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Go](https://swe.quest/tags/go.md) (Languages)
- [Developer productivity](https://swe.quest/tags/developer-productivity.md) (Engineering practices)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)

## Prerequisites

- distributed tracing basics ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))
- Go ([easy posts on Go](https://swe.quest/tags/go.md?difficulty=easy))
- structured logging ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))

## Keywords

Google Cloud Trace, OpenCensus, Stackdriver, zap, Google Cloud Platform

## Related posts

- [Observability as a superpower](https://swe.quest/articles/observability-as-a-superpower-5609b41c95a2309f.md): incident.io · 2024-11-04 · Medium · 8 min read · Observability, Go, Debugging, Incidents & postmortems
  Distributed tracing with OpenTelemetry lets incident.io engineers spot bugs before customers report them, by showing each request's route as a tree of timed spans that exposes slow steps, N+1 queries and duplicate calls.
- [Zero-config Debugging with Deno and OpenTelemetry](https://swe.quest/articles/zero-config-debugging-with-deno-and-opentelemetry-84e6e1786536c301.md): Deno · 2025-04-09 · Medium · 9 min read · Observability, Debugging, Runtimes & VMs, TypeScript
  Deno's built-in OpenTelemetry support (enabled with --unstable-otel) automatically correlates console.log output with trace IDs, creates spans for incoming and outgoing HTTP requests, propagates W3C tracecontext headers across services, and records request-count and latency metrics by status code, all without code changes.
- [Logs, Metrics, and Traces: What Does Each Signal Tell You?](https://swe.quest/articles/logs-metrics-and-traces-what-does-each-signal-tell-you-3a828a88ec5fbd9a.md): Railway · 2025-11-07 · Easy · 8 min read · Observability, Incidents & postmortems
  Logs, metrics and traces answer different questions: metrics show when behaviour changed, traces show where in the service graph a request slowed or failed, and logs explain why.
- [Logging, Metrics, and Distributed Tracing in .NET with OpenTelemetry and ClickStack](https://swe.quest/articles/logging-metrics-and-distributed-tracing-in-net-with-opentelemetry-and-clickstack-1c8d1423c6d63948.md): ClickHouse · 2026-06-03 · Medium · 12 min read · Observability, .NET, SQLite
  Two ASP.NET services (an Order API and a Payment Service backed by SQLite via EF Core) are instrumented with OpenTelemetry and export traces, logs and metrics over OTLP/gRPC to ClickStack, a ClickHouse-based observability stack run in Docker Compose.
- [Connect client traces to your logs](https://swe.quest/articles/connect-client-traces-to-your-logs-499f3b0db3b62deb.md): Supabase · 2026-08-18 · Medium · 3 min read · Observability, JavaScript
  supabase-js can now propagate W3C Trace Context (traceparent, tracestate, baggage headers) to Supabase, so a client trace\_id is stamped onto API Gateway and Edge Function logs and can be joined with browser spans in OpenTelemetry, Sentry, Datadog and similar tools, including via Log Drains.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
