diff --git a/cmd/opentelemetry/app/exporter/elasticsearchexporter/exporter.go b/cmd/opentelemetry/app/exporter/elasticsearchexporter/exporter.go index 1e837e66a19..4fe80eaf75c 100644 --- a/cmd/opentelemetry/app/exporter/elasticsearchexporter/exporter.go +++ b/cmd/opentelemetry/app/exporter/elasticsearchexporter/exporter.go @@ -26,7 +26,7 @@ import ( // new creates Elasticsearch exporter/storage. func new(ctx context.Context, config *Config, params component.ExporterCreateParams) (component.TraceExporter, error) { esCfg := config.GetPrimary() - w, err := newEsSpanWriter(*esCfg, params.Logger) + w, err := newEsSpanWriter(*esCfg, params.Logger, config.Name()) if err != nil { return nil, err } diff --git a/cmd/opentelemetry/app/exporter/elasticsearchexporter/integration_test.go b/cmd/opentelemetry/app/exporter/elasticsearchexporter/integration_test.go index c522369ea97..2b174f21e5c 100644 --- a/cmd/opentelemetry/app/exporter/elasticsearchexporter/integration_test.go +++ b/cmd/opentelemetry/app/exporter/elasticsearchexporter/integration_test.go @@ -129,7 +129,7 @@ func (s *IntegrationTest) initSpanstore(allTagsAsFields bool) error { AllAsFields: allTagsAsFields, }, } - w, err := newEsSpanWriter(cfg, s.logger) + w, err := newEsSpanWriter(cfg, s.logger, "elasticsearch") if err != nil { return err } diff --git a/cmd/opentelemetry/app/exporter/elasticsearchexporter/spanstore.go b/cmd/opentelemetry/app/exporter/elasticsearchexporter/spanstore.go index 3d24afc403d..7bceea1b748 100644 --- a/cmd/opentelemetry/app/exporter/elasticsearchexporter/spanstore.go +++ b/cmd/opentelemetry/app/exporter/elasticsearchexporter/spanstore.go @@ -23,12 +23,15 @@ import ( "strings" "time" + "go.opencensus.io/stats" + "go.opencensus.io/tag" "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/consumer/pdata" "go.uber.org/zap" "github.com/jaegertracing/jaeger/cmd/opentelemetry/app/exporter/elasticsearchexporter/esmodeltranslator" + "github.com/jaegertracing/jaeger/cmd/opentelemetry/app/exporter/storagemetrics" "github.com/jaegertracing/jaeger/cmd/opentelemetry/app/internal/esclient" "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/pkg/cache" @@ -47,6 +50,7 @@ const ( // esSpanWriter holds components required for ES span writer type esSpanWriter struct { logger *zap.Logger + nameTag tag.Mutator client esclient.ElasticsearchClient serviceCache cache.Cache spanIndexName indexNameProvider @@ -55,7 +59,7 @@ type esSpanWriter struct { } // newEsSpanWriter creates new instance of esSpanWriter -func newEsSpanWriter(params config.Configuration, logger *zap.Logger) (*esSpanWriter, error) { +func newEsSpanWriter(params config.Configuration, logger *zap.Logger, name string) (*esSpanWriter, error) { client, err := esclient.NewElasticsearchClient(params, logger) if err != nil { return nil, err @@ -65,6 +69,8 @@ func newEsSpanWriter(params config.Configuration, logger *zap.Logger) (*esSpanWr return nil, err } return &esSpanWriter{ + logger: logger, + nameTag: tag.Insert(storagemetrics.TagExporterName(), name), client: client, spanIndexName: newIndexNameProvider(spanIndexBaseName, params.IndexPrefix, params.UseReadWriteAliases), serviceIndexName: newIndexNameProvider(serviceIndexBaseName, params.IndexPrefix, params.UseReadWriteAliases), @@ -159,14 +165,17 @@ func (w *esSpanWriter) writeSpans(ctx context.Context, spans []*dbmodel.Span) (i errs = append(errs, err) return len(spans), componenterror.CombineErrors(errs) } - droppedFromResponse := w.handleResponse(res, bulkOperations) + droppedFromResponse := w.handleResponse(ctx, res, bulkOperations) dropped += droppedFromResponse return dropped, componenterror.CombineErrors(errs) } -func (w *esSpanWriter) handleResponse(blk *esclient.BulkResponse, operationToSpan []bulkItem) int { +func (w *esSpanWriter) handleResponse(ctx context.Context, blk *esclient.BulkResponse, operationToSpan []bulkItem) int { numErrors := 0 + storedSpans := map[string]int64{} + notStoredSpans := map[string]int64{} for i, d := range blk.Items { + bulkOp := operationToSpan[i] if d.Index.Status > 201 { numErrors++ w.logger.Error("Part of the bulk request failed", @@ -177,15 +186,29 @@ func (w *esSpanWriter) handleResponse(blk *esclient.BulkResponse, operationToSpa zap.String("error.cause.reason", d.Index.Error.Cause.Reason)) // TODO return an error or a struct that indicates which spans should be retried // https://github.com/open-telemetry/opentelemetry-collector/issues/990 + if !bulkOp.isService { + notStoredSpans[bulkOp.span.Process.ServiceName] = notStoredSpans[bulkOp.span.Process.ServiceName] + 1 + } } else { // passed - bulkOp := operationToSpan[i] - if bulkOp.isService { + if !bulkOp.isService { + storedSpans[bulkOp.span.Process.ServiceName] = storedSpans[bulkOp.span.Process.ServiceName] + 1 + } else { cacheKey := hashCode(bulkOp.span.Process.ServiceName, bulkOp.span.OperationName) w.serviceCache.Put(cacheKey, cacheKey) } } } + for k, v := range notStoredSpans { + ctx, _ := tag.New(ctx, + tag.Insert(storagemetrics.TagServiceName(), k), w.nameTag) + stats.Record(ctx, storagemetrics.StatSpansNotStoredCount().M(v)) + } + for k, v := range storedSpans { + ctx, _ := tag.New(ctx, + tag.Insert(storagemetrics.TagServiceName(), k), w.nameTag) + stats.Record(ctx, storagemetrics.StatSpansStoredCount().M(v)) + } return numErrors } diff --git a/cmd/opentelemetry/app/exporter/elasticsearchexporter/spanstore_test.go b/cmd/opentelemetry/app/exporter/elasticsearchexporter/spanstore_test.go new file mode 100644 index 00000000000..4013c65945a --- /dev/null +++ b/cmd/opentelemetry/app/exporter/elasticsearchexporter/spanstore_test.go @@ -0,0 +1,67 @@ +// Copyright (c) 2020 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package elasticsearchexporter + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opencensus.io/stats/view" + "go.uber.org/zap" + + "github.com/jaegertracing/jaeger/cmd/opentelemetry/app/exporter/storagemetrics" + "github.com/jaegertracing/jaeger/cmd/opentelemetry/app/internal/esclient" + "github.com/jaegertracing/jaeger/pkg/es/config" + "github.com/jaegertracing/jaeger/plugin/storage/es/spanstore/dbmodel" +) + +func TestMetrics(t *testing.T) { + w, err := newEsSpanWriter(config.Configuration{Servers: []string{"localhost:9200"}, Version: 6}, zap.NewNop(), "elasticsearch") + require.NoError(t, err) + response := &esclient.BulkResponse{} + response.Items = []esclient.BulkResponseItem{ + {Index: esclient.BulkIndexResponse{Status: 200}}, + {Index: esclient.BulkIndexResponse{Status: 500}}, + {Index: esclient.BulkIndexResponse{Status: 200}}, + {Index: esclient.BulkIndexResponse{Status: 500}}, + } + blkItms := []bulkItem{ + {isService: true, span: &dbmodel.Span{}}, + {isService: true, span: &dbmodel.Span{}}, + {span: &dbmodel.Span{Process: dbmodel.Process{ServiceName: "foo"}}}, + {span: &dbmodel.Span{Process: dbmodel.Process{ServiceName: "foo"}}}, + } + + views := storagemetrics.MetricViews() + require.NoError(t, view.Register(views...)) + defer view.Unregister(views...) + + errs := w.handleResponse(context.Background(), response, blkItms) + assert.Equal(t, 2, errs) + + viewData, err := view.RetrieveData(storagemetrics.StatSpansStoredCount().Name()) + require.NoError(t, err) + require.Equal(t, 1, len(viewData)) + distData := viewData[0].Data.(*view.SumData) + assert.Equal(t, float64(1), distData.Value) + + viewData, err = view.RetrieveData(storagemetrics.StatSpansNotStoredCount().Name()) + require.NoError(t, err) + require.Equal(t, 1, len(viewData)) + distData = viewData[0].Data.(*view.SumData) + assert.Equal(t, float64(1), distData.Value) +} diff --git a/cmd/opentelemetry/app/exporter/span_writer_exporter.go b/cmd/opentelemetry/app/exporter/span_writer_exporter.go index edb78031530..ab0c885d776 100644 --- a/cmd/opentelemetry/app/exporter/span_writer_exporter.go +++ b/cmd/opentelemetry/app/exporter/span_writer_exporter.go @@ -16,8 +16,9 @@ package exporter import ( "context" - "io" + "go.opencensus.io/stats" + "go.opencensus.io/tag" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenterror" "go.opentelemetry.io/collector/config/configmodels" @@ -26,6 +27,7 @@ import ( "go.opentelemetry.io/collector/exporter/exporterhelper" jaegertranslator "go.opentelemetry.io/collector/translator/trace/jaeger" + "github.com/jaegertracing/jaeger/cmd/opentelemetry/app/exporter/storagemetrics" "github.com/jaegertracing/jaeger/storage" "github.com/jaegertracing/jaeger/storage/spanstore" ) @@ -36,13 +38,7 @@ func NewSpanWriterExporter(config configmodels.Exporter, factory storage.Factory if err != nil { return nil, err } - storage := store{Writer: spanWriter} - opts = append(opts, exporterhelper.WithShutdown(func(ctx context.Context) error { - if closer, ok := spanWriter.(io.Closer); ok { - return closer.Close() - } - return nil - })) + storage := store{Writer: spanWriter, storageNameTag: tag.Insert(storagemetrics.TagExporterName(), config.Name())} return exporterhelper.NewTraceExporter( config, storage.traceDataPusher, @@ -50,7 +46,8 @@ func NewSpanWriterExporter(config configmodels.Exporter, factory storage.Factory } type store struct { - Writer spanstore.Writer + Writer spanstore.Writer + storageNameTag tag.Mutator } // traceDataPusher implements OTEL exporterhelper.traceDataPusher @@ -61,6 +58,8 @@ func (s *store) traceDataPusher(ctx context.Context, td pdata.Traces) (droppedSp } dropped := 0 var errs []error + storedSpans := map[string]int64{} + notStoredSpans := map[string]int64{} for _, batch := range batches { for _, span := range batch.Spans { span.Process = batch.Process @@ -68,8 +67,21 @@ func (s *store) traceDataPusher(ctx context.Context, td pdata.Traces) (droppedSp if err != nil { errs = append(errs, err) dropped++ + notStoredSpans[span.Process.ServiceName] = notStoredSpans[span.Process.ServiceName] + 1 + } else { + storedSpans[span.Process.ServiceName] = storedSpans[span.Process.ServiceName] + 1 } } } + for k, v := range notStoredSpans { + ctx, _ := tag.New(ctx, + tag.Insert(storagemetrics.TagServiceName(), k), s.storageNameTag) + stats.Record(ctx, storagemetrics.StatSpansNotStoredCount().M(v)) + } + for k, v := range storedSpans { + ctx, _ := tag.New(ctx, + tag.Insert(storagemetrics.TagServiceName(), k), s.storageNameTag) + stats.Record(ctx, storagemetrics.StatSpansStoredCount().M(v)) + } return dropped, componenterror.CombineErrors(errs) } diff --git a/cmd/opentelemetry/app/exporter/span_writer_exporter_test.go b/cmd/opentelemetry/app/exporter/span_writer_exporter_test.go index 72b9e7d4991..c8aeca7ea58 100644 --- a/cmd/opentelemetry/app/exporter/span_writer_exporter_test.go +++ b/cmd/opentelemetry/app/exporter/span_writer_exporter_test.go @@ -22,10 +22,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/uber/jaeger-lib/metrics" + "go.opencensus.io/stats/view" + "go.opencensus.io/tag" "go.opentelemetry.io/collector/config/configmodels" "go.opentelemetry.io/collector/consumer/pdata" "go.uber.org/zap" + "github.com/jaegertracing/jaeger/cmd/opentelemetry/app/exporter/storagemetrics" "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/storage/dependencystore" "github.com/jaegertracing/jaeger/storage/spanstore" @@ -74,42 +77,51 @@ func TestStore(t *testing.T) { traceID := []byte("0123456789abcdef") spanID := []byte("01234567") tests := []struct { - storage store - data pdata.Traces - err string - dropped int - caption string + storage store + data pdata.Traces + err string + dropped int + caption string + metricStored float64 + metricNotStored float64 }{ { caption: "nothing to store", - storage: store{Writer: spanWriter{}}, + storage: store{Writer: spanWriter{}, storageNameTag: tag.Insert(storagemetrics.TagExporterName(), "memory")}, data: traces(), dropped: 0, }, { caption: "wrong data", - storage: store{Writer: spanWriter{}}, + storage: store{Writer: spanWriter{}, storageNameTag: tag.Insert(storagemetrics.TagExporterName(), "memory")}, data: AddSpan(traces(), "", nil, nil), err: "TraceID is nil", dropped: 1, }, { - caption: "one error in writer", - storage: store{Writer: spanWriter{err: errors.New("could not store")}}, - data: AddSpan(AddSpan(traces(), "error", traceID, spanID), "", traceID, spanID), - dropped: 1, - err: "could not store", + caption: "one error in writer", + storage: store{Writer: spanWriter{err: errors.New("could not store")}, storageNameTag: tag.Insert(storagemetrics.TagExporterName(), "memory")}, + data: AddSpan(AddSpan(traces(), "error", traceID, spanID), "", traceID, spanID), + dropped: 1, + err: "could not store", + metricNotStored: 1, + metricStored: 1, }, { - caption: "two errors in writer", - storage: store{Writer: spanWriter{err: errors.New("could not store")}}, - data: AddSpan(AddSpan(traces(), "error", traceID, spanID), "error", traceID, spanID), - dropped: 2, - err: "[could not store; could not store]", + caption: "two errors in writer", + storage: store{Writer: spanWriter{err: errors.New("could not store")}, storageNameTag: tag.Insert(storagemetrics.TagExporterName(), "memory")}, + data: AddSpan(AddSpan(traces(), "error", traceID, spanID), "error", traceID, spanID), + dropped: 2, + err: "[could not store; could not store]", + metricNotStored: 2, }, } for _, test := range tests { t.Run(test.caption, func(t *testing.T) { + views := storagemetrics.MetricViews() + require.NoError(t, view.Register(views...)) + defer view.Unregister(views...) + dropped, err := test.storage.traceDataPusher(context.Background(), test.data) assert.Equal(t, test.dropped, dropped) if test.err != "" { @@ -117,6 +129,21 @@ func TestStore(t *testing.T) { } else { require.NoError(t, err) } + + if test.metricStored > 0 { + viewData, err := view.RetrieveData(storagemetrics.StatSpansStoredCount().Name()) + require.NoError(t, err) + require.Equal(t, 1, len(viewData)) + distData := viewData[0].Data.(*view.SumData) + assert.Equal(t, test.metricStored, distData.Value) + } + if test.metricNotStored > 0 { + viewData, err := view.RetrieveData(storagemetrics.StatSpansNotStoredCount().Name()) + require.NoError(t, err) + require.Equal(t, 1, len(viewData)) + distData := viewData[0].Data.(*view.SumData) + assert.Equal(t, test.metricNotStored, distData.Value) + } }) } } diff --git a/cmd/opentelemetry/app/exporter/storagemetrics/metrics.go b/cmd/opentelemetry/app/exporter/storagemetrics/metrics.go new file mode 100644 index 00000000000..172989f4259 --- /dev/null +++ b/cmd/opentelemetry/app/exporter/storagemetrics/metrics.go @@ -0,0 +1,74 @@ +// Copyright (c) 2020 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package storagemetrics + +import ( + "go.opencensus.io/stats" + "go.opencensus.io/stats/view" + "go.opencensus.io/tag" +) + +var ( + tagServiceName = tag.MustNewKey("service") + tagExporter = tag.MustNewKey("exporter") + + statSpanStoredCount = stats.Int64("storage_exporter_stored_spans", "Number of stored spans", stats.UnitDimensionless) + statSpanNotStoredCount = stats.Int64("storage_exporter_not_stored_spans", "Number of spans that failed to be stored", stats.UnitDimensionless) +) + +// MetricViews returns the metrics views related to storage. +func MetricViews() []*view.View { + tags := []tag.Key{tagServiceName, tagExporter} + + countSpanStoredView := &view.View{ + Name: statSpanStoredCount.Name(), + Measure: statSpanStoredCount, + Description: statSpanStoredCount.Description(), + TagKeys: tags, + Aggregation: view.Sum(), + } + countSpanNotStoredView := &view.View{ + Name: statSpanNotStoredCount.Name(), + Measure: statSpanNotStoredCount, + Description: statSpanNotStoredCount.Description(), + TagKeys: tags, + Aggregation: view.Sum(), + } + + return []*view.View{ + countSpanStoredView, + countSpanNotStoredView, + } +} + +// TagServiceName returns spans's service name tag. +func TagServiceName() tag.Key { + return tagServiceName +} + +// TagExporterName returns exporter name tag. +func TagExporterName() tag.Key { + return tagExporter +} + +// StatSpansStoredCount returns counter for spans that were successfully stored. +func StatSpansStoredCount() *stats.Int64Measure { + return statSpanStoredCount +} + +// StatSpansNotStoredCount returns counter for spans that failed to be stored. +func StatSpansNotStoredCount() *stats.Int64Measure { + return statSpanNotStoredCount +} diff --git a/cmd/opentelemetry/app/exporter/storagemetrics/metrics_test.go b/cmd/opentelemetry/app/exporter/storagemetrics/metrics_test.go new file mode 100644 index 00000000000..1bdf60aaf0a --- /dev/null +++ b/cmd/opentelemetry/app/exporter/storagemetrics/metrics_test.go @@ -0,0 +1,34 @@ +// Copyright (c) 2020 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package storagemetrics + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestMetrics(t *testing.T) { + metricViews := MetricViews() + require.Equal(t, 2, len(metricViews)) + viewNames := []string{ + "storage_exporter_stored_spans", + "storage_exporter_not_stored_spans", + } + for i, viewName := range viewNames { + assert.Equal(t, viewName, metricViews[i].Name) + } +} diff --git a/cmd/opentelemetry/app/internal/esclient/client.go b/cmd/opentelemetry/app/internal/esclient/client.go index bcc3a3f737a..148d1400381 100644 --- a/cmd/opentelemetry/app/internal/esclient/client.go +++ b/cmd/opentelemetry/app/internal/esclient/client.go @@ -53,22 +53,28 @@ type ElasticsearchClient interface { // BulkResponse is a response returned by Elasticsearch Bulk API type BulkResponse struct { - Errors bool `json:"errors"` - Items []struct { - Index struct { - ID string `json:"_id"` - Result string `json:"result"` - Status int `json:"status"` - Error struct { - Type string `json:"type"` - Reason string `json:"reason"` - Cause struct { - Type string `json:"type"` - Reason string `json:"reason"` - } `json:"caused_by"` - } `json:"error"` - } `json:"index"` - } `json:"items"` + Errors bool `json:"errors"` + Items []BulkResponseItem `json:"items"` +} + +// BulkResponseItem is a single response from BulkResponse +type BulkResponseItem struct { + Index BulkIndexResponse `json:"index"` +} + +// BulkIndexResponse is a bulk response for index action +type BulkIndexResponse struct { + ID string `json:"_id"` + Result string `json:"result"` + Status int `json:"status"` + Error struct { + Type string `json:"type"` + Reason string `json:"reason"` + Cause struct { + Type string `json:"type"` + Reason string `json:"reason"` + } `json:"caused_by"` + } `json:"error"` } // SearchBody defines search request. diff --git a/cmd/opentelemetry/app/telemetry.go b/cmd/opentelemetry/app/telemetry.go new file mode 100644 index 00000000000..5d6894f44b7 --- /dev/null +++ b/cmd/opentelemetry/app/telemetry.go @@ -0,0 +1,30 @@ +// Copyright (c) 2020 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package app + +import ( + "go.opencensus.io/stats/view" + + "github.com/jaegertracing/jaeger/cmd/opentelemetry/app/exporter/storagemetrics" +) + +// RegisterMetricViews registers metric views. +func RegisterMetricViews() error { + views := storagemetrics.MetricViews() + if err := view.Register(views...); err != nil { + return err + } + return nil +} diff --git a/cmd/opentelemetry/cmd/agent/main.go b/cmd/opentelemetry/cmd/agent/main.go index 72b2a04d688..60763e06a60 100644 --- a/cmd/opentelemetry/cmd/agent/main.go +++ b/cmd/opentelemetry/cmd/agent/main.go @@ -40,6 +40,10 @@ func main() { } } + if err := app.RegisterMetricViews(); err != nil { + handleErr(err) + } + ver := version.Get() info := service.ApplicationStartInfo{ ExeName: "jaeger-opentelemetry-agent", diff --git a/cmd/opentelemetry/cmd/all-in-one/main.go b/cmd/opentelemetry/cmd/all-in-one/main.go index c272af6b975..ee370c1a0c0 100644 --- a/cmd/opentelemetry/cmd/all-in-one/main.go +++ b/cmd/opentelemetry/cmd/all-in-one/main.go @@ -61,6 +61,10 @@ func main() { } } + if err := app.RegisterMetricViews(); err != nil { + handleErr(err) + } + ver := version.Get() info := service.ApplicationStartInfo{ ExeName: "jaeger-opentelemetry-all-in-one", diff --git a/cmd/opentelemetry/cmd/collector/main.go b/cmd/opentelemetry/cmd/collector/main.go index 3200b7fddf6..6869a3b5acc 100644 --- a/cmd/opentelemetry/cmd/collector/main.go +++ b/cmd/opentelemetry/cmd/collector/main.go @@ -42,6 +42,10 @@ func main() { } } + if err := app.RegisterMetricViews(); err != nil { + handleErr(err) + } + ver := version.Get() info := service.ApplicationStartInfo{ ExeName: "jaeger-opentelemetry-collector", diff --git a/cmd/opentelemetry/cmd/ingester/main.go b/cmd/opentelemetry/cmd/ingester/main.go index bc66854ca04..76dcd5eac64 100644 --- a/cmd/opentelemetry/cmd/ingester/main.go +++ b/cmd/opentelemetry/cmd/ingester/main.go @@ -42,6 +42,10 @@ func main() { } } + if err := app.RegisterMetricViews(); err != nil { + handleErr(err) + } + ver := version.Get() info := service.ApplicationStartInfo{ ExeName: "jaeger-opentelemetry-ingester", diff --git a/cmd/opentelemetry/go.mod b/cmd/opentelemetry/go.mod index d435d398c40..1a59bcabc8b 100644 --- a/cmd/opentelemetry/go.mod +++ b/cmd/opentelemetry/go.mod @@ -18,6 +18,7 @@ require ( github.com/stretchr/testify v1.6.1 github.com/uber/jaeger-client-go v2.23.1+incompatible github.com/uber/jaeger-lib v2.2.0+incompatible + go.opencensus.io v0.22.4 go.opentelemetry.io/collector v0.8.1-0.20200820012544-1e65674799c8 - go.uber.org/zap v1.15.0 + go.uber.org/zap v1.16.0 ) diff --git a/cmd/opentelemetry/go.sum b/cmd/opentelemetry/go.sum index 54a38da1e1e..82026f37ff2 100644 --- a/cmd/opentelemetry/go.sum +++ b/cmd/opentelemetry/go.sum @@ -1122,7 +1122,6 @@ go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= @@ -1132,6 +1131,8 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=