Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,32 +93,28 @@ These are general guidelines on how to organize source code in this repository.
```
github.com/jaegertracing/jaeger
cmd/ - All binaries go here
all-in-one/ - Jaeger all-in-one application, designed for quick local testing
jaeger/ - Jaeger V2 binary
collector/ - Component to receive spans (from agents or directly from clients) and saves them in Trace Storage
ingester/ - Component to read spans from Kafka topic and save them to storage
query/ - Component to serve Jaeger UI and an API that retrieves traces from storage
remote-storage/ - Component to enable sharing single-node storage implementations like memstore by implementing Remote Storage API
jaeger/ - The main Jaeger binary (v2) that combines collector, query, and ingester
anonymizer/ - Utility to anonymize traces from Jaeger query and save to file
tracegen/ - Utility to generate a steady flow of simple traces
es-index-cleaner/ - Utility to purge old indices from Elasticsearch
es-rollover/ - Utility to manage Elastic Search indices
esmapping-generator/ - Utility to generate Elasticsearch mapping
remote-storage/ - Component to enable sharing single-node storage implementations via Remote Storage API v2
examples/
grafana-integration/ - Demo application that combine Jaeger, Grafana, Loki, Prometheus to demonstrate logs, metrics and traces correlation
hotrod/ - Demo application that demonstrates the use of tracing instrumentation
grafana-integration/ - Demo application combining Jaeger, Grafana, Loki, Prometheus
hotrod/ - Demo application demonstrating tracing instrumentation
otel-demo/ - Demo application using OpenTelemetry Collector and Jaeger
docker-compose/ - Docker-compose recipes to simulate different Jaeger deployments
kafka/ - Jaeger depoyment utilizing collector-Kafka-injester pipeline
monitor/ - Service Performance Monitoring (SPM) Development/Demo Environment
idl/ - (submodule) https://github.com/jaegertracing/jaeger-idl
jaeger-ui/ - (submodule) https://github.com/jaegertracing/jaeger-ui
internal/ - Internal modules that make up Jaeger
storage/ - Define and implement Trace/Metrics Storage interface
metricstore/ - Define and implement Metrics Storage interface
prometheus/ - Prometheus implementation of Metrics Storage
v1/ - V1 Trace Storage interfaces and implementations
memory/ - In-memory implementation
elasticsearch/ - ElasticSearch implementation
v2/ - V2 Trace Storage interfaces and implementation
storage/ - Trace/Metrics Storage interfaces and implementations
metricstore/ - Metrics Storage interface and implementations (e.g. Prometheus, Elasticsearch)
v1/ - Trace Storage v1 interfaces and implementations (Cassandra, Elasticsearch, Badger, etc.)
v2/ - Trace Storage v2 interfaces and implementations (gRPC, ClickHouse, etc.)
monitoring/ - Jaeger monitoring assets (e.g. jaeger-mixin)
ports/ - Centralized port definitions
scripts/ - Miscellaneous project scripts, e.g. github action and license update script
go.mod - Go module file to track dependencies
Makefile - Define various recipes to automate build, test, and deployment tasks
Expand Down
31 changes: 3 additions & 28 deletions cmd/remote-storage/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ import (
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/reflection"

"github.com/jaegertracing/jaeger/internal/auth/bearertoken"
"github.com/jaegertracing/jaeger/internal/storage/v1/api/dependencystore"
"github.com/jaegertracing/jaeger/internal/storage/v1/api/spanstore"
"github.com/jaegertracing/jaeger/internal/storage/v1/grpc/shared"
"github.com/jaegertracing/jaeger/internal/storage/v2/api/depstore"
"github.com/jaegertracing/jaeger/internal/storage/v2/api/tracestore"
grpcstorage "github.com/jaegertracing/jaeger/internal/storage/v2/grpc"
"github.com/jaegertracing/jaeger/internal/storage/v2/v1adapter"
"github.com/jaegertracing/jaeger/internal/telemetry"
"github.com/jaegertracing/jaeger/internal/tenancy"
)
Expand Down Expand Up @@ -65,14 +62,9 @@ func NewServer(
// If the config is created manually (e.g. in tests), the transport might not be set.
grpcCfg.NetAddr.Transport = confignet.TransportTypeTCP

handler, err := createGRPCHandler(reader, writer, depReader)
if err != nil {
return nil, err
}

v2Handler := grpcstorage.NewHandler(reader, writer, depReader)

grpcServer, err := createGRPCServer(ctx, grpcCfg, tm, handler, v2Handler, telset)
grpcServer, err := createGRPCServer(ctx, grpcCfg, tm, v2Handler, telset)
if err != nil {
return nil, err
}
Expand All @@ -84,27 +76,10 @@ func NewServer(
}, nil
}

func createGRPCHandler(
reader tracestore.Reader,
writer tracestore.Writer,
depReader depstore.Reader,
) (*shared.GRPCHandler, error) {
impl := &shared.GRPCHandlerStorageImpl{
SpanReader: func() spanstore.Reader { return v1adapter.GetV1Reader(reader) },
SpanWriter: func() spanstore.Writer { return v1adapter.GetV1Writer(writer) },
DependencyReader: func() dependencystore.Reader { return v1adapter.GetV1DependencyReader(depReader) },
StreamingSpanWriter: func() spanstore.Writer { return nil },
}

handler := shared.NewGRPCHandler(impl)
return handler, nil
}

func createGRPCServer(
ctx context.Context,
cfg configgrpc.ServerConfig,
tm *tenancy.Manager,
handler *shared.GRPCHandler,
v2Handler *grpcstorage.Handler,
telset telemetry.Settings,
) (*grpc.Server, error) {
Expand Down Expand Up @@ -137,8 +112,8 @@ func createGRPCServer(
healthServer := health.NewServer()
reflection.Register(server)

handler.Register(server, healthServer)
v2Handler.Register(server, healthServer)
grpc_health_v1.RegisterHealthServer(server, healthServer)

return server, nil
}
Expand Down
56 changes: 11 additions & 45 deletions cmd/remote-storage/app/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ import (
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"

"github.com/jaegertracing/jaeger-idl/model/v1"
"github.com/jaegertracing/jaeger/cmd/internal/flags"
"github.com/jaegertracing/jaeger/internal/grpctest"
"github.com/jaegertracing/jaeger/internal/healthcheck"
"github.com/jaegertracing/jaeger/internal/proto-gen/storage_v1"
"github.com/jaegertracing/jaeger/internal/proto-gen/storage/v2"
"github.com/jaegertracing/jaeger/internal/storage/v1/api/spanstore"
"github.com/jaegertracing/jaeger/internal/storage/v2/api/depstore"
depstoremocks "github.com/jaegertracing/jaeger/internal/storage/v2/api/depstore/mocks"
"github.com/jaegertracing/jaeger/internal/storage/v2/api/tracestore"
tracestoremocks "github.com/jaegertracing/jaeger/internal/storage/v2/api/tracestore/mocks"
"github.com/jaegertracing/jaeger/internal/telemetry"
Expand Down Expand Up @@ -149,39 +147,6 @@ func TestNewServer_TLSConfigError(t *testing.T) {
assert.ErrorContains(t, err, "failed to load TLS config")
}

func TestCreateGRPCHandler(t *testing.T) {
reader := new(tracestoremocks.Reader)
writer := new(tracestoremocks.Writer)
depReader := new(depstoremocks.Reader)

h, err := createGRPCHandler(reader, writer, depReader)
require.NoError(t, err)

writer.On("WriteTraces", mock.Anything, mock.Anything).Return(errors.New("writer error"))
_, err = h.WriteSpan(context.Background(), &storage_v1.WriteSpanRequest{
Span: &model.Span{
TraceID: model.NewTraceID(1, 1),
SpanID: model.NewSpanID(1),
Process: &model.Process{
ServiceName: "test",
},
},
})
require.ErrorContains(t, err, "writer error")

depReader.On(
"GetDependencies",
mock.Anything, // context
mock.Anything, // time
mock.Anything, // lookback
).Return(nil, errors.New("deps error"))
_, err = h.GetDependencies(context.Background(), &storage_v1.GetDependenciesRequest{})
require.ErrorContains(t, err, "deps error")

err = h.WriteSpanStream(nil)
assert.ErrorContains(t, err, "not implemented")
}

var testCases = []struct {
name string
TLS *configtls.ServerConfig
Expand Down Expand Up @@ -315,7 +280,7 @@ var testCases = []struct {
}

type grpcClient struct {
storage_v1.SpanReaderPluginClient
storage.TraceReaderClient

conn *grpc.ClientConn
}
Expand All @@ -333,8 +298,8 @@ func newGRPCClient(t *testing.T, addr string, creds credentials.TransportCredent
require.NoError(t, err)

return &grpcClient{
SpanReaderPluginClient: storage_v1.NewSpanReaderPluginClient(conn),
conn: conn,
TraceReaderClient: storage.NewTraceReaderClient(conn),
conn: conn,
}
}

Expand Down Expand Up @@ -392,7 +357,7 @@ func TestServerGRPCTLS(t *testing.T) {
defer cancel()

ctx = tenancy.WithTenant(ctx, "foo")
res, clientError := client.GetServices(ctx, &storage_v1.GetServicesRequest{})
res, clientError := client.GetServices(ctx, &storage.GetServicesRequest{})

if test.expectClientError {
require.Error(t, clientError)
Expand Down Expand Up @@ -445,11 +410,12 @@ func validateGRPCServer(t *testing.T, hostPort string) {
grpctest.ReflectionServiceValidator{
HostPort: hostPort,
ExpectedServices: []string{
"jaeger.storage.v1.SpanReaderPlugin",
"jaeger.storage.v1.SpanWriterPlugin",
"jaeger.storage.v1.DependenciesReaderPlugin",
"jaeger.storage.v1.PluginCapabilities",
"jaeger.storage.v1.StreamingSpanWriterPlugin",
// writer
"opentelemetry.proto.collector.trace.v1.TraceService",
// reader
"jaeger.storage.v2.TraceReader",
"jaeger.storage.v2.DependencyReader",
// health
"grpc.health.v1.Health",
},
}.Execute(t)
Expand Down
135 changes: 0 additions & 135 deletions internal/storage/v1/grpc/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions internal/storage/v1/grpc/config.go

This file was deleted.

Loading