summaryrefslogtreecommitdiff
path: root/go/vendor/github.com/lightstep/lightstep-tracer-go
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-08-19 05:02:05 +0000
committerAsh McKenzie <amckenzie@gitlab.com>2019-08-19 05:02:05 +0000
commit256c97066bb7838d43798b6760d3acbb82c44263 (patch)
treea11de1a5bb9a3c27bcd6c9b31c0663bd91c5c8c8 /go/vendor/github.com/lightstep/lightstep-tracer-go
parent81f5854513a527c3a00398e91930a12ebad70272 (diff)
parent4d330cb1dd0fa2d6470d459fc33a987e8f550887 (diff)
downloadgitlab-shell-256c97066bb7838d43798b6760d3acbb82c44263.tar.gz
Merge branch 'jv-go-mod' into 'master'
Use go mod See merge request gitlab-org/gitlab-shell!323
Diffstat (limited to 'go/vendor/github.com/lightstep/lightstep-tracer-go')
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/CHANGELOG.md55
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/Gopkg.lock207
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/Gopkg.toml19
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/LICENSE21
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/Makefile69
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/README.md115
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/VERSION1
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client.go50
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client_grpc.go134
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client_http.go188
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/event_handlers.go97
-rw-r--r--go/vendor/github.com/lightstep/lightstep-tracer-go/events.go330
12 files changed, 0 insertions, 1286 deletions
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/CHANGELOG.md b/go/vendor/github.com/lightstep/lightstep-tracer-go/CHANGELOG.md
deleted file mode 100644
index c5f465a..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/CHANGELOG.md
+++ /dev/null
@@ -1,55 +0,0 @@
-# Changelog
-
-## [Pending Release](https://github.com/lightstep/lightstep-tracer-go/compare/v0.15.6...HEAD)
-* Thrift transport is now removed.
-* Requires go >= 1.7
-* Imports `context` via the standard library instead of `golang.org/x/net/context`
-* Fixes [#182](https://github.com/lightstep/lightstep-tracer-go/issues/182), so that `StartSpan` can now take `SpanReference`s to non-LightStep `SpanContext`s use
-
-## [v0.15.6](https://github.com/lightstep/lightstep-tracer-go/compare/v0.15.5...v0.15.6)
-
-* Minor update to `sendspan` to make it easier to pick which transport protocol to use.
-* Add a new field to Options: DialOptions. These allow setting custom grpc dial options when using grpc.
- * This is necessary to have customer balancers or interceptors.
- * DialOptions shouldn't be set unless it is needed, it will default correctly.
-* Added a new field to Endpoint: Scheme. Scheme can be used to override the default schemes (http/https) or set a custom scheme (for grpc).
- * This is necessary for using custom grpc resolvers.
- * If callers are using struct construction without field names (i.e. Endpoint{"host", port, ...}), they will need to add a new field (scheme = "").
- * Scheme shouldn't be set unless it needs to overridden, it will default correctly.
-
-## [v0.15.5](https://github.com/lightstep/lightstep-tracer-go/compare/v0.15.4...v0.15.5)
-* Internal performance optimizations and a bug fix for issue [#161](https://github.com/lightstep/lightstep-tracer-go/issues/161)
-
-## [v0.15.4](https://github.com/lightstep/lightstep-tracer-go/compare/v0.15.3...v0.15.4)
-* This change affects LightStep's internal testing, not a functional change.
-
-## [v0.15.3](https://github.com/lightstep/lightstep-tracer-go/compare/v0.15.2...v0.15.3)
-* Adds compatibility for io.Writer and io.Reader in Inject/Extract, as required by Open Tracing.
-
-## [v0.15.2](https://github.com/lightstep/lightstep-tracer-go/compare/v0.15.1...v0.15.2)
-* Adds lightstep.GetLightStepReporterID.
-
-## [v0.15.1](https://github.com/lightstep/lightstep-tracer-go/compare/v0.15.0...v0.15.1)
-* Adds Gopkg.toml
-
-## [v0.15.0](https://github.com/lightstep/lightstep-tracer-go/compare/v0.14.0...v0.15.0)
-* We are replacing the internal diagnostic logging with a more flexible “Event” framework. This enables you to track and understand tracer problems with metrics and logging tools of your choice.
-* We are also changed the types of the Close() and Flush() methods to take a context parameter to support cancellation. These changes are *not* backwards compatible and *you will need to update your instrumentation*. We are providing a NewTracerv0_14() method that is a drop-in replacement for the previous version.
-
-## [v0.14.0](https://github.com/lightstep/lightstep-tracer-go/compare/v0.13.0...v0.14.0)
-* Flush buffer syncronously on Close.
-* Flush twice if a flush is already in flight.
-* Remove gogo in favor of golang/protobuf.
-* Requires grpc-go >= 1.4.0.
-
-## [v0.13.0](https://github.com/lightstep/lightstep-tracer-go/compare/v0.12.0...v0.13.0)
-* BasicTracer has been removed.
-* Tracer now takes a SpanRecorder as an option.
-* Tracer interface now includes Close and Flush.
-* Tests redone with ginkgo/gomega.
-
-## [v0.12.0](https://github.com/lightstep/lightstep-tracer-go/compare/v0.11.0...v0.12.0)
-* Added CloseTracer function to flush and close a lightstep recorder.
-
-## [v0.11.0](https://github.com/lightstep/lightstep-tracer-go/compare/v0.10.0...v0.11.0)
-* Thrift transport is now deprecated, gRPC is the default.
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/Gopkg.lock b/go/vendor/github.com/lightstep/lightstep-tracer-go/Gopkg.lock
deleted file mode 100644
index 5a2f431..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/Gopkg.lock
+++ /dev/null
@@ -1,207 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
- branch = "master"
- digest = "1:3b760d3b93f994df8eb1d9ebfad17d3e9e37edcb7f7efaa15b427c0d7a64f4e4"
- name = "github.com/golang/protobuf"
- packages = [
- "proto",
- "protoc-gen-go/descriptor",
- "ptypes",
- "ptypes/any",
- "ptypes/duration",
- "ptypes/timestamp",
- ]
- pruneopts = ""
- revision = "1e59b77b52bf8e4b449a57e6f79f21226d571845"
-
-[[projects]]
- digest = "1:32b27072cd55bd2fb7244de0425943d125da6a552ae2b6517cdd965a662baf18"
- name = "github.com/onsi/ginkgo"
- packages = [
- ".",
- "config",
- "internal/codelocation",
- "internal/containernode",
- "internal/failer",
- "internal/leafnodes",
- "internal/remote",
- "internal/spec",
- "internal/spec_iterator",
- "internal/specrunner",
- "internal/suite",
- "internal/testingtproxy",
- "internal/writer",
- "reporters",
- "reporters/stenographer",
- "reporters/stenographer/support/go-colorable",
- "reporters/stenographer/support/go-isatty",
- "types",
- ]
- pruneopts = ""
- revision = "9eda700730cba42af70d53180f9dcce9266bc2bc"
- version = "v1.4.0"
-
-[[projects]]
- digest = "1:a4e59d0b2821c983b58c317f141cd77df20570979632da8a7a352e5d12698de7"
- name = "github.com/onsi/gomega"
- packages = [
- ".",
- "format",
- "internal/assertion",
- "internal/asyncassertion",
- "internal/oraclematcher",
- "internal/testingtsupport",
- "matchers",
- "matchers/support/goraph/bipartitegraph",
- "matchers/support/goraph/edge",
- "matchers/support/goraph/node",
- "matchers/support/goraph/util",
- "types",
- ]
- pruneopts = ""
- revision = "c893efa28eb45626cdaa76c9f653b62488858837"
- version = "v1.2.0"
-
-[[projects]]
- digest = "1:78fb99d6011c2ae6c72f3293a83951311147b12b06a5ffa43abf750c4fab6ac5"
- name = "github.com/opentracing/opentracing-go"
- packages = [
- ".",
- "log",
- ]
- pruneopts = ""
- revision = "1949ddbfd147afd4d964a9f00b24eb291e0e7c38"
- version = "v1.0.2"
-
-[[projects]]
- branch = "master"
- digest = "1:950b672f2ee80d0fc4c95a15a976ba9ee573a6fb8ede8a777770b2230776367e"
- name = "golang.org/x/net"
- packages = [
- "context",
- "html",
- "html/atom",
- "html/charset",
- "http2",
- "http2/hpack",
- "idna",
- "internal/timeseries",
- "lex/httplex",
- "trace",
- ]
- pruneopts = ""
- revision = "dc871a5d77e227f5bbf6545176ef3eeebf87e76e"
-
-[[projects]]
- branch = "master"
- digest = "1:5da11ab130476e2736f32140f3c1aed2a3a96e9ba8963711a7d38db783d042bd"
- name = "golang.org/x/sys"
- packages = ["unix"]
- pruneopts = ""
- revision = "a0f4589a76f1f83070cb9e5613809e1d07b97c13"
-
-[[projects]]
- branch = "master"
- digest = "1:1c70f7bb89783a026dc32920575a3feef48e065ef6e170ad227903e8194d7a36"
- name = "golang.org/x/text"
- packages = [
- "collate",
- "collate/build",
- "encoding",
- "encoding/charmap",
- "encoding/htmlindex",
- "encoding/internal",
- "encoding/internal/identifier",
- "encoding/japanese",
- "encoding/korean",
- "encoding/simplifiedchinese",
- "encoding/traditionalchinese",
- "encoding/unicode",
- "internal/colltab",
- "internal/gen",
- "internal/tag",
- "internal/triegen",
- "internal/ucd",
- "internal/utf8internal",
- "language",
- "runes",
- "secure/bidirule",
- "transform",
- "unicode/bidi",
- "unicode/cldr",
- "unicode/norm",
- "unicode/rangetable",
- ]
- pruneopts = ""
- revision = "be25de41fadfae372d6470bda81ca6beb55ef551"
-
-[[projects]]
- branch = "master"
- digest = "1:6c15114fafeac4c833544476dec4207a3476799d50ab5165af79eb97806884cf"
- name = "google.golang.org/genproto"
- packages = [
- "googleapis/api/annotations",
- "googleapis/rpc/status",
- ]
- pruneopts = ""
- revision = "7f0da29060c682909f650ad8ed4e515bd74fa12a"
-
-[[projects]]
- digest = "1:6c00b4702c146631d30396090d40bfc0486f8b3af5c976d6f0daf2bc737cd7b2"
- name = "google.golang.org/grpc"
- packages = [
- ".",
- "balancer",
- "balancer/roundrobin",
- "codes",
- "connectivity",
- "credentials",
- "encoding",
- "grpclb/grpc_lb_v1/messages",
- "grpclog",
- "internal",
- "keepalive",
- "metadata",
- "naming",
- "peer",
- "resolver",
- "resolver/dns",
- "resolver/manual",
- "resolver/passthrough",
- "stats",
- "status",
- "tap",
- "transport",
- ]
- pruneopts = ""
- revision = "be077907e29fdb945d351e4284eb5361e7f8924e"
- version = "v1.8.1"
-
-[[projects]]
- branch = "v2"
- digest = "1:f769ed60e075e4221612c2f4162fccc9d3795ef358fa463425e3b3d7a5debb27"
- name = "gopkg.in/yaml.v2"
- packages = ["."]
- pruneopts = ""
- revision = "287cf08546ab5e7e37d55a84f7ed3fd1db036de5"
-
-[solve-meta]
- analyzer-name = "dep"
- analyzer-version = 1
- input-imports = [
- "github.com/golang/protobuf/proto",
- "github.com/golang/protobuf/ptypes/timestamp",
- "github.com/onsi/ginkgo",
- "github.com/onsi/gomega",
- "github.com/onsi/gomega/types",
- "github.com/opentracing/opentracing-go",
- "github.com/opentracing/opentracing-go/log",
- "golang.org/x/net/context",
- "google.golang.org/genproto/googleapis/api/annotations",
- "google.golang.org/grpc",
- "google.golang.org/grpc/credentials",
- ]
- solver-name = "gps-cdcl"
- solver-version = 1
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/Gopkg.toml b/go/vendor/github.com/lightstep/lightstep-tracer-go/Gopkg.toml
deleted file mode 100644
index ce9c39a..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/Gopkg.toml
+++ /dev/null
@@ -1,19 +0,0 @@
-[[constraint]]
- name = "github.com/onsi/ginkgo"
- version = "1.4.0"
-
-[[constraint]]
- name = "github.com/onsi/gomega"
- version = "1.2.0"
-
-[[constraint]]
- name = "github.com/opentracing/opentracing-go"
- version = "1.0.2"
-
-[[constraint]]
- branch = "master"
- name = "golang.org/x/net"
-
-[[constraint]]
- name = "google.golang.org/grpc"
- version = "1.4.3"
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/LICENSE b/go/vendor/github.com/lightstep/lightstep-tracer-go/LICENSE
deleted file mode 100644
index 853b46d..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/Makefile b/go/vendor/github.com/lightstep/lightstep-tracer-go/Makefile
deleted file mode 100644
index 462abdf..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/Makefile
+++ /dev/null
@@ -1,69 +0,0 @@
-# tools
-GO=go
-DOCKER_PRESENT = $(shell command -v docker 2> /dev/null)
-
-LOCAL_GOPATH = $(PWD)/../../../../
-
-default: build
-.PHONY: default build test
-
-# generate_fake: runs counterfeiter in docker container to generate fake classes
-# $(1) output file path
-# $(2) input file path
-# $(3) class name
-define generate_fake
- docker run --rm -v $(LOCAL_GOPATH):/usergo \
- lightstep/gobuild:latest /bin/bash -c "\
- cd /usergo/src/github.com/lightstep/lightstep-tracer-go; \
- counterfeiter -o $(1) $(2) $(3)"
-endef
-
-collectorpb/collectorpbfakes/fake_collector_service_client.go: collectorpb/collector.pb.go
- $(call generate_fake,collectorpb/collectorpbfakes/fake_collector_service_client.go,collectorpb/collector.pb.go,CollectorServiceClient)
-
-# gRPC
-ifeq (,$(wildcard lightstep-tracer-common/collector.proto))
-collectorpb/collector.pb.go:
-else
-collectorpb/collector.pb.go: lightstep-tracer-common/collector.proto
- docker run --rm -v $(shell pwd)/lightstep-tracer-common:/input:ro -v $(shell pwd)/collectorpb:/output \
- lightstep/grpc-gateway:latest \
- protoc -I/root/go/src/tmp/vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --go_out=plugins=grpc:/output --proto_path=/input /input/collector.proto
-endif
-
-# gRPC
-ifeq (,$(wildcard lightstep-tracer-common/collector.proto))
-lightsteppb/lightstep.pb.go:
-else
-lightsteppb/lightstep.pb.go: lightstep-tracer-common/lightstep.proto
- docker run --rm -v $(shell pwd)/lightstep-tracer-common:/input:ro -v $(shell pwd)/lightsteppb:/output \
- lightstep/protoc:latest \
- protoc --go_out=plugins=grpc:/output --proto_path=/input /input/lightstep.proto
-endif
-
-test: collectorpb/collector.pb.go lightsteppb/lightstep.pb.go \
- collectorpb/collectorpbfakes/fake_collector_service_client.go \
- lightstepfakes/fake_recorder.go
-ifeq ($(DOCKER_PRESENT),)
- $(error "docker not found. Please install from https://www.docker.com/")
-endif
- docker run --rm -v $(LOCAL_GOPATH):/usergo lightstep/gobuild:latest \
- ginkgo -race -p /usergo/src/github.com/lightstep/lightstep-tracer-go
- bash -c "! git grep -q '[g]ithub.com/golang/glog'"
-
-build: collectorpb/collector.pb.go lightsteppb/lightstep.pb.go \
- collectorpb/collectorpbfakes/fake_collector_service_client.go version.go \
- lightstepfakes/fake_recorder.go
-ifeq ($(DOCKER_PRESENT),)
- $(error "docker not found. Please install from https://www.docker.com/")
-endif
- ${GO} build github.com/lightstep/lightstep-tracer-go
-
-# When releasing significant changes, make sure to update the semantic
-# version number in `./VERSION`, merge changes, then run `make release_tag`.
-version.go: VERSION
- ./tag_version.sh
-
-release_tag:
- git tag -a v`cat ./VERSION`
- git push origin v`cat ./VERSION`
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/README.md b/go/vendor/github.com/lightstep/lightstep-tracer-go/README.md
deleted file mode 100644
index 1c4371f..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/README.md
+++ /dev/null
@@ -1,115 +0,0 @@
-# lightstep-tracer-go
-
-[![Circle CI](https://circleci.com/gh/lightstep/lightstep-tracer-go.svg?style=shield)](https://circleci.com/gh/lightstep/lightstep-tracer-go)
-[![MIT license](http://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)
-[![GoDoc](https://godoc.org/github.com/lightstep/lightstep-tracer-go?status.svg)](https://godoc.org/github.com/lightstep/lightstep-tracer-go)
-
-The LightStep distributed tracing library for Go.
-
-## Installation
-
-```
-$ go get 'github.com/lightstep/lightstep-tracer-go'
-```
-
-## API Documentation
-
-Godoc: https://godoc.org/github.com/lightstep/lightstep-tracer-go
-
-## Initialization: Starting a new tracer
-To initialize a tracer, configure it with a valid Access Token and optional tuning parameters. Register the tracer as the OpenTracing global tracer so that it will become available to your installed intstrumentations libraries.
-
-```go
-import (
- "github.com/opentracing/opentracing-go"
- "github.com/lightstep/lightstep-tracer-go"
-)
-
-func main() {
- lightstepTracer := lightstep.NewTracer(lightstep.Options{
- AccessToken: "YourAccessToken",
- })
-
- opentracing.SetGlobalTracer(lightstepTracer)
-}
-```
-
-## Instrumenting Code: Using the OpenTracing API
-
-All instrumentation should be done through the OpenTracing API, rather than using the lightstep tracer type directly. For API documentation and advice on instrumentation in general, see the opentracing godocs and the opentracing website.
-
-- https://godoc.org/github.com/opentracing/opentracing-go
-- http://opentracing.io
-
-## Flushing and Closing: Managing the tracer lifecycle
-
-As part of managaing your application lifecycle, the lightstep tracer extends the `opentracing.Tracer` interface with methods for manual flushing and closing. To access these methods, you can take the global tracer and typecast it to a `lightstep.Tracer`. As a convenience, the lightstep package provides static methods which perform the typecasting.
-
-```go
-import (
- "context"
- "github.com/opentracing/opentracing-go"
- "github.com/lightstep/lightstep-tracer-go"
-)
-
-func shutdown(ctx context.Context) {
- // access the running tracer
- tracer := opentracing.GlobalTracer()
-
- // typecast from opentracing.Tracer to lightstep.Tracer
- lsTracer, ok := tracer.(lightstep.Tracer)
- if (!ok) {
- return
- }
- lsTracer.Close(ctx)
-
- // or use static methods
- lightstep.Close(ctx, tracer)
-}
-```
-
-## Event Handling: Observing the LightStep tracer
-In order to connect diagnostic information from the lightstep tracer into an application's logging and metrics systems, inject an event handler using the `OnEvent` static method. Events may be typecast to check for errors or specific events such as status reports.
-
-```go
-import (
- "example/logger"
- "example/metrics"
- "github.com/lightstep/lightstep-tracer-go"
-)
-
-logAndMetricsHandler := func(event lightstep.Event){
- switch event := event.(type) {
- case EventStatusReport:
- metrics.Count("tracer.dropped_spans", event.DroppedSpans())
- case ErrorEvent:
- logger.Error("LS Tracer error: %s", event)
- default:
- logger.Info("LS Tracer info: %s", event)
- }
-}
-
-func main() {
- // setup event handler first to catch startup errors
- lightstep.SetGlobalEventHandler(logAndMetricsHandler)
-
- lightstepTracer := lightstep.NewTracer(lightstep.Options{
- AccessToken: "YourAccessToken",
- })
-
- opentracing.SetGlobalTracer(lightstepTracer)
-}
-```
-
-Event handlers will receive events from any active tracers, as well as errors in static functions. It is suggested that you set up event handling before initializing your tracer to catch any errors on initialization.
-
-## Advanced Configuration: Transport and Serialization Protocols
-
-By default, the tracer will send information to LightStep using GRPC and Protocol Buffers which is the recommended configuration. If there are no specific transport protocol needs you have, there is no need to change this default.
-
-There are three total options for transport protocols:
-
-- [Protocol Buffers](https://developers.google.com/protocol-buffers/) over [GRPC](https://grpc.io/) - The recommended, default, and most performant solution.
-- \[ EXPERIMENTAL \] [Protocol Buffers](https://developers.google.com/protocol-buffers/) over HTTP - New transport protocol supported for use cases where GRPC isn't an option. In order to enable HTTP you will need to configure the LightStep collectors receiving the data to accept HTTP traffic. Reach out to LightStep for support in this.
-
-You can configure which transport protocol the tracer uses using the `UseGRPC`, and `UseHttp` flags in the options. \ No newline at end of file
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/VERSION b/go/vendor/github.com/lightstep/lightstep-tracer-go/VERSION
deleted file mode 100644
index c619394..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-0.15.6
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client.go b/go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client.go
deleted file mode 100644
index f18377d..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client.go
+++ /dev/null
@@ -1,50 +0,0 @@
-package lightstep
-
-import (
- "context"
- "io"
- "net/http"
-
- cpb "github.com/lightstep/lightstep-tracer-go/collectorpb"
-)
-
-// Connection describes a closable connection. Exposed for testing.
-type Connection interface {
- io.Closer
-}
-
-// ConnectorFactory is for testing purposes.
-type ConnectorFactory func() (interface{}, Connection, error)
-
-// collectorResponse encapsulates internal grpc/http responses.
-type collectorResponse interface {
- GetErrors() []string
- Disable() bool
- DevMode() bool
-}
-
-type reportRequest struct {
- protoRequest *cpb.ReportRequest
- httpRequest *http.Request
-}
-
-// collectorClient encapsulates internal grpc/http transports.
-type collectorClient interface {
- Report(context.Context, reportRequest) (collectorResponse, error)
- Translate(context.Context, *reportBuffer) (reportRequest, error)
- ConnectClient() (Connection, error)
- ShouldReconnect() bool
-}
-
-func newCollectorClient(opts Options, reporterID uint64, attributes map[string]string) (collectorClient, error) {
- if opts.UseHttp {
- return newHTTPCollectorClient(opts, reporterID, attributes)
- }
-
- if opts.UseGRPC {
- return newGrpcCollectorClient(opts, reporterID, attributes), nil
- }
-
- // No transport specified, defaulting to GRPC
- return newGrpcCollectorClient(opts, reporterID, attributes), nil
-}
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client_grpc.go b/go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client_grpc.go
deleted file mode 100644
index 5b6f885..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client_grpc.go
+++ /dev/null
@@ -1,134 +0,0 @@
-package lightstep
-
-import (
- "context"
- "fmt"
- "reflect"
- "time"
-
- "google.golang.org/grpc"
- "google.golang.org/grpc/credentials"
-
- // N.B.(jmacd): Do not use google.golang.org/glog in this package.
- cpb "github.com/lightstep/lightstep-tracer-go/collectorpb"
-)
-
-const (
- spansDropped = "spans.dropped"
- logEncoderErrors = "log_encoder.errors"
-)
-
-var (
- intType = reflect.TypeOf(int64(0))
-)
-
-// grpcCollectorClient specifies how to send reports back to a LightStep
-// collector via grpc.
-type grpcCollectorClient struct {
- // auth and runtime information
- attributes map[string]string
- reporterID uint64
-
- // accessToken is the access token used for explicit trace collection requests.
- accessToken string
- maxReportingPeriod time.Duration // set by GrpcOptions.MaxReportingPeriod
- reconnectPeriod time.Duration // set by GrpcOptions.ReconnectPeriod
- reportingTimeout time.Duration // set by GrpcOptions.ReportTimeout
-
- // Remote service that will receive reports.
- address string
- grpcClient cpb.CollectorServiceClient
- connTimestamp time.Time
- dialOptions []grpc.DialOption
-
- // converters
- converter *protoConverter
-
- // For testing purposes only
- grpcConnectorFactory ConnectorFactory
-}
-
-func newGrpcCollectorClient(opts Options, reporterID uint64, attributes map[string]string) *grpcCollectorClient {
- rec := &grpcCollectorClient{
- attributes: attributes,
- reporterID: reporterID,
- accessToken: opts.AccessToken,
- maxReportingPeriod: opts.ReportingPeriod,
- reconnectPeriod: opts.ReconnectPeriod,
- reportingTimeout: opts.ReportTimeout,
- dialOptions: opts.DialOptions,
- converter: newProtoConverter(opts),
- grpcConnectorFactory: opts.ConnFactory,
- }
-
- if len(opts.Collector.Scheme) > 0 {
- rec.address = opts.Collector.urlWithoutPath()
- } else {
- rec.address = opts.Collector.SocketAddress()
- }
-
- rec.dialOptions = append(rec.dialOptions, grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(opts.GRPCMaxCallSendMsgSizeBytes)))
- if opts.Collector.Plaintext {
- rec.dialOptions = append(rec.dialOptions, grpc.WithInsecure())
- } else {
- rec.dialOptions = append(rec.dialOptions, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")))
- }
-
- return rec
-}
-
-func (client *grpcCollectorClient) ConnectClient() (Connection, error) {
- now := time.Now()
- var conn Connection
- if client.grpcConnectorFactory != nil {
- uncheckedClient, transport, err := client.grpcConnectorFactory()
- if err != nil {
- return nil, err
- }
-
- grpcClient, ok := uncheckedClient.(cpb.CollectorServiceClient)
- if !ok {
- return nil, fmt.Errorf("gRPC connector factory did not provide valid client")
- }
-
- conn = transport
- client.grpcClient = grpcClient
- } else {
- transport, err := grpc.Dial(client.address, client.dialOptions...)
- if err != nil {
- return nil, err
- }
-
- conn = transport
- client.grpcClient = cpb.NewCollectorServiceClient(transport)
- }
- client.connTimestamp = now
- return conn, nil
-}
-
-func (client *grpcCollectorClient) ShouldReconnect() bool {
- return time.Since(client.connTimestamp) > client.reconnectPeriod
-}
-
-func (client *grpcCollectorClient) Report(ctx context.Context, req reportRequest) (collectorResponse, error) {
- if req.protoRequest == nil {
- return nil, fmt.Errorf("protoRequest cannot be null")
- }
- resp, err := client.grpcClient.Report(ctx, req.protoRequest)
- if err != nil {
- return nil, err
- }
- return resp, nil
-}
-
-func (client *grpcCollectorClient) Translate(ctx context.Context, buffer *reportBuffer) (reportRequest, error) {
- req := client.converter.toReportRequest(
- client.reporterID,
- client.attributes,
- client.accessToken,
- buffer,
- )
- return reportRequest{
- protoRequest: req,
- }, nil
-}
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client_http.go b/go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client_http.go
deleted file mode 100644
index 08a1cf2..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/collector_client_http.go
+++ /dev/null
@@ -1,188 +0,0 @@
-package lightstep
-
-import (
- "bytes"
- "context"
- "fmt"
- "io/ioutil"
- "net"
- "net/http"
- "net/url"
- "time"
-
- "github.com/golang/protobuf/proto"
- "github.com/lightstep/lightstep-tracer-go/collectorpb"
-)
-
-var (
- acceptHeader = http.CanonicalHeaderKey("Accept")
- contentTypeHeader = http.CanonicalHeaderKey("Content-Type")
-)
-
-const (
- collectorHTTPMethod = "POST"
- collectorHTTPPath = "/api/v2/reports"
- protoContentType = "application/octet-stream"
-)
-
-// grpcCollectorClient specifies how to send reports back to a LightStep
-// collector via grpc.
-type httpCollectorClient struct {
- // auth and runtime information
- reporterID uint64
- accessToken string // accessToken is the access token used for explicit trace collection requests.
- attributes map[string]string
-
- reportTimeout time.Duration
- reportingPeriod time.Duration
-
- // Remote service that will receive reports.
- url *url.URL
- client *http.Client
-
- // converters
- converter *protoConverter
-}
-
-type transportCloser struct {
- *http.Transport
-}
-
-func (closer transportCloser) Close() error {
- closer.CloseIdleConnections()
- return nil
-}
-
-func newHTTPCollectorClient(
- opts Options,
- reporterID uint64,
- attributes map[string]string,
-) (*httpCollectorClient, error) {
- url, err := url.Parse(opts.Collector.URL())
- if err != nil {
- fmt.Println("collector config does not produce valid url", err)
- return nil, err
- }
- url.Path = collectorHTTPPath
-
- return &httpCollectorClient{
- reporterID: reporterID,
- accessToken: opts.AccessToken,
- attributes: attributes,
- reportTimeout: opts.ReportTimeout,
- reportingPeriod: opts.ReportingPeriod,
- url: url,
- converter: newProtoConverter(opts),
- }, nil
-}
-
-func (client *httpCollectorClient) ConnectClient() (Connection, error) {
- // Use a transport independent from http.DefaultTransport to provide sane
- // defaults that make sense in the context of the lightstep client. The
- // differences are mostly on setting timeouts based on the report timeout
- // and period.
- transport := &http.Transport{
- Proxy: http.ProxyFromEnvironment,
- DialContext: (&net.Dialer{
- Timeout: client.reportTimeout / 2,
- DualStack: true,
- }).DialContext,
- // The collector responses are very small, there is no point asking for
- // a compressed payload, explicitly disabling it.
- DisableCompression: true,
- IdleConnTimeout: 2 * client.reportingPeriod,
- TLSHandshakeTimeout: client.reportTimeout / 2,
- ResponseHeaderTimeout: client.reportTimeout,
- ExpectContinueTimeout: client.reportTimeout,
- MaxResponseHeaderBytes: 64 * 1024, // 64 KB, just a safeguard
- }
-
- client.client = &http.Client{
- Transport: transport,
- Timeout: client.reportTimeout,
- }
-
- return transportCloser{transport}, nil
-}
-
-func (client *httpCollectorClient) ShouldReconnect() bool {
- // http.Transport will handle connection reuse under the hood
- return false
-}
-
-func (client *httpCollectorClient) Report(context context.Context, req reportRequest) (collectorResponse, error) {
- if req.httpRequest == nil {
- return nil, fmt.Errorf("httpRequest cannot be null")
- }
-
- httpResponse, err := client.client.Do(req.httpRequest.WithContext(context))
- if err != nil {
- return nil, err
- }
- defer httpResponse.Body.Close()
-
- response, err := client.toResponse(httpResponse)
- if err != nil {
- return nil, err
- }
-
- return response, nil
-}
-
-func (client *httpCollectorClient) Translate(ctx context.Context, buffer *reportBuffer) (reportRequest, error) {
-
- httpRequest, err := client.toRequest(ctx, buffer)
- if err != nil {
- return reportRequest{}, err
- }
- return reportRequest{
- httpRequest: httpRequest,
- }, nil
-}
-
-func (client *httpCollectorClient) toRequest(
- context context.Context,
- buffer *reportBuffer,
-) (*http.Request, error) {
- protoRequest := client.converter.toReportRequest(
- client.reporterID,
- client.attributes,
- client.accessToken,
- buffer,
- )
-
- buf, err := proto.Marshal(protoRequest)
- if err != nil {
- return nil, err
- }
-
- requestBody := bytes.NewReader(buf)
-
- request, err := http.NewRequest(collectorHTTPMethod, client.url.String(), requestBody)
- if err != nil {
- return nil, err
- }
- request = request.WithContext(context)
- request.Header.Set(contentTypeHeader, protoContentType)
- request.Header.Set(acceptHeader, protoContentType)
-
- return request, nil
-}
-
-func (client *httpCollectorClient) toResponse(response *http.Response) (collectorResponse, error) {
- if response.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("status code (%d) is not ok", response.StatusCode)
- }
-
- body, err := ioutil.ReadAll(response.Body)
- if err != nil {
- return nil, err
- }
-
- protoResponse := &collectorpb.ReportResponse{}
- if err := proto.Unmarshal(body, protoResponse); err != nil {
- return nil, err
- }
-
- return protoResponse, nil
-}
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/event_handlers.go b/go/vendor/github.com/lightstep/lightstep-tracer-go/event_handlers.go
deleted file mode 100644
index 4e4ee5f..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/event_handlers.go
+++ /dev/null
@@ -1,97 +0,0 @@
-package lightstep
-
-import (
- "log"
- "sync"
- "sync/atomic"
-)
-
-func init() {
- SetGlobalEventHandler(NewEventLogOneError())
-}
-
-var eventHandler atomic.Value
-
-// An EventHandler can be registered with SetGlobalEventHandler to
-type EventHandler func(Event)
-
-// emitEvent is a thread-safe function for emiting tracer events.
-func emitEvent(event Event) {
- handler := eventHandler.Load().(EventHandler)
- handler(event)
-}
-
-// SetGlobalEventHandler sets a global handler to receive tracer events as they occur. Events
-// may be emitted by the tracer, or by calls to static functions in this package.
-// It is suggested that you set your EventHandler before starting your tracer,
-// but it is safe to set a new handler at any time. Setting a new handler removes
-// the previous one.
-//
-// The EventHandler is called synchronously – do not block in your handler as it
-// may interfere with the tracer. If no EventHandler handler is set, a
-// LogOnceOnError handler is set by default.
-//
-// NOTE: Event handling is for reporting purposes only. It is not intended as a
-// mechanism for controling or restarting the tracer. Connection issues, retry
-// logic, and other transient errors are handled internally by the tracer.
-func SetGlobalEventHandler(handler EventHandler) {
- eventHandler.Store(handler)
-}
-
-/*
- SetGlobalEventHandler Handlers
-*/
-
-// NewEventLogger logs events using the standard go logger.
-func NewEventLogger() EventHandler {
- return logOnEvent
-}
-
-func logOnEvent(event Event) {
- switch event := event.(type) {
- case ErrorEvent:
- log.Println("LS Tracer error: ", event)
- default:
- log.Println("LS Tracer event: ", event)
- }
-}
-
-// NewEventLogOneError logs the first error event that occurs.
-func NewEventLogOneError() EventHandler {
- logger := logOneError{}
- return logger.OnEvent
-}
-
-type logOneError struct {
- sync.Once
-}
-
-func (l *logOneError) OnEvent(event Event) {
- switch event := event.(type) {
- case ErrorEvent:
- l.Once.Do(func() {
- log.Printf("LS Tracer error: (%s). NOTE: Set the SetGlobalEventHandler handler to log events.\n", event.Error())
- })
- }
-}
-
-// NewEventChannel returns an SetGlobalEventHandler callback handler, and a channel that
-// produces the errors. When the channel buffer is full, subsequent errors will
-// be dropped. A buffer size of less than one is incorrect, and will be adjusted
-// to a buffer size of one.
-func NewEventChannel(buffer int) (EventHandler, <-chan Event) {
- if buffer < 1 {
- buffer = 1
- }
-
- eventChan := make(chan Event, buffer)
-
- handler := func(event Event) {
- select {
- case eventChan <- event:
- default:
- }
- }
-
- return handler, eventChan
-}
diff --git a/go/vendor/github.com/lightstep/lightstep-tracer-go/events.go b/go/vendor/github.com/lightstep/lightstep-tracer-go/events.go
deleted file mode 100644
index e5bd91f..0000000
--- a/go/vendor/github.com/lightstep/lightstep-tracer-go/events.go
+++ /dev/null
@@ -1,330 +0,0 @@
-package lightstep
-
-import (
- "errors"
- "fmt"
- "reflect"
- "time"
-
- opentracing "github.com/opentracing/opentracing-go"
-)
-
-// An Event is emitted by the LightStep tracer as a reporting mechanism. They are
-// handled by registering an EventHandler callback via SetGlobalEventHandler. The
-// emitted events may be cast to specific event types in order access additional
-// information.
-//
-// NOTE: To ensure that events can be accurately identified, each event type contains
-// a sentinel method matching the name of the type. This method is a no-op, it is
-// only used for type coersion.
-type Event interface {
- Event()
- String() string
-}
-
-// The ErrorEvent type can be used to filter events. The `Err` method
-// retuns the underlying error.
-type ErrorEvent interface {
- Event
- error
- Err() error
-}
-
-// EventStartError occurs if the Options passed to NewTracer are invalid, and
-// the Tracer has failed to start.
-type EventStartError interface {
- ErrorEvent
- EventStartError()
-}
-
-type eventStartError struct {
- err error
-}
-
-func newEventStartError(err error) *eventStartError {
- return &eventStartError{err: err}
-}
-
-func (*eventStartError) Event() {}
-func (*eventStartError) EventStartError() {}
-
-func (e *eventStartError) String() string {
- return e.err.Error()
-}
-
-func (e *eventStartError) Error() string {
- return e.err.Error()
-}
-
-func (e *eventStartError) Err() error {
- return e.err
-}
-
-// EventFlushErrorState lists the possible causes for a flush to fail.
-type EventFlushErrorState string
-
-// Constant strings corresponding to flush errors
-const (
- FlushErrorTracerClosed EventFlushErrorState = "flush failed, the tracer is closed."
- FlushErrorTracerDisabled EventFlushErrorState = "flush failed, the tracer is disabled."
- FlushErrorTransport EventFlushErrorState = "flush failed, could not send report to Collector"
- FlushErrorReport EventFlushErrorState = "flush failed, report contained errors"
- FlushErrorTranslate EventFlushErrorState = "flush failed, could not translate report"
-)
-
-var (
- errFlushFailedTracerClosed = errors.New(string(FlushErrorTracerClosed))
-)
-
-// EventFlushError occurs when a flush fails to send. Call the `State` method to
-// determine the type of error.
-type EventFlushError interface {
- ErrorEvent
- EventFlushError()
- State() EventFlushErrorState
-}
-
-type eventFlushError struct {
- err error
- state EventFlushErrorState
-}
-
-func newEventFlushError(err error, state EventFlushErrorState) *eventFlushError {
- return &eventFlushError{err: err, state: state}
-}
-
-func (*eventFlushError) Event() {}
-func (*eventFlushError) EventFlushError() {}
-
-func (e *eventFlushError) State() EventFlushErrorState {
- return e.state
-}
-
-func (e *eventFlushError) String() string {
- return e.err.Error()
-}
-
-func (e *eventFlushError) Error() string {
- return e.err.Error()
-}
-
-func (e *eventFlushError) Err() error {
- return e.err
-}
-
-// EventConnectionError occurs when the tracer fails to maintain it's connection
-// with the Collector.
-type EventConnectionError interface {
- ErrorEvent
- EventConnectionError()
-}
-
-type eventConnectionError struct {
- err error
-}
-
-func newEventConnectionError(err error) *eventConnectionError {
- return &eventConnectionError{err: err}
-}
-
-func (*eventConnectionError) Event() {}
-func (*eventConnectionError) EventConnectionError() {}
-
-func (e *eventConnectionError) String() string {
- return e.err.Error()
-}
-
-func (e *eventConnectionError) Error() string {
- return e.err.Error()
-}
-
-func (e *eventConnectionError) Err() error {
- return e.err
-}
-
-// EventStatusReport occurs on every successful flush. It contains all metrics
-// collected since the previous succesful flush.
-type EventStatusReport interface {
- Event
- EventStatusReport()
- StartTime() time.Time
- FinishTime() time.Time
- Duration() time.Duration
- SentSpans() int
- DroppedSpans() int
- EncodingErrors() int
-}
-
-type eventStatusReport struct {
- startTime time.Time
- finishTime time.Time
- sentSpans int
- droppedSpans int
- encodingErrors int
-}
-
-func newEventStatusReport(
- startTime, finishTime time.Time,
- sentSpans, droppedSpans, encodingErrors int,
-) *eventStatusReport {
- return &eventStatusReport{
- startTime: startTime,
- finishTime: finishTime,
- sentSpans: sentSpans,
- droppedSpans: droppedSpans,
- encodingErrors: encodingErrors,
- }
-}
-
-func (*eventStatusReport) Event() {}
-
-func (*eventStatusReport) EventStatusReport() {}
-
-func (s *eventStatusReport) SetSentSpans(sent int) {
- s.sentSpans = sent
-}
-
-func (s *eventStatusReport) StartTime() time.Time {
- return s.startTime
-}
-
-func (s *eventStatusReport) FinishTime() time.Time {
- return s.finishTime
-}
-
-func (s *eventStatusReport) Duration() time.Duration {
- return s.finishTime.Sub(s.startTime)
-}
-
-func (s *eventStatusReport) SentSpans() int {
- return s.sentSpans
-}
-
-func (s *eventStatusReport) DroppedSpans() int {
- return s.droppedSpans
-}
-
-func (s *eventStatusReport) EncodingErrors() int {
- return s.encodingErrors
-}
-
-func (s *eventStatusReport) String() string {
- return fmt.Sprint(
- "STATUS REPORT start: ", s.startTime,
- ", end: ", s.finishTime,
- ", dropped spans: ", s.droppedSpans,
- ", encoding errors: ", s.encodingErrors,
- )
-}
-
-// EventUnsupportedTracer occurs when a tracer being passed to a helper function
-// fails to typecast as a LightStep tracer.
-type EventUnsupportedTracer interface {
- ErrorEvent
- EventUnsupportedTracer()
- Tracer() opentracing.Tracer
-}
-
-type eventUnsupportedTracer struct {
- tracer opentracing.Tracer
- err error
-}
-
-func newEventUnsupportedTracer(tracer opentracing.Tracer) EventUnsupportedTracer {
- return &eventUnsupportedTracer{
- tracer: tracer,
- err: fmt.Errorf("unsupported tracer type: %v", reflect.TypeOf(tracer)),
- }
-}
-
-func (e *eventUnsupportedTracer) Event() {}
-func (e *eventUnsupportedTracer) EventUnsupportedTracer() {}
-
-func (e *eventUnsupportedTracer) Tracer() opentracing.Tracer {
- return e.tracer
-}
-
-func (e *eventUnsupportedTracer) String() string {
- return e.err.Error()
-}
-
-func (e *eventUnsupportedTracer) Error() string {
- return e.err.Error()
-}
-
-func (e *eventUnsupportedTracer) Err() error {
- return e.err
-}
-
-// EventUnsupportedValue occurs when a tracer encounters an unserializable tag
-// or log field.
-type EventUnsupportedValue interface {
- ErrorEvent
- EventUnsupportedValue()
- Key() string
- Value() interface{}
-}
-
-type eventUnsupportedValue struct {
- key string
- value interface{}
- err error
-}
-
-func newEventUnsupportedValue(key string, value interface{}, err error) EventUnsupportedValue {
- if err == nil {
- err = fmt.Errorf(
- "value `%v` of type `%T` for key `%s` is an unsupported type",
- value, value, key,
- )
- }
- return &eventUnsupportedValue{
- key: key,
- value: value,
- err: err,
- }
-}
-
-func (e *eventUnsupportedValue) Event() {}
-func (e *eventUnsupportedValue) EventUnsupportedValue() {}
-
-func (e *eventUnsupportedValue) Key() string {
- return e.key
-}
-
-func (e *eventUnsupportedValue) Value() interface{} {
- return e.value
-}
-
-func (e *eventUnsupportedValue) String() string {
- return e.err.Error()
-}
-
-func (e *eventUnsupportedValue) Error() string {
- return e.err.Error()
-}
-
-func (e *eventUnsupportedValue) Err() error {
- return e.err
-}
-
-const tracerDisabled = "the tracer has been disabled"
-
-// EventTracerDisabled occurs when a tracer is disabled by either the user or
-// the collector.
-type EventTracerDisabled interface {
- Event
- EventTracerDisabled()
-}
-
-type eventTracerDisabled struct{}
-
-func newEventTracerDisabled() EventTracerDisabled {
- return eventTracerDisabled{}
-}
-
-func (eventTracerDisabled) Event() {}
-func (eventTracerDisabled) EventTracerDisabled() {}
-func (eventTracerDisabled) String() string {
- return tracerDisabled
-}