Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Telemetery struct for V1 Components Initialization #5695

Merged
merged 35 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
51487a4
Draft Changes to Query using telset
Wise-Wizard Jul 2, 2024
59aa43a
Changed all-in-one code
Wise-Wizard Jul 2, 2024
59111ab
Update pkg/telemetery/settings.go
Wise-Wizard Jul 3, 2024
5ba546b
Made sugessted Changes
Wise-Wizard Jul 3, 2024
1894931
Merge branch 'main' into OTEL/Telemetery
Wise-Wizard Jul 3, 2024
1cfca71
Fix error
Wise-Wizard Jul 3, 2024
5a63b73
Update pkg/telemetery/settings.go
Wise-Wizard Jul 3, 2024
bba59f8
Merge branch 'main' into OTEL/Telemetery
Wise-Wizard Jul 3, 2024
18fdc2d
Refactored telset init in all-in-one
Wise-Wizard Jul 3, 2024
0c933b0
Merge branch 'main' into OTEL/Telemetery
Wise-Wizard Jul 3, 2024
c769b44
Created Healthcheck Adapter
Wise-Wizard Jul 3, 2024
e132adb
Updated ReportStatus to use OTEL's StatusEvent
Wise-Wizard Jul 4, 2024
69876c7
Prototype Impl of Tracer
Wise-Wizard Jul 4, 2024
3ec9594
Added suggested Changes
Wise-Wizard Jul 4, 2024
0002dc6
Changed V2 to accept OTEL's Telset
Wise-Wizard Jul 4, 2024
32d921c
Refactored to accept trace.TracerProvider
Wise-Wizard Jul 5, 2024
57602b5
Merge branch 'main' into OTEL/Telemetery
Wise-Wizard Jul 5, 2024
e5fa271
Temporary fix to failing CI
Wise-Wizard Jul 5, 2024
2396ca5
Made suggested changes
Wise-Wizard Jul 5, 2024
2abe801
Reduced number of ReportStatus calls
Wise-Wizard Jul 5, 2024
ca9950c
Update cmd/query/app/server.go
Wise-Wizard Jul 5, 2024
44638d9
Merge branch 'main' into OTEL/Telemetery
Wise-Wizard Jul 5, 2024
a297feb
Cleaned up COde
Wise-Wizard Jul 5, 2024
6680ea3
Pass telset to struct
Wise-Wizard Jul 5, 2024
bc958c2
Made suggested changes
Wise-Wizard Jul 5, 2024
8654a32
Worked on Test
Wise-Wizard Jul 5, 2024
db18701
Cleaned up Test File
Wise-Wizard Jul 6, 2024
45a1ba3
Fix Linter Errors
Wise-Wizard Jul 6, 2024
65ecbd3
Fix goleak
Wise-Wizard Jul 6, 2024
74403ee
Added Tests
Wise-Wizard Jul 7, 2024
3d9ba04
Ran make lint
Wise-Wizard Jul 7, 2024
160663e
Update cmd/jaeger/internal/extension/jaegerquery/server.go
Wise-Wizard Jul 9, 2024
3de30a1
Merge branch 'main' into OTEL/Telemetery
Wise-Wizard Jul 9, 2024
70d4b10
Fixed Error
Wise-Wizard Jul 9, 2024
25f8d10
Fix nil pointer error
Wise-Wizard Jul 9, 2024
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
6 changes: 5 additions & 1 deletion cmd/all-in-one/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
"github.com/jaegertracing/jaeger/pkg/config"
"github.com/jaegertracing/jaeger/pkg/jtracer"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/pkg/telemetery"
"github.com/jaegertracing/jaeger/pkg/tenancy"
"github.com/jaegertracing/jaeger/pkg/version"
metricsPlugin "github.com/jaegertracing/jaeger/plugin/metrics"
Expand Down Expand Up @@ -279,7 +280,10 @@ func startQuery(
) *queryApp.Server {
spanReader = storageMetrics.NewReadMetricsDecorator(spanReader, metricsFactory)
qs := querysvc.NewQueryService(spanReader, depReader, *queryOpts)
server, err := queryApp.NewServer(svc.Logger, svc.HC(), qs, metricsQueryService, qOpts, tm, jt)
server, err := queryApp.NewServer(telemetery.TelemeterySetting{
Wise-Wizard marked this conversation as resolved.
Show resolved Hide resolved
Logger: svc.Logger,
Tracer: jt,
}, svc.HC(), qs, metricsQueryService, qOpts, tm)
if err != nil {
svc.Logger.Fatal("Could not create jaeger-query", zap.Error(err))
}
Expand Down
7 changes: 5 additions & 2 deletions cmd/jaeger/internal/extension/jaegerquery/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/jaegertracing/jaeger/cmd/query/app/querysvc"
"github.com/jaegertracing/jaeger/pkg/healthcheck"
"github.com/jaegertracing/jaeger/pkg/jtracer"
"github.com/jaegertracing/jaeger/pkg/telemetery"
"github.com/jaegertracing/jaeger/pkg/tenancy"
"github.com/jaegertracing/jaeger/plugin/metrics/disabled"
"github.com/jaegertracing/jaeger/ports"
Expand Down Expand Up @@ -83,14 +84,16 @@ func (s *server) Start(_ context.Context, host component.Host) error {
// TODO contextcheck linter complains about next line that context is not passed. It is not wrong.
//nolint
s.server, err = queryApp.NewServer(
s.logger,
telemetery.TelemeterySetting{
Logger: s.logger,
Tracer: s.jtracer,
},
// TODO propagate healthcheck updates up to the collector's runtime
healthcheck.New(),
qs,
metricsQueryService,
s.makeQueryOptions(),
tm,
s.jtracer,
)
if err != nil {
return fmt.Errorf("could not create jaeger-query: %w", err)
Expand Down
11 changes: 6 additions & 5 deletions cmd/query/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"github.com/jaegertracing/jaeger/pkg/jtracer"
"github.com/jaegertracing/jaeger/pkg/netutils"
"github.com/jaegertracing/jaeger/pkg/recoveryhandler"
"github.com/jaegertracing/jaeger/pkg/telemetery"
"github.com/jaegertracing/jaeger/pkg/tenancy"
"github.com/jaegertracing/jaeger/proto-gen/api_v2"
"github.com/jaegertracing/jaeger/proto-gen/api_v2/metrics"
Expand All @@ -67,7 +68,7 @@ type Server struct {
}

// NewServer creates and initializes Server
func NewServer(logger *zap.Logger, healthCheck *healthcheck.HealthCheck, querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, options *QueryOptions, tm *tenancy.Manager, tracer *jtracer.JTracer) (*Server, error) {
func NewServer(telset telemetery.TelemeterySetting, healthCheck *healthcheck.HealthCheck, querySvc *querysvc.QueryService, metricsQuerySvc querysvc.MetricsQueryService, options *QueryOptions, tm *tenancy.Manager) (*Server, error) {
Wise-Wizard marked this conversation as resolved.
Show resolved Hide resolved
_, httpPort, err := net.SplitHostPort(options.HTTPHostPort)
if err != nil {
return nil, fmt.Errorf("invalid HTTP server host:port: %w", err)
Expand All @@ -81,22 +82,22 @@ func NewServer(logger *zap.Logger, healthCheck *healthcheck.HealthCheck, querySv
return nil, errors.New("server with TLS enabled can not use same host ports for gRPC and HTTP. Use dedicated HTTP and gRPC host ports instead")
}

grpcServer, err := createGRPCServer(querySvc, metricsQuerySvc, options, tm, logger, tracer)
grpcServer, err := createGRPCServer(querySvc, metricsQuerySvc, options, tm, telset.Logger, telset.Tracer)
if err != nil {
return nil, err
}

httpServer, err := createHTTPServer(querySvc, metricsQuerySvc, options, tm, tracer, logger)
httpServer, err := createHTTPServer(querySvc, metricsQuerySvc, options, tm, telset.Tracer, telset.Logger)
if err != nil {
return nil, err
}

return &Server{
logger: logger,
Wise-Wizard marked this conversation as resolved.
Show resolved Hide resolved
logger: telset.Logger,
healthCheck: healthCheck,
querySvc: querySvc,
queryOptions: options,
tracer: tracer,
tracer: telset.Tracer,
grpcServer: grpcServer,
httpServer: httpServer,
separatePorts: grpcPort != httpPort,
Expand Down
7 changes: 5 additions & 2 deletions cmd/query/app/token_propagation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/jaegertracing/jaeger/pkg/config"
"github.com/jaegertracing/jaeger/pkg/jtracer"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/pkg/telemetery"
"github.com/jaegertracing/jaeger/pkg/tenancy"
"github.com/jaegertracing/jaeger/plugin/storage/es"
"github.com/jaegertracing/jaeger/ports"
Expand Down Expand Up @@ -91,7 +92,10 @@ func runQueryService(t *testing.T, esURL string) *Server {
require.NoError(t, err)

querySvc := querysvc.NewQueryService(spanReader, nil, querysvc.QueryServiceOptions{})
server, err := NewServer(flagsSvc.Logger, flagsSvc.HC(), querySvc, nil,
server, err := NewServer(telemetery.TelemeterySetting{
Logger: flagsSvc.Logger,
Tracer: jtracer.NoOp(),
}, flagsSvc.HC(), querySvc, nil,
&QueryOptions{
GRPCHostPort: ":0",
HTTPHostPort: ":0",
Expand All @@ -100,7 +104,6 @@ func runQueryService(t *testing.T, esURL string) *Server {
},
},
tenancy.NewManager(&tenancy.Options{}),
jtracer.NoOp(),
)
require.NoError(t, err)
require.NoError(t, server.Start())
Expand Down
6 changes: 5 additions & 1 deletion cmd/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"github.com/jaegertracing/jaeger/pkg/config"
"github.com/jaegertracing/jaeger/pkg/jtracer"
"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/pkg/telemetery"
"github.com/jaegertracing/jaeger/pkg/tenancy"
"github.com/jaegertracing/jaeger/pkg/version"
metricsPlugin "github.com/jaegertracing/jaeger/plugin/metrics"
Expand Down Expand Up @@ -113,7 +114,10 @@ func main() {
dependencyReader,
*queryServiceOptions)
tm := tenancy.NewManager(&queryOpts.Tenancy)
server, err := app.NewServer(svc.Logger, svc.HC(), queryService, metricsQueryService, queryOpts, tm, jt)
server, err := app.NewServer(telemetery.TelemeterySetting{
Logger: logger,
Tracer: jt,
}, svc.HC(), queryService, metricsQueryService, queryOpts, tm)
if err != nil {
logger.Fatal("Failed to create server", zap.Error(err))
}
Expand Down
13 changes: 13 additions & 0 deletions pkg/telemetery/settings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package telemetery

import (
"github.com/jaegertracing/jaeger/pkg/jtracer"
"go.opentelemetry.io/otel/metric"
"go.uber.org/zap"
)

type TelemeterySetting struct {
Wise-Wizard marked this conversation as resolved.
Show resolved Hide resolved
Logger *zap.Logger
Tracer *jtracer.JTracer
Wise-Wizard marked this conversation as resolved.
Show resolved Hide resolved
MeterProvider metric.MeterProvider
Wise-Wizard marked this conversation as resolved.
Show resolved Hide resolved
}
Loading