Agent
Introduction
The OpenCensus Agent is a daemon that allows polyglot deployments of OpenCensus to use centralized exporter implementations. Instead of traditionally taking down and configuring OpenCensus exporters per language library and for every single application, with the OpenCensus Agent, one just has to singly enable the OpenCensus Agent exporter for their target language and it will deliver stats, metrics and traces to the centralized point before they are exported to the target backends.
By default, ocagent runs on TCP port 55678
and receives traffic from:
- HTTP/2 clients with Protobuf messages
- HTTP/1 clients that use the grpc-gateway
ocagent is written in the Go programming language, it is cross platform, self-monitored and receives traffic from any application that supports the ocagent protocol or from any application that supported by any of the “OpenCensus Agent receivers”, regardless of the programming language and deployment.
Benefits
For APM Providers …
Implement one Exporter and get data from applications in many languages. Developing exporters only for one language “Go” dramatically scales infrastructure development and deployment, as observability backends no longer have to develop exporters in every 1 of the 9+ languages that OpenCensus supports.
Democratizes deployments for cloud providers because cloud providers can define the backends/exporters that ocagent sends data to.
For Application Developers …
Manage single exporter. Your applications no longer have to locally enable each exporter per language. All applications sends data to OC-Agent using OpenCensus Exporter.
Democratizes deployments for customers as well. They can send the data to a backend of their choice.
Agent provides stats aggregation. Some languages like PHP are a challenge to use a unified in-app concept of stats, instead each request forks independently, hence requires a side car approach to capture stats and traces. Enabling exporters per request is non-idle and expensive. For this purpose, ocagent with a custom daemon allows aggregation of stats and sending over traces. You can read more about this in OpenCensus PHP design
Instrument once, choose and replace backend anytime. Projects can be instrumented without having to upfront decide what backend their signals will be exported to. Drivers, servers, frameworks etc can all be instrumented and still be portable across various deployments and clouds. The customer can at anytime decide which backend they’d like to export to. An example of such a provider is Microsoft with Azure Application Insights. Which has their own agent that receives OpenCensus observability signals.
Reduces overhead. Enabling exporters in only one place dramatically reduces the need to restart and redeploy each application that produces observability. Only ocagent needs to be restarted and the other applications can stay deployed in production.
Consolidates Observability signals. To bootstrap and democratize collection and exporting of your observability data, ocagent also comes with “receivers”. “receivers” make ocagent act like pass-through backends that then receive your telemetry and then route it to the exporter of your choice. For example if all your applications used Zipkin or Jaeger or Prometheus, ocagent can receive data from your applications and then route it to your target backend. This is particularly important if you are in a polyglot and poly-backend setup for which legacy applications are a pain to maintain but you’d like to consolidate your observability signals. It also means that you won’t have to install every single backend’s library and run and scale each backend. Some situations such as expensive acquisitions particularly can benefit from ocagent as described.
No more managing ports. ocagent becomes especially important since some exporters such as Prometheus require a port for every single application so traditionally you’d be limited to 65536 - (number of reserved ports) applications. Unfortunately that approach doesn’t scale proportionally with the complexity of your applications and their deployments. ocagent mitigates such problems by allowing all your applications to send observability data to it, and then it will singly be connected to your final exporter. Now notice, that’s just 1 port open vs a max of 65536, yet giving the same functionality.
Getting started
To get started with the OpenCensus Agent, let’s examine the following topics:
References
Resource | URL |
---|---|
OpenCensus Agent Protocol | ocagent-protocol |
OpenCensus Agent Design | ocagent design doc |
OpenCensus Collector Design | occollector design doc |
grpc-gateway | grpc-gateway on GitHub |
OpenCensus PHP design | Design doc |