Google has introduced an extension of OpenCensus called the OpenCensus Web which is a library for collecting application performance and behavior monitoring data of web pages. This library focuses on the frontend web application code that executes in the browser allowing it to collect user-side performance data. It is still in alpha stage with the API subject to change. This is great news for websites that are heavy by nature, such as media-driven pages like Instagram, Facebook, YouTube, and Amazon, and WebApps.
OpenCensus Web interacts with three application components, the Frontend web server, the Browser JS, and the OpenCensus Agent. The agent receives traces from the frontend web server proxy endpoint or directly from the browser JS, and exports them to a trace backend.
Features of OpenCensus Web
- OpenCensus Web traces spans for initial load including server-side HTML rendering
- The OpenCensus Web spans also includes detailed annotations for DOM load events as well as network events
- It automatically traces all the click events as long as the click is done in a DOM element and it is not disabled
- OC Web traces route transitions between the different sections of your page by monkey-patching the History API
- It allows users to create custom spans for their web application for tasks or code involved in user interaction
- It performs automatic spans for HTTP requests and browser performance data
- OC web relates user interactions back to the initial page load tracing.
Along with this release, the OpenCensus family of projects is merging with
OpenTracing into OpenTelemetry. This means all of the OpenCensus community will be moving over to OpenTelemetry, Google and Omnition included. OpenCensus Web’s functionality will be migrated into OpenTelemetry JS once this project is ready. Omnition founder wrote on Hacker News, “Although Google will be heavily involved in both the client libraries and agent development, Omnition, Microsoft, and others will also be major contributors.”
Another comment on Hacker News, explains the merger more in detail.
“OpenCensus is a Google project to standardize metrics and distributed tracing. It’s an API spec and libraries for various languages with varying backend support.
OpenTracing is a CNCF project as an API for distributed tracing with a separate project called OpenMetrics for the metrics API. Neither include libraries and rely on the community to provide them.
The industry decided for once that we don’t need all this competing work and is consolidating everything into OpenTelemetry that combines an API for tracing and metrics along with libraries. Logs (the 3rd part of observability) are in the planning phase.
OpenCensus Web is bringing the tracing/metrics part to your frontend JS so you can measure how your webapp works in addition to your backend apps and services.”
By September 2019, OpenTelemetry plans to reach parity with existing projects for C#, Golang, Java, NodeJS, and Python. When each language reaches parity, the corresponding OpenTracing and OpenCensus projects will be sunset (old projects will be frozen, but the new project will continue to support existing instrumentation for two years, via a backwards compatibility bridge). Read more on the OpenTelemetry roadmap.
Public reaction for OpenCensus Web has been positive. People have expressed their opinions on a Hacker News thread.
“This is great, as the title says, this means that web applications can now have tracing across the whole stack, all within the same platform.”
“I am also glad to know that the merge between OpenTracing and OpenCensus is still going well. I started adding telemetry to the projects I maintain in my current job and so far it has been very helpful to detect not only bottlenecks in the operations but also sudden spikes in the network traffic since we depend on so many 3rd-party web API that we have no control over. Thank you OpenCensus team for providing me with the tools to learn more.”
For more information about OpenCensus Web, visit Google’s blog.