diff --git a/.gitignore b/.gitignore index 9331e90071..c4505b54f1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ /prom-migrator* /cmd/promscale/promscale /cmd/prom-migrator/prom-migrator -/cmd/jaeger-query-proxy/jaeger-query-proxy /dist /vendor /version.properties diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b49742a98..fe9771441b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ We use the following categories for changes: ### Removed - Remove deprecated `-promql-enable-feature` flag [#964] - Remove deprecated leader election [#964] +- Remove obsoleted jaeger-query-proxy ### Fixed - helm-charts: use fixed target port on svc-promscale [#1009] diff --git a/build/.goreleaser.yml b/build/.goreleaser.yml index ae850e06fd..226e4a7c6a 100644 --- a/build/.goreleaser.yml +++ b/build/.goreleaser.yml @@ -21,11 +21,6 @@ builds: main: ./cmd/prom-migrator/ id: prom-migrator binary: prom-migrator -- env: - - CGO_ENABLED=0 - main: ./cmd/jaeger-query-proxy/ - id: jaeger-query-proxy - binary: jaeger-query-proxy #don't publish scoop but overwrite the weird names scoop: @@ -115,17 +110,6 @@ archives: windows: Windows 386: i386 amd64: x86_64 -- id: jaeger-query-proxy - format: binary - builds: - - jaeger-query-proxy - name_template: "{{ .Binary }}_0.0.2_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}" - replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 checksum: name_template: 'checksums.txt' snapshot: @@ -182,19 +166,6 @@ dockers: image_templates: - "timescale/prom-migrator:0.0.3" - "timescale/prom-migrator:latest" -- ids: [] - skip_push: false - dockerfile: ./build/jaeger-query-proxy/Dockerfile - extra_files: - - .git - - go.sum - - go.mod - - pkg - - cmd - image_templates: - - "timescale/jaeger-query-proxy:0.0.2" - - "timescale/jaeger-query-proxy:latest" - docker_manifests: - name_template: 'timescale/promscale:{{ .Tag }}' diff --git a/build/jaeger-query-proxy/Dockerfile b/build/jaeger-query-proxy/Dockerfile deleted file mode 100644 index a12a2004e6..0000000000 --- a/build/jaeger-query-proxy/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# Build stage -FROM golang:1.15.4-alpine AS builder -COPY ./.git build/.git -COPY ./pkg build/pkg -COPY ./cmd build/cmd -COPY ./go.mod build/go.mod -COPY ./go.sum build/go.sum -RUN apk update && apk add --no-cache git \ - && cd build \ - && go mod download \ - && GIT_COMMIT=$(git rev-list -1 HEAD) \ - && CGO_ENABLED=0 go build -a \ - --ldflags '-w' --ldflags "-X version.CommitHash=$GIT_COMMIT" \ - -o /go/jaeger-query-proxy ./cmd/jaeger-query-proxy - -# Final image -FROM jaegertracing/jaeger-query:1.27 - -ENV SPAN_STORAGE_TYPE=grpc-plugin \ - GRPC_STORAGE_PLUGIN_BINARY=/tmp/promscale-jaeger-plugin \ - GRPC_STORAGE_PLUGIN_CONFIGURATION_FILE=/configs/jaeger-promscale-query.yaml - -# This is silly, but it's important that tempo-query gets copied into /tmp -# b/c it forces a /tmp dir to exist which hashicorp plugins depend on - -RUN cd / && mkdir configs -COPY --from=builder /go/jaeger-query-proxy /tmp/promscale-jaeger-plugin \ No newline at end of file diff --git a/cmd/jaeger-query-proxy/main.go b/cmd/jaeger-query-proxy/main.go deleted file mode 100644 index 777494553a..0000000000 --- a/cmd/jaeger-query-proxy/main.go +++ /dev/null @@ -1,101 +0,0 @@ -// This file and its contents are licensed under the Apache License 2.0. -// Please see the included NOTICE for copyright information and -// LICENSE for a copy of the license. - -package main - -import ( - "context" - "flag" - "fmt" - "io/ioutil" - "os" - "path/filepath" - - "gopkg.in/yaml.v2" - - "github.com/hashicorp/go-hclog" - "github.com/hashicorp/go-plugin" - "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" - "github.com/jaegertracing/jaeger/proto-gen/storage_v1" - "github.com/timescale/promscale/pkg/jaeger/proxy" - "google.golang.org/grpc" -) - -func main() { - logger := hclog.New(&hclog.LoggerOptions{ - Level: hclog.Warn, - Name: "jaeger-plugin-proxy", - JSONFormat: true, - }) - - var configAddr string - flag.StringVar(&configAddr, "config", "", "Configuration file address") - flag.Parse() - - sanitizedConfigAddr := filepath.Clean(configAddr) - bSlice, err := ioutil.ReadFile(sanitizedConfigAddr) - if err != nil { - logger.Error("Invalid configuration file address, exiting.") - os.Exit(1) - } - - conf := new(proxy.ProxyConfig) - if err = yaml.Unmarshal(bSlice, conf); err != nil { - logger.Error("Unmarshalling configuration file contents", "err", err.Error()) - os.Exit(1) - } - logger.Warn("configuration", "config", fmt.Sprintf("%#v", conf)) - - promscalePlugin, err := proxy.New(*conf, logger) - if err != nil { - logger.Error("could not start jaeger proxy: ", err) - os.Exit(1) - } - - defer func() { - if _, err = promscalePlugin.Close(context.Background(), nil); err != nil { - logger.Error("error closing the proxy plugin", err) - } - }() - - logger.Warn("starting to serve jaeger proxy") - plugin.Serve(&plugin.ServeConfig{ - HandshakeConfig: shared.Handshake, - VersionedPlugins: map[int]plugin.PluginSet{ - 1: map[string]plugin.Plugin{ - shared.StoragePluginIdentifier: &StorageGRPCPlugin{ - proxy: promscalePlugin, - }, - }, - }, - GRPCServer: plugin.DefaultGRPCServer, - }) -} - -// Ensure plugin.GRPCPlugin API match. -var _ plugin.GRPCPlugin = (*StorageGRPCPlugin)(nil) - -// StorageGRPCPlugin is the implementation of plugin.GRPCPlugin. -type StorageGRPCPlugin struct { - plugin.Plugin - // Concrete implementation, This is only used for plugins that are written in Go. - proxy *proxy.Proxy -} - -// GRPCServer implements plugin.GRPCPlugin. It is used by go-plugin to create a grpc plugin server. -func (p *StorageGRPCPlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error { - storage_v1.RegisterSpanReaderPluginServer(s, p.proxy) - storage_v1.RegisterSpanWriterPluginServer(s, p.proxy) - storage_v1.RegisterArchiveSpanReaderPluginServer(s, p.proxy) - storage_v1.RegisterArchiveSpanWriterPluginServer(s, p.proxy) - storage_v1.RegisterPluginCapabilitiesServer(s, p.proxy) - storage_v1.RegisterDependenciesReaderPluginServer(s, p.proxy) - return nil -} - -// GRPCClient implements plugin.GRPCPlugin. It is used by go-plugin to create a grpc plugin client. -func (*StorageGRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) { - p := shared.StorageGRPCPlugin{} - return p.GRPCClient(ctx, broker, c) -} diff --git a/cmd/jaeger-query-proxy/sample-config.yaml b/cmd/jaeger-query-proxy/sample-config.yaml deleted file mode 100644 index 7dc8a476fd..0000000000 --- a/cmd/jaeger-query-proxy/sample-config.yaml +++ /dev/null @@ -1,3 +0,0 @@ -tls: false -grpc-server: localhost:9202 -connection-timeout: 10s diff --git a/docs/tracing.md b/docs/tracing.md index 77deade0a0..d7b402ce53 100644 --- a/docs/tracing.md +++ b/docs/tracing.md @@ -217,62 +217,22 @@ Then, point your browser to [http://127.0.0.1:8080/] and login with username `ad ### Setting up Jaeger UI -In order for the Jaeger UI to show traces stored in Promscale we leverage Jaeger’s support for [gRPC storage plugins](https://github.com/jaegertracing/jaeger/tree/master/plugin/storage/grpc). Our plugin acts as a simple proxy between Jaeger and Promscale. It does not contain any logic. All the processing work is done in the Promscale Connector. +In order for the Jaeger UI to show traces stored in Promscale we leverage Jaeger’s support for [gRPC storage plugins](https://github.com/jaegertracing/jaeger/tree/master/plugin/storage/grpc). -This plugin only implements the APIs for Jaeger to read traces from Promscale. It does not implement the APIs for Jaeger to write traces to Promscale. To send Jaeger traces to Promscale use the OpenTelemetry Collector instead as explained [here](#jaeger-instrumentation). +To enable Jaeger to use the plugin you need to provide jaeger-query with the following: -Jaeger's gRPC plugin system works by executing the binary for the plugin when enabled in the configuration file. For that reason when deploying as a container, Jaeger and the binary need to be on the same container image. And since Jaeger doesn’t package all gRPC storage plugins in its default Docker images, we provide an image that includes the upstream Jaeger Query component (not the rest since they are not needed) and Promscale’s gRPC storage plugin for Jaeger. The image is available on [DockerHub](https://hub.docker.com/r/timescale/jaeger-query-proxy/tags). We recomment using the `latest` image - -To enable Jaeger to use the plugin you need to pass the following parameters: - -* `span-storage.type=grpc-plugin` -* `grpc-storage-plugin.binary=`, pointing to the location of the plugin binary -* `grpc-storage-plugin.configuration-file=`, a path pointing to the plugin's configuration file. +* environment variable `SPAN_STORAGE_TYPE=grpc-plugin` +* flag `grpc-storage.server=:` This is how you would run the container with Docker: ```bash -docker run --name promscale-jaeger -d -p 16686:16686 -v :/configs/jaeger-promscale-query.yaml --network promscale-timescaledb timescale/jaeger-query-proxy:latest -``` -The container already sets the required values for those parameters. - -The Jaeger UI would be accessible on port 16686. - -If you run Jaeger directly on a host, you first need to download the plugin binary for your system. The binaries are available under the assets of the latest 0.7 Promscale release on [Github](https://github.com/timescale/promscale/releases). Then you have to run the binary as follows: - -```bash -./jaeger-query-plugin --span-storage.type=grpc-plugin --grpc-storage-plugin.binary= --grpc-storage-plugin.configuration-file= -``` - -The parameters in the plugin configuration file are the following (only the first is mandatory): - -```yaml -grpc-server: : -#connection-timeout: 5s -#grpc-server-host-override: "" -#cafile: "" -#tls: false +docker run --name jaeger -d -p 16686:16686 -e SPAN_STORAGE_TYPE=grpc-plugin --network promscale-timescaledb jaegertracing/jaeger-query:1.30.0 --grpc-storage.server=: ``` -If you followed the instructions described in this document then otlp-grpc-port will be 9202. For example - -```yaml -grpc-server: localhost:9202 -``` - -If you run on Kubernetes, create a ConfigMap like the one below - -```yaml -​​apiVersion: v1 -kind: ConfigMap -metadata: - name: promscale-jaeger -data: - jaeger-promscale-query.yaml: | - grpc-server: :9202 -``` +If you followed the instructions described in this document then otlp-grpc-port will be 9202. -Then make this ConfigMap available to the promscale-jaeger container through a volumeMount. Read more on how to do that in the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/configmap/#configmaps-and-pods). +The Jaeger UI will be accessible on port 16686. ### Setting up Grafana