Google Trillian for Noobs (1c)

The Missing Manuals series

Daz Wilkin
Google Cloud - Community
3 min readJul 5, 2019

--

Last week I documented what I hope is the simplest possible Trillian personality. Yesterday, I documented adding an inclusion proof. Earlier today, I documented building a gRPC-based client and server for the personality. Here is a small addition that adds metrics (stats) and traces.

OpenCensus Exporter

With the addition of a straightforward configuration for an OpenCensus Exporter using the OpenCensus Agent, we have the ability to configure the Agent to convert incoming stats|traces into a wide selection of 3rd-party services.

Here’s the Basic Personality server configuration:

And here’s the Agent’s configuration to receive incoming stats|traces on :55678 and export the stats to Prometheus (on :9100) and the route the traces to thezipkin service on its port :9411:

NB A potential source of confusion. These DNS names are provided by Docker Compose to the services running on the network it creates. These names are accessible to other services within the solution. In this case, the OpenCensus Agent (itself known as opencensus-agent) is able to refer to these other services by their service names (jaefer ,zipkin) but only within the solution. Externally, we need to port map these services onto an available port on localhost.

OpenCensus Agent

The OpenCensus Agent export as a Prometheus Exporter on the host on :9100 so you can query http://localhost:9100/metrics and hopefully see:

We can confirm the OpenCensus Agent by checking its logs:

The OpenCensus Agent is configured (:9999) to show zPages so we can interrogate that endpoint:

/debug/tracez

NB I would have expected to see upstream gRPC traces reflected by the Agent but they’re not. So this is one problem.

Prometheus

The OpenCensus Agent is now a scrape target (via the above Exporter) for the Prometheus server. So the Basic Personality client and server gRPC metrics are exported to the OpenCensus Agent, which exports them as a Prometheus Exporter and they’re then captured by this server:

Zipkin

For some reason — to be explored — Zipkin either isn’t receiving or isn’t able to process the traces routed through the OpenCensus Agent that are generated by the automatic ocgrpc handler.

You can confirm the Zipkin service logs too though these are verbose and not included here:

Jaeger

When Zipkin wasn’t showing traces, I added Jaeger (another trace monitoring tool) to see whether it was Zipkin, the upstream OpenCensus Agent, or something else. Jaeger is reported its own traces but no others. So, there’s something either in my configuration or the OpenCensus Agent that’s not working:

Conclusion

An ‘amuse bouche’ for integration stats and traces into the Basic Personality. It would be more awesome if it worked perfectly ;-)

--

--