Giter Club home page Giter Club logo

honeycomb-opentracing-proxy's Introduction

This project is no longer under development!

This project is not actively maintained and you should not use it. New issues and pull requests will likely be ignored. OpenTracing has been superseded by OpenTelementry.

The OpenTelemetry Collector can read & write multiple trace formats (including Zipkin and Honeycomb) and is the preferred alternative.


CircleCI

honeycomb-opentracing-proxy is a drop-in compatible replacement for Zipkin. If your services are instrumented with OpenTracing and emit span data using Zipkin's Thrift or JSON formats, then honeycomb-opentracing-proxy can receive that data and forward it to the Honeycomb API. Using Honeycomb, you can explore single traces, and run queries over aggregated trace data.

flow diagram

Getting Started

First, sign up for a free Honeycomb trial account, and grab your write key from your account page.

Installation

If you have Go installed, you can clone this repository and build the proxy using the commands below. Alternatively, a Docker image is available. Binary, deb and RPM package downloads will be available soon!

git clone [email protected]:honeycombio/honeycomb-opentracing-proxy \
    $GOPATH/src/github.com/honeycombio/honeycomb-opentracing-proxy
go install github.com/honeycombio/honeycomb-opentracing-proxy/...

Usage

# Forward spans to a Honeycomb dataset named `traces`, using writekey $WRITEKEY
honeycomb-opentracing-proxy -d traces -k $WRITEKEY

# Forward spans to a downstream "real" Zipkin collector as well
honeycomb-opentracing-proxy --downstream https://myzipkin.example.com:9411

# Write spans to stdout for debugging or local development
honeycomb-opentracing-proxy --debug

If you're using Kubernetes, you can find a sample deployment manifest in the kubernetes/ directory.

Advanced usage

If you're instrumenting a complex codebase, and you'd like to send different types of traces to different Honeycomb datasets, add a honeycomb.dataset tag to your spans. E.g.

span, ctx := opentracing.StartSpan("myNewSpan")
span.SetTag("honeycomb.dataset", "My Shiny Tracing Dataset")

Using with a corporate/internal proxy server

If your outbound HTTP traffic goes through an internal/corporate proxy server, you might need to specify the HTTPS_PROXY environment variable when running the OpenTracing proxy:

HTTPS_PROXY=<my proxy address>

Looking to contribute?

Please see our development guide

honeycomb-opentracing-proxy's People

Contributors

akvanhar avatar emfree avatar fernandrone avatar martin308 avatar mikegoldsmith avatar nathanleclaire avatar nicks avatar tobiasgies avatar tredman avatar willthames avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

honeycomb-opentracing-proxy's Issues

Allow configuration of underlying libhoney to tune throughput

When processing large numbers of spans, it is possible to overflow the libhoney queue. The default batch size of 50 is fine for low traffic, but it would be nice to be able to tune that and other libhoney parameters (number of concurrent batches, batch timeout, queue size, etc.).

Consider adding a method of configuring the underlying libhoney with all the knobs it has.

Sending Traces From Spring Cloud Sleuth Zipkin Exporter

Hi All,

I am trying to get up and running sending traces from an existing Spring Cloud Sleuth instrumented Spring Boot application to honeycomb-opentracing-proxy and it is failing with the following error in the proxy console:

time="2019-10-25T02:51:55Z" level=info msg="error unmarshaling spans" error="json: cannot unmarshal bool into Go struct field binaryAnnotation.value of type string" type=application/json

Spring Boot Version: 2.1.3.RELEASE
Spring Cloud Sleuth Version: 2.1.1.RELEASE

I am running the open tracing proxy with the following docker command:

docker run -p 9411:9411 honeycombio/honeycomb-opentracing-proxy -k $KEY -d $DATA_SET

From reading the documentation the honeycomb-opentracing-proxy only supports v1 of the JSON API so I have explicitly set that in spring cloud config as this appears to default to v2.

application.properties

spring.zipkin.sender.type=web
spring.zipkin.base-url=http://localhost:9411
spring.zipkin.enabled=true
spring.zipkin.encoder=json_v1

Any help would be greatly appreciated. Also raised on Stack Overflow here

Clarification on open tracing and zipkin

Hi there,

I'm adding tracing support to a react static site generator called Gatsby. We were going to instrument the codebase with open tracing so that we could plugin many tracing backends. I was happy to see that honeycomb supports open tracing via this proxy.

I'm a little confused though. This proxy is a zipkin proxy, not an open tracing proxy (since open tracing is simply a language level spec). And Zipkin is no longer an open tracing supported platform. In addition, there are no official javascript zipkin open tracing libraries.

So, what is the recommendation on how to send traces to honeycomb from javascript? Is it to ignore open tracing and just use zipkin-js? If not, are there plans for a future honeycomb open tracing js library?

We'd really love to enable honeycomb as a tracing backend :)

Support Span Logs

Currently the proxy handles OT log events by adding the event's attributes to the parent span. This is semantically incorrect as a log event represents a thing that happened at a specific instance (an error, say), vs a span which represents something with a duration. This implementation loses the timestamp of the log event(s)

Further, if a single span has more than one log event with the same attributes, only the values from the last such event will be set on the span.

Ideally log events would show up as distinct events in HC, with a parent span and timestamp, but no duration. These events should appear in the trace UI, although it's not clear to me how they should be displayed, as they have no duration...

Allow configuring the Access-Control-Allow-Origin header

In some cases it might be useful to send events to the proxy from a browser-based application. The browser would check CORS headers before sending, so the proxy would need to set Access-Control-Allow-Origin to the customer's expected origin (or something permissive like *). Would be nice to allow proxy users to configure the value of this header to support this use case.

Support specifying a sample rate as a probability

The current way of specifying a sample rate is a bit confusing (to me), and imprecise.

My understanding is --samplerate=n means 1/n traces will be forwarded, and I think n must be an integer. This means, expressed as a probability, the least aggressive sample rate possible is 50% (1/2). Going from 100% to 50% is a big jump. I'd like to be able to specify the sample rate as a probability between 0 and 100 (or a float between 0 and 1). This would let me have a sample rate of, say, 75%.

Dynamic sampling

Could this agent be extended to allow dynamic sampling of traces, maybe by adding a sample rate as meta-data to root spans? Would this be considered, feature-wise?

Proxy sends v2 JSON payloads to v1 downstream API

In PR #42, support for Zipkin's V2 API was added โ€“ thanks again for that, @fbcbarbosa and @nathanleclaire!

However, I noticed that the Jaeger instance that we're currently running downstream of the honeycomb proxy started storing my services' traces under unknown-service-name as soon as I switched our Opentracing reporters to use the Zipkin V2 API endpoint and JSON format.

After some digging, I found out that the reason for this seems to be that the Honeycomb proxy sends these V2 JSON payloads to the V1 API endpoint, because that's what's hardcoded in main.go. That totally confuses Jaeger.

I'm happy to send in a PR for this myself, I've mainly created this issue to keep track of the problem.

Better document how to configure client tracer code

In particular, if you're using a jaeger client with the zipkin wire format, the tracer configuration is somewhat obtuse. Need to document this clearly. Also need to document how to send a test span, debug whether ingest is working, etc.

Incoming JSON spans that omit the timestamp get assigned 1970 as a timestamp

If an incoming JSON span omits the timestamp field, it gets set to 0 when getting serialized into the ZipkinJSONSpan type. The time conversion from the expected microseconds since unix epoch then happens on that zero value, which returns 1970 as a time.Time object on the Span that will be sent to Honeycomb.

It would be nice if there was a zero check against the timestamp to cancel the whole thing and, in the face of no incoming timestamp, either assign now or pass it on to Honeycomb with no timestamp (where the API will assign now).

[feature] accept protobuf-encoded zipkin

I'm setting up the opentracing proxy for a little personal project, ingesting spans from envoy; unfortunately, the most interesting spans get dropped, because they can't be decoded due to this envoy bug: envoyproxy/envoy#9341 (fixed in envoyproxy/envoy#9432):

time="2020-04-16T14:35:01Z" level=info msg="error unmarshaling spans" error="json: cannot unmarshal number 1.58704770013901e+15 into Go struct field ZipkinJSONSpan.timestamp of type int64" type=application/json

This could ~easily be avoided by accepting a data encoding that has an unmistakable numeric representation (protobuf!) - and envoy supports sending v2 zipkin spans as protobuf in newer versions.

Support for that would be really neat, as I imagine it'll also ~guarantee forwards-compatibility of the schema...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.