What is OpenCensus?

A single distribution of libraries that automatically collects traces and metrics from your app, displays them locally, and sends them to any analysis tool.

The key features of OpenCensus include:

  • Standard wire protocols and consistent APIs for handling trace and metric data.
  • A single set of libraries for many languages, including Java, C++, Go, .Net, Python, PHP, Node.js, Erlang, and Ruby.
  • Included integrations with web and RPC frameworks, making traces and metrics available out of the box.
  • Included exporters for storage and analysis tools. Right now the list includes Zipkin, Prometheus, Jaeger, Stackdriver, and SignalFx.
  • Full open source availability for additional integrations and export options.
  • No additional server or daemon is required to support OpenCensus.
  • In process debugging: an optional agent for displaying request and metrics data on instrumented hosts.

OpenCensus is being developed by a group of cloud providers, Application Performance Management vendors, and open source contributors. The project is hosted on GitHub and all work occurs there.

Concepts

Distributed Tracing

A distributed trace tracks the progression of a single user request as it is handled by the services and processes that make up an application. Each step is called a span in the trace. Spans include metadata about the step, including especially the time spent in the step, called the span’s latency. You can use this information to tune the performance of your application.

Example: A customer completes an order on the checkout page of an e-commerce application. The distributed trace for this request typically shows how the request passes through the front end web service, the user authentication service, the product database, and so on.

Examples of distributed tracing systems include Zipkin, Jaeger, Datadog APM, and Stackdriver Trace.

Metrics

An application metric records information about some part of your application system: the number of orders received, the number of failed authentications, the number of RPC connections received, and so on. You use this information to track usage trends and to detect anomalies that might indicate a problem.

OpenCensus automatically collects a set of predefined metrics from certain runtime libraries, and you can easily send your own application and runtime metrics. Because OpenCensus is linked with your application, it does not send system-level metrics such as CPU or memory utilization.

Examples of metrics analysis systems are Prometheus, Nagios, Datadog, and Stackdriver Monitoring.

FAQ

Who is behind OpenCensus?

OpenCensus is being developed by a group of cloud providers, Application Performance Management vendors, and open source contributors.

OpenCensus was initiated by Google, and is based on instrumentation systems used inside of Google. OpenCensus is a complete rewrite of the Google system.

What languages and integrations does OpenCensus support?

Languages under development:

Language Tracing Metrics
C++ Supported Supported
Java (JVM, OpenJDK, Android) Supported Supported
Go Supported Supported
Python Supported In Progress
PHP                           Supported   Planned
Ruby Supported Planned
Node.js In Progress In Progress
C#/.Net Planned Planned
Erlang In Progress Planned
Web JS Planned Planned

Integrations supported:

  • Spring (planned)
  • gRPC
  • JDBC (planned)
  • net/http
  • Dropwizard (planned)

What APM tools does OpenCensus support?

This list is not yet available. Check out the individual GitHub repos for details.

How do I use OpenCensus in my application?

If you are using a supported application framework, follow its instructions for configuring OpenCensus.

Choose a supported APM tool and follow its configuration instructions for using OpenCensus.

You can also use the OpenCensus z-Pages to view your tracing data without an APM tool.

A user’s guide will be released as soon as possible.

What are the z-Pages?

OpenCensus provides a stand-alone application that uses a gRPC channel to communicate with the OpenCensus code linked into your application. The application displays configuration parameters and trace information held in the OpenCensus library.

How can I contribute to OpenCensus?

  • Help people on the discussion forums.
  • Tell us your success story using OpenCensus.
  • Tell us how we can improve OpenCensus, and help us do it.
  • Contribute to an existing library or create one for a new language.
  • Integrate OpenCensus with a new framework.
  • Integrate OpenCensus with a new APM tool.

Google Summer of Code

Interested in developing for OpenCensus? Here are some ideas: 2018 Google Summer of Code Ideas List

Edit this page on GitHub