Skip to content

Commit

Permalink
Add TLS support to vulture
Browse files Browse the repository at this point in the history
Signed-off-by: Zach Leslie <zach.leslie@grafana.com>
  • Loading branch information
zalegrala committed Nov 29, 2022
1 parent b71450d commit b27125b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -84,6 +84,7 @@ query_frontend:
* [ENHACEMENT] Update OTel collector to v0.57.2 [#1757](https://github.com/grafana/tempo/pull/1757) (@mapno)
* [ENHANCEMENT] Vulture now has improved distribution of the random traces it searches. [#1763](https://github.com/grafana/tempo/pull/1763) (@rfratto)
* [ENHANCEMENT] Upgrade opentelemetry-proto submodule to v0.18.0 [#1754](https://github.com/grafana/tempo/pull/1754) (@mapno)
* [ENHANCEMENT] Add TLS support to the vulture [#???](https://github.com/grafana/tempo/pull/???) (@zalegrala)
Internal types are updated to use `scope` instead of `instrumentation_library`. This is a breaking change in trace by ID queries if JSON is requested.
* [BUGFIX] New wal file separator '+' for the NTFS filesystem and backward compatibility with the old separator ':' [#1700](https://github.com/grafana/tempo/pull/1700) (@kilian-kier)
* [ENHANCEMENT] metrics-generator: extract `status_message` field from spans [#1786](https://github.com/grafana/tempo/pull/1786), [#1794](https://github.com/grafana/tempo/pull/1794) (@stoewer)
Expand Down
20 changes: 19 additions & 1 deletion cmd/tempo-vulture/main.go
Expand Up @@ -2,6 +2,7 @@ package main

import (
"bytes"
"crypto/tls"
"flag"
"fmt"
"log"
Expand All @@ -19,6 +20,7 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"

"github.com/grafana/tempo/pkg/model/trace"
Expand All @@ -38,6 +40,7 @@ var (
tempoReadBackoffDuration time.Duration
tempoSearchBackoffDuration time.Duration
tempoRetentionDuration time.Duration
tempoTLS bool

logger *zap.Logger
)
Expand All @@ -64,6 +67,7 @@ func init() {
flag.DurationVar(&tempoReadBackoffDuration, "tempo-read-backoff-duration", 30*time.Second, "The amount of time to pause between read Tempo calls")
flag.DurationVar(&tempoSearchBackoffDuration, "tempo-search-backoff-duration", 60*time.Second, "The amount of time to pause between search Tempo calls. Set to 0s to disable search.")
flag.DurationVar(&tempoRetentionDuration, "tempo-retention-duration", 336*time.Hour, "The block retention that Tempo is using")
flag.BoolVar(&tempoTLS, "tempo-tls", false, "Whether to use TLS when connecting to Tempo")
}

func main() {
Expand Down Expand Up @@ -278,8 +282,22 @@ func newJaegerGRPCClient(endpoint string) (*jaeger_grpc.Reporter, error) {
zap.String("endpoint", fmt.Sprintf("%s:14250", u.Host)),
)

var dialOpts []grpc.DialOption

if tempoTLS {
dialOpts = []grpc.DialOption{
grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{
InsecureSkipVerify: true,
})),
}
} else {
dialOpts = []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
}
}

// new jaeger grpc exporter
conn, err := grpc.Dial(u.Host+":14250", grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.Dial(u.Host+":14250", dialOpts...)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit b27125b

Please sign in to comment.