From 6aec8a7edd4e93ae206e4896174656110fdbf3e4 Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Thu, 14 Jul 2022 19:27:10 +0200 Subject: [PATCH 1/5] metrics-generator: include messaging systems and databases in service graphs --- .../processor/servicegraphs/servicegraphs.go | 25 +++++++++++++++++-- .../processor/servicegraphs/store/edge.go | 9 +++++++ .../processor/servicegraphs/store/store.go | 12 ++++++--- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/modules/generator/processor/servicegraphs/servicegraphs.go b/modules/generator/processor/servicegraphs/servicegraphs.go index 7a60be1b533..53c40012516 100644 --- a/modules/generator/processor/servicegraphs/servicegraphs.go +++ b/modules/generator/processor/servicegraphs/servicegraphs.go @@ -76,7 +76,7 @@ type Processor struct { } func New(cfg Config, tenant string, registry registry.Registry, logger log.Logger) gen.Processor { - labels := []string{"client", "server"} + labels := []string{"client", "server", "connection_type"} for _, d := range cfg.Dimensions { labels = append(labels, strutil.SanitizeLabelName(d)) } @@ -149,20 +149,41 @@ func (p *Processor) consume(resourceSpans []*v1_trace.ResourceSpans) (err error) for _, ils := range rs.InstrumentationLibrarySpans { for _, span := range ils.Spans { + connectionType := store.UNKNOWN + switch span.Kind { + case v1_trace.Span_SPAN_KIND_PRODUCER: + connectionType = store.MESSAGING_SYSTEM + fallthrough + case v1_trace.Span_SPAN_KIND_CLIENT: key := buildKey(hex.EncodeToString(span.TraceId), hex.EncodeToString(span.SpanId)) isNew, err = p.store.UpsertEdge(key, func(e *store.Edge) { e.TraceID = tempo_util.TraceIDToHexString(span.TraceId) + e.ConnectionType = connectionType e.ClientService = svcName e.ClientLatencySec = spanDurationSec(span) e.Failed = e.Failed || p.spanFailed(span) p.upsertDimensions(e.Dimensions, rs.Resource.Attributes, span.Attributes) + + // A database request will only have one span, we don't wait for the server + // span but just copy details from the client span + if dbName, ok := processor_util.FindAttributeValue("db.name", rs.Resource.Attributes, span.Attributes); ok { + e.ConnectionType = store.DATABASE + e.ServerService = dbName + e.ServerLatencySec = spanDurationSec(span) + } }) + + case v1_trace.Span_SPAN_KIND_CONSUMER: + connectionType = store.MESSAGING_SYSTEM + fallthrough + case v1_trace.Span_SPAN_KIND_SERVER: key := buildKey(hex.EncodeToString(span.TraceId), hex.EncodeToString(span.ParentSpanId)) isNew, err = p.store.UpsertEdge(key, func(e *store.Edge) { e.TraceID = tempo_util.TraceIDToHexString(span.TraceId) + e.ConnectionType = connectionType e.ServerService = svcName e.ServerLatencySec = spanDurationSec(span) e.Failed = e.Failed || p.spanFailed(span) @@ -214,7 +235,7 @@ func (p *Processor) Shutdown(_ context.Context) { func (p *Processor) onComplete(e *store.Edge) { labelValues := make([]string, 0, 2+len(p.Cfg.Dimensions)) - labelValues = append(labelValues, e.ClientService, e.ServerService) + labelValues = append(labelValues, e.ClientService, e.ServerService, string(e.ConnectionType)) for _, dimension := range p.Cfg.Dimensions { labelValues = append(labelValues, e.Dimensions[dimension]) diff --git a/modules/generator/processor/servicegraphs/store/edge.go b/modules/generator/processor/servicegraphs/store/edge.go index 5449881009b..aa967771a00 100644 --- a/modules/generator/processor/servicegraphs/store/edge.go +++ b/modules/generator/processor/servicegraphs/store/edge.go @@ -2,11 +2,20 @@ package store import "time" +type ConnectionType string + +const ( + UNKNOWN ConnectionType = "" + MESSAGING_SYSTEM = "messaging_system" + DATABASE = "database" +) + // Edge is an Edge between two nodes in the graph type Edge struct { key string TraceID string + ConnectionType ConnectionType ServerService, ClientService string ServerLatencySec, ClientLatencySec float64 diff --git a/modules/generator/processor/servicegraphs/store/store.go b/modules/generator/processor/servicegraphs/store/store.go index ea15e3fdfdd..0222ba237bf 100644 --- a/modules/generator/processor/servicegraphs/store/store.go +++ b/modules/generator/processor/servicegraphs/store/store.go @@ -76,7 +76,7 @@ func (s *store) tryEvictHead() bool { // UpsertEdge fetches an Edge from the store and updates it using the given callback. If the Edge // doesn't exist yet, it creates a new one with the default TTL. // If the Edge is complete after applying the callback, it's completed and removed. -func (s *store) UpsertEdge(key string, update Callback) (bool, error) { +func (s *store) UpsertEdge(key string, update Callback) (isNew bool, err error) { s.mtx.Lock() defer s.mtx.Unlock() @@ -93,16 +93,22 @@ func (s *store) UpsertEdge(key string, update Callback) (bool, error) { return false, nil } + edge := newEdge(key, s.ttl) + update(edge) + + if edge.isComplete() { + s.onComplete(edge) + return true, nil + } + // Check we can add new edges if s.l.Len() >= s.maxItems { // todo: try to evict expired items return false, ErrTooManyItems } - edge := newEdge(key, s.ttl) ele := s.l.PushBack(edge) s.m[key] = ele - update(edge) return true, nil } From e6a8d039eea0426e5885bd5b12956702a4afa48e Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Thu, 14 Jul 2022 19:45:29 +0200 Subject: [PATCH 2/5] Appease the linter --- .../generator/processor/servicegraphs/servicegraphs.go | 8 ++++---- modules/generator/processor/servicegraphs/store/edge.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/generator/processor/servicegraphs/servicegraphs.go b/modules/generator/processor/servicegraphs/servicegraphs.go index 53c40012516..8159e101999 100644 --- a/modules/generator/processor/servicegraphs/servicegraphs.go +++ b/modules/generator/processor/servicegraphs/servicegraphs.go @@ -149,11 +149,11 @@ func (p *Processor) consume(resourceSpans []*v1_trace.ResourceSpans) (err error) for _, ils := range rs.InstrumentationLibrarySpans { for _, span := range ils.Spans { - connectionType := store.UNKNOWN + connectionType := store.Unknown switch span.Kind { case v1_trace.Span_SPAN_KIND_PRODUCER: - connectionType = store.MESSAGING_SYSTEM + connectionType = store.MessagingSystem fallthrough case v1_trace.Span_SPAN_KIND_CLIENT: @@ -169,14 +169,14 @@ func (p *Processor) consume(resourceSpans []*v1_trace.ResourceSpans) (err error) // A database request will only have one span, we don't wait for the server // span but just copy details from the client span if dbName, ok := processor_util.FindAttributeValue("db.name", rs.Resource.Attributes, span.Attributes); ok { - e.ConnectionType = store.DATABASE + e.ConnectionType = store.Database e.ServerService = dbName e.ServerLatencySec = spanDurationSec(span) } }) case v1_trace.Span_SPAN_KIND_CONSUMER: - connectionType = store.MESSAGING_SYSTEM + connectionType = store.MessagingSystem fallthrough case v1_trace.Span_SPAN_KIND_SERVER: diff --git a/modules/generator/processor/servicegraphs/store/edge.go b/modules/generator/processor/servicegraphs/store/edge.go index aa967771a00..de8db9b41b9 100644 --- a/modules/generator/processor/servicegraphs/store/edge.go +++ b/modules/generator/processor/servicegraphs/store/edge.go @@ -5,9 +5,9 @@ import "time" type ConnectionType string const ( - UNKNOWN ConnectionType = "" - MESSAGING_SYSTEM = "messaging_system" - DATABASE = "database" + Unknown ConnectionType = "" + MessagingSystem = "messaging_system" + Database = "database" ) // Edge is an Edge between two nodes in the graph From d745e0ebc72a9943c2f956840960c62198a47b0b Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Wed, 20 Jul 2022 16:16:44 +0200 Subject: [PATCH 3/5] Update tests --- .../servicegraphs/servicegraphs_test.go | 148 +- .../servicegraphs/testdata/test-sample.json | 1916 ----------------- .../testdata/trace-with-failed-requests.json | 1311 +++++++++++ .../testdata/trace-with-queue-database.json | 1650 ++++++++++++++ 4 files changed, 3059 insertions(+), 1966 deletions(-) delete mode 100644 modules/generator/processor/servicegraphs/testdata/test-sample.json create mode 100644 modules/generator/processor/servicegraphs/testdata/trace-with-failed-requests.json create mode 100644 modules/generator/processor/servicegraphs/testdata/trace-with-queue-database.json diff --git a/modules/generator/processor/servicegraphs/servicegraphs_test.go b/modules/generator/processor/servicegraphs/servicegraphs_test.go index 52eabe3c1b6..873f9b5a0b2 100644 --- a/modules/generator/processor/servicegraphs/servicegraphs_test.go +++ b/modules/generator/processor/servicegraphs/servicegraphs_test.go @@ -25,65 +25,113 @@ func TestServiceGraphs(t *testing.T) { cfg := Config{} cfg.RegisterFlagsAndApplyDefaults("", nil) - cfg.HistogramBuckets = []float64{2.0, 3.0} - cfg.Dimensions = []string{"component", "does-not-exist"} + cfg.HistogramBuckets = []float64{0.04} + cfg.Dimensions = []string{"beast"} p := New(cfg, "test", testRegistry, log.NewNopLogger()) defer p.Shutdown(context.Background()) - traces, err := loadTestData("testdata/test-sample.json") + request, err := loadTestData("testdata/trace-with-queue-database.json") require.NoError(t, err) - p.PushSpans(context.Background(), &tempopb.PushSpansRequest{Batches: traces.Batches}) + p.PushSpans(context.Background(), request) - // Manually call expire to force removal of completed edges. - sgp := p.(*Processor) - sgp.store.Expire() + requesterToServerLabels := labels.FromMap(map[string]string{ + "client": "mythical-requester", + "server": "mythical-server", + "connection_type": "", + "beast": "manticore", + }) + serverToDatabaseLabels := labels.FromMap(map[string]string{ + "client": "mythical-server", + "server": "postgres", + "connection_type": "database", + "beast": "", + }) + requesterToRecorderLabels := labels.FromMap(map[string]string{ + "client": "mythical-requester", + "server": "mythical-recorder", + "connection_type": "messaging_system", + "beast": "", + }) + + fmt.Println(testRegistry) - lbAppLabels := labels.FromMap(map[string]string{ - "client": "lb", - "server": "app", - "component": "net/http", - "does_not_exist": "", + // counters + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_total`, requesterToServerLabels)) + assert.Equal(t, 0.0, testRegistry.Query(`traces_service_graph_request_failed_total`, requesterToServerLabels)) + + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_total`, serverToDatabaseLabels)) + assert.Equal(t, 0.0, testRegistry.Query(`traces_service_graph_request_failed_total`, serverToDatabaseLabels)) + + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_total`, requesterToRecorderLabels)) + assert.Equal(t, 0.0, testRegistry.Query(`traces_service_graph_request_failed_total`, requesterToRecorderLabels)) + + // histograms + assert.Equal(t, 0.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(requesterToServerLabels, 0.04))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(requesterToServerLabels, math.Inf(1)))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_client_seconds_count`, requesterToServerLabels)) + assert.InDelta(t, 0.045, testRegistry.Query(`traces_service_graph_request_client_seconds_sum`, requesterToServerLabels), 0.001) + + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(requesterToServerLabels, 0.04))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(requesterToServerLabels, math.Inf(1)))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_server_seconds_count`, requesterToServerLabels)) + assert.InDelta(t, 0.029, testRegistry.Query(`traces_service_graph_request_server_seconds_sum`, requesterToServerLabels), 0.001) + + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(serverToDatabaseLabels, 0.04))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(serverToDatabaseLabels, math.Inf(1)))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_client_seconds_count`, serverToDatabaseLabels)) + assert.InDelta(t, 0.023, testRegistry.Query(`traces_service_graph_request_client_seconds_sum`, serverToDatabaseLabels), 0.001) + + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(serverToDatabaseLabels, 0.04))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(serverToDatabaseLabels, math.Inf(1)))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_server_seconds_count`, serverToDatabaseLabels)) + assert.InDelta(t, 0.023, testRegistry.Query(`traces_service_graph_request_server_seconds_sum`, serverToDatabaseLabels), 0.001) + + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(requesterToRecorderLabels, 0.04))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(requesterToRecorderLabels, math.Inf(1)))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_client_seconds_count`, requesterToRecorderLabels)) + assert.InDelta(t, 0.000068, testRegistry.Query(`traces_service_graph_request_client_seconds_sum`, requesterToRecorderLabels), 0.001) + + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(requesterToRecorderLabels, 0.04))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(requesterToRecorderLabels, math.Inf(1)))) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_server_seconds_count`, requesterToRecorderLabels)) + assert.InDelta(t, 0.000693, testRegistry.Query(`traces_service_graph_request_server_seconds_sum`, requesterToRecorderLabels), 0.001) +} + +func TestServiceGraphs_failedRequests(t *testing.T) { + testRegistry := registry.NewTestRegistry() + + cfg := Config{} + cfg.RegisterFlagsAndApplyDefaults("", nil) + + p := New(cfg, "test", testRegistry, log.NewNopLogger()) + defer p.Shutdown(context.Background()) + + request, err := loadTestData("testdata/trace-with-failed-requests.json") + require.NoError(t, err) + + p.PushSpans(context.Background(), request) + + requesterToServerLabels := labels.FromMap(map[string]string{ + "client": "mythical-requester", + "server": "mythical-server", + "connection_type": "", }) - appDbLabels := labels.FromMap(map[string]string{ - "client": "app", - "server": "db", - "component": "net/http", - "does_not_exist": "", + serverToDatabaseLabels := labels.FromMap(map[string]string{ + "client": "mythical-server", + "server": "postgres", + "connection_type": "database", }) fmt.Println(testRegistry) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_total`, appDbLabels)) - assert.Equal(t, 0.0, testRegistry.Query(`traces_service_graph_request_failed_total`, appDbLabels)) - - assert.Equal(t, 2.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(appDbLabels, 2.0))) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(appDbLabels, 3.0))) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(appDbLabels, math.Inf(1)))) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_client_seconds_count`, appDbLabels)) - assert.Equal(t, 4.4, testRegistry.Query(`traces_service_graph_request_client_seconds_sum`, appDbLabels)) - - assert.Equal(t, 2.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(appDbLabels, 2.0))) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(appDbLabels, 3.0))) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(appDbLabels, math.Inf(1)))) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_server_seconds_count`, appDbLabels)) - assert.Equal(t, 5.0, testRegistry.Query(`traces_service_graph_request_server_seconds_sum`, appDbLabels)) - - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_total`, lbAppLabels)) - assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_failed_total`, lbAppLabels)) - - assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(lbAppLabels, 2.0))) - assert.Equal(t, 2.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(lbAppLabels, 3.0))) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_client_seconds_bucket`, withLe(lbAppLabels, math.Inf(1)))) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_client_seconds_count`, lbAppLabels)) - assert.Equal(t, 7.8, testRegistry.Query(`traces_service_graph_request_client_seconds_sum`, lbAppLabels)) - - assert.Equal(t, 2.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(lbAppLabels, 2.0))) - assert.Equal(t, 2.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(lbAppLabels, 3.0))) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_server_seconds_bucket`, withLe(lbAppLabels, math.Inf(1)))) - assert.Equal(t, 3.0, testRegistry.Query(`traces_service_graph_request_server_seconds_count`, lbAppLabels)) - assert.Equal(t, 6.2, testRegistry.Query(`traces_service_graph_request_server_seconds_sum`, lbAppLabels)) + // counters + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_total`, requesterToServerLabels)) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_failed_total`, requesterToServerLabels)) + + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_total`, serverToDatabaseLabels)) + assert.Equal(t, 1.0, testRegistry.Query(`traces_service_graph_request_failed_total`, serverToDatabaseLabels)) } func TestServiceGraphs_tooManySpansErr(t *testing.T) { @@ -95,14 +143,14 @@ func TestServiceGraphs_tooManySpansErr(t *testing.T) { p := New(cfg, "test", &testRegistry, log.NewNopLogger()) defer p.Shutdown(context.Background()) - traces, err := loadTestData("testdata/test-sample.json") + request, err := loadTestData("testdata/trace-with-queue-database.json") require.NoError(t, err) - err = p.(*Processor).consume(traces.Batches) + err = p.(*Processor).consume(request.Batches) assert.True(t, errors.As(err, &tooManySpansError{})) } -func loadTestData(path string) (*tempopb.Trace, error) { +func loadTestData(path string) (*tempopb.PushSpansRequest, error) { f, err := os.Open(path) if err != nil { return nil, err @@ -110,7 +158,7 @@ func loadTestData(path string) (*tempopb.Trace, error) { trace := &tempopb.Trace{} err = jsonpb.Unmarshal(f, trace) - return trace, err + return &tempopb.PushSpansRequest{Batches: trace.Batches}, err } func withLe(lbls labels.Labels, le float64) labels.Labels { diff --git a/modules/generator/processor/servicegraphs/testdata/test-sample.json b/modules/generator/processor/servicegraphs/testdata/test-sample.json deleted file mode 100644 index 352d203111c..00000000000 --- a/modules/generator/processor/servicegraphs/testdata/test-sample.json +++ /dev/null @@ -1,1916 +0,0 @@ -{ - "batches":[ - { - "resource":{ - "attributes":[ - { - "key":"service.name", - "value":{ - "stringValue":"lb" - } - }, - { - "key":"cluster", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"namespace", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"opencensus.exporterversion", - "value":{ - "stringValue":"Jaeger-Go-2.22.1" - } - }, - { - "key":"host.name", - "value":{ - "stringValue":"loadgen-6b59dff4c-jdkdk" - } - }, - { - "key":"ip", - "value":{ - "stringValue":"10.136.11.153" - } - }, - { - "key":"client-uuid", - "value":{ - "stringValue":"653fad9a76c115ac" - } - }, - { - "key":"container", - "value":{ - "stringValue":"loadgen" - } - }, - { - "key":"pod", - "value":{ - "stringValue":"loadgen-6b59dff4c-jdkdk" - } - } - ] - }, - "instrumentationLibrarySpans":[ - { - "instrumentationLibrary":{ - - }, - "spans":[ - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"W3WbliTv7os=", - "name":"HTTP Client", - "startTimeUnixNano":"1626717505784699000", - "endTimeUnixNano":"1626717505833874000", - "attributes":[ - { - "key":"sampler.type", - "value":{ - "stringValue":"const" - } - }, - { - "key":"sampler.param", - "value":{ - "boolValue":true - } - } - ], - "status":{ - - } - }, - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"d5ZXpoG4mUc=", - "parentSpanId":"W3WbliTv7os=", - "name":"HTTP POST", - "kind":"SPAN_KIND_CLIENT", - "startTimeUnixNano":"1626717503329568000", - "endTimeUnixNano":"1626717505829568000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"302" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"POST" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"app:80" - } - }, - { - "key":"net/http.reused", - "value":{ - "boolValue":false - } - }, - { - "key":"net/http.was_idle", - "value":{ - "boolValue":false - } - } - ], - "events":[ - { - "timeUnixNano":"1626717505784725000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GetConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505784771000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSStart" - } - }, - { - "key":"host", - "value":{ - "stringValue":"app" - } - } - ] - }, - { - "timeUnixNano":"1626717505822812000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSDone" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.116.196" - } - } - ] - }, - { - "timeUnixNano":"1626717505822821000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectStart" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.116.196:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505822983000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectDone" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.116.196:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505823035000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505823116000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteHeaders" - } - } - ] - }, - { - "timeUnixNano":"1626717505823121000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteRequest" - } - } - ] - }, - { - "timeUnixNano":"1626717505829460000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotFirstResponseByte" - } - } - ] - }, - { - "timeUnixNano":"1626717505829568000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ClosedBody" - } - } - ] - } - ], - "status":{ - "deprecatedCode":"DEPRECATED_STATUS_CODE_UNKNOWN_ERROR", - "code":"STATUS_CODE_ERROR" - } - }, - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"T3b9lSy4e6o=", - "parentSpanId":"W3WbliTv7os=", - "name":"HTTP GET", - "kind":"SPAN_KIND_CLIENT", - "startTimeUnixNano":"1626717504533933000", - "endTimeUnixNano":"1626717505833933000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"404" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"GET" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"app:80" - } - }, - { - "key":"net/http.reused", - "value":{ - "boolValue":false - } - }, - { - "key":"net/http.was_idle", - "value":{ - "boolValue":false - } - } - ], - "events":[ - { - "timeUnixNano":"1626717505829603000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GetConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505829642000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSStart" - } - }, - { - "key":"host", - "value":{ - "stringValue":"app" - } - } - ] - }, - { - "timeUnixNano":"1626717505830180000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSDone" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.116.196" - } - } - ] - }, - { - "timeUnixNano":"1626717505830186000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectStart" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.116.196:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505830301000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectDone" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.116.196:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505830332000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505830372000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteHeaders" - } - } - ] - }, - { - "timeUnixNano":"1626717505830373000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteRequest" - } - } - ] - }, - { - "timeUnixNano":"1626717505833806000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotFirstResponseByte" - } - } - ] - }, - { - "timeUnixNano":"1626717505833933000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ClosedBody" - } - } - ] - } - ], - "status":{ - - } - } - ] - } - ] - }, - { - "resource":{ - "attributes":[ - { - "key":"service.name", - "value":{ - "stringValue":"app" - } - }, - { - "key":"cluster", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"namespace", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"opencensus.exporterversion", - "value":{ - "stringValue":"Jaeger-Go-2.22.1" - } - }, - { - "key":"host.name", - "value":{ - "stringValue":"app-7c474df6bc-xpm6j" - } - }, - { - "key":"ip", - "value":{ - "stringValue":"10.136.11.151" - } - }, - { - "key":"client-uuid", - "value":{ - "stringValue":"264ce1d77c354156" - } - }, - { - "key":"container", - "value":{ - "stringValue":"app" - } - }, - { - "key":"pod", - "value":{ - "stringValue":"app-7c474df6bc-xpm6j" - } - } - ] - }, - "instrumentationLibrarySpans":[ - { - "instrumentationLibrary":{ - - }, - "spans":[ - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"CyLVKnG8lfk=", - "parentSpanId":"d5ZXpoG4mUc=", - "name":"HTTP POST - post", - "kind":"SPAN_KIND_SERVER", - "startTimeUnixNano":"1626717504829303000", - "endTimeUnixNano":"1626717505829303000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"302" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"POST" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"/post" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - } - ], - "status":{ - - } - }, - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"bzp4d/duh20=", - "parentSpanId":"CyLVKnG8lfk=", - "name":"HTTP Client", - "startTimeUnixNano":"1626717505823375000", - "endTimeUnixNano":"1626717505829164000", - "status":{ - - } - }, - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"T/rh1/wSL9g=", - "parentSpanId":"bzp4d/duh20=", - "name":"HTTP POST", - "kind":"SPAN_KIND_CLIENT", - "startTimeUnixNano":"1626717504929264000", - "endTimeUnixNano":"1626717505829264000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"208" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"POST" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"db:80" - } - }, - { - "key":"net/http.reused", - "value":{ - "boolValue":false - } - }, - { - "key":"net/http.was_idle", - "value":{ - "boolValue":false - } - } - ], - "events":[ - { - "timeUnixNano":"1626717505823393000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GetConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505823439000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSStart" - } - }, - { - "key":"host", - "value":{ - "stringValue":"db" - } - } - ] - }, - { - "timeUnixNano":"1626717505827663000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSDone" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.106.8" - } - } - ] - }, - { - "timeUnixNano":"1626717505827673000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectStart" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.106.8:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505827797000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectDone" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.106.8:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505827824000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505827896000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteHeaders" - } - } - ] - }, - { - "timeUnixNano":"1626717505827901000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteRequest" - } - } - ] - }, - { - "timeUnixNano":"1626717505829057000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotFirstResponseByte" - } - } - ] - }, - { - "timeUnixNano":"1626717505829264000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ClosedBody" - } - } - ] - } - ], - "status":{ - - } - }, - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"NvbVfAxyM10=", - "parentSpanId":"T3b9lSy4e6o=", - "name":"HTTP GET - root", - "kind":"SPAN_KIND_SERVER", - "startTimeUnixNano":"1626717503833939000", - "endTimeUnixNano":"1626717505833939000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"200" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"GET" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"/" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - } - ], - "status":{ - - } - }, - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"M464LUSGHVU=", - "parentSpanId":"NvbVfAxyM10=", - "name":"HTTP Client", - "startTimeUnixNano":"1626717505830578000", - "endTimeUnixNano":"1626717505833516000", - "status":{ - - } - }, - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"FcfJmhEwNxM=", - "parentSpanId":"M464LUSGHVU=", - "name":"HTTP GET", - "kind":"SPAN_KIND_CLIENT", - "startTimeUnixNano":"1626717504833879000", - "endTimeUnixNano":"1626717505833879000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"200" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"GET" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"db:80" - } - }, - { - "key":"net/http.reused", - "value":{ - "boolValue":false - } - }, - { - "key":"net/http.was_idle", - "value":{ - "boolValue":false - } - } - ], - "events":[ - { - "timeUnixNano":"1626717505830596000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GetConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505830647000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSStart" - } - }, - { - "key":"host", - "value":{ - "stringValue":"db" - } - } - ] - }, - { - "timeUnixNano":"1626717505832975000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSDone" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.106.8" - } - } - ] - }, - { - "timeUnixNano":"1626717505832983000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectStart" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.106.8:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505833096000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectDone" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.106.8:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505833116000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505833153000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteHeaders" - } - } - ] - }, - { - "timeUnixNano":"1626717505833154000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteRequest" - } - } - ] - }, - { - "timeUnixNano":"1626717505833460000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotFirstResponseByte" - } - } - ] - }, - { - "timeUnixNano":"1626717505833880000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ClosedBody" - } - } - ] - } - ], - "status":{ - - } - } - ] - } - ] - }, - { - "resource":{ - "attributes":[ - { - "key":"service.name", - "value":{ - "stringValue":"db" - } - }, - { - "key":"cluster", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"namespace", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"opencensus.exporterversion", - "value":{ - "stringValue":"Jaeger-Go-2.22.1" - } - }, - { - "key":"host.name", - "value":{ - "stringValue":"db-7488656cb4-m8ljw" - } - }, - { - "key":"ip", - "value":{ - "stringValue":"10.136.11.152" - } - }, - { - "key":"client-uuid", - "value":{ - "stringValue":"392a5faabe967ba3" - } - }, - { - "key":"container", - "value":{ - "stringValue":"db" - } - }, - { - "key":"pod", - "value":{ - "stringValue":"db-7488656cb4-m8ljw" - } - } - ] - }, - "instrumentationLibrarySpans":[ - { - "instrumentationLibrary":{ - - }, - "spans":[ - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"IElW8xeWvqs=", - "parentSpanId":"T/rh1/wSL9g=", - "name":"HTTP POST - post", - "kind":"SPAN_KIND_SERVER", - "startTimeUnixNano":"1626717504328961000", - "endTimeUnixNano":"1626717505828961000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"208" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"POST" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"/post" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - } - ], - "status":{ - - } - }, - { - "traceId":"AAAAAAAAAABbdZuWJO/uiw==", - "spanId":"frLAE97IEMg=", - "parentSpanId":"FcfJmhEwNxM=", - "name":"HTTP GET - root", - "kind":"SPAN_KIND_SERVER", - "startTimeUnixNano":"1626717504833394000", - "endTimeUnixNano":"1626717505833394000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"200" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"GET" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"/" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - } - ], - "status":{ - - } - } - ] - } - ] - }, - { - "resource":{ - "attributes":[ - { - "key":"service.name", - "value":{ - "stringValue":"lb" - } - }, - { - "key":"cluster", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"namespace", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"opencensus.exporterversion", - "value":{ - "stringValue":"Jaeger-Go-2.22.1" - } - }, - { - "key":"host.name", - "value":{ - "stringValue":"loadgen-6b59dff4c-jdkdk" - } - }, - { - "key":"ip", - "value":{ - "stringValue":"10.136.11.153" - } - }, - { - "key":"client-uuid", - "value":{ - "stringValue":"653fad9a76c115ac" - } - }, - { - "key":"container", - "value":{ - "stringValue":"loadgen" - } - }, - { - "key":"pod", - "value":{ - "stringValue":"loadgen-6b59dff4c-jdkdk" - } - } - ] - }, - "instrumentationLibrarySpans":[ - { - "instrumentationLibrary":{ - - }, - "spans":[ - { - "traceId":"AAAAAAAAAABFFdxqWiBZ9g==", - "spanId":"RRXcalogWfY=", - "name":"HTTP Client", - "startTimeUnixNano":"1626717505125848000", - "endTimeUnixNano":"1626717505130325000", - "attributes":[ - { - "key":"sampler.type", - "value":{ - "stringValue":"const" - } - }, - { - "key":"sampler.param", - "value":{ - "boolValue":true - } - } - ], - "status":{ - - } - }, - { - "traceId":"AAAAAAAAAABFFdxqWiBZ9g==", - "spanId":"Uoyxh+9zsBo=", - "parentSpanId":"RRXcalogWfY=", - "name":"HTTP GET", - "kind":"SPAN_KIND_CLIENT", - "startTimeUnixNano":"1626717501130383000", - "endTimeUnixNano":"1626717505130383000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"200" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"GET" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"app:80" - } - }, - { - "key":"net/http.reused", - "value":{ - "boolValue":false - } - }, - { - "key":"net/http.was_idle", - "value":{ - "boolValue":false - } - } - ], - "events":[ - { - "timeUnixNano":"1626717505125868000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GetConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505125909000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSStart" - } - }, - { - "key":"host", - "value":{ - "stringValue":"app" - } - } - ] - }, - { - "timeUnixNano":"1626717505126450000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSDone" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.116.196" - } - } - ] - }, - { - "timeUnixNano":"1626717505126455000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectStart" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.116.196:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505126534000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectDone" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.116.196:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505126556000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505126585000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteHeaders" - } - } - ] - }, - { - "timeUnixNano":"1626717505126586000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteRequest" - } - } - ] - }, - { - "timeUnixNano":"1626717505130263000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotFirstResponseByte" - } - } - ] - }, - { - "timeUnixNano":"1626717505130383000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ClosedBody" - } - } - ] - } - ], - "status":{ - - } - } - ] - } - ] - }, - { - "resource":{ - "attributes":[ - { - "key":"service.name", - "value":{ - "stringValue":"app" - } - }, - { - "key":"cluster", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"namespace", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"opencensus.exporterversion", - "value":{ - "stringValue":"Jaeger-Go-2.22.1" - } - }, - { - "key":"host.name", - "value":{ - "stringValue":"app-7c474df6bc-xpm6j" - } - }, - { - "key":"ip", - "value":{ - "stringValue":"10.136.11.151" - } - }, - { - "key":"client-uuid", - "value":{ - "stringValue":"264ce1d77c354156" - } - }, - { - "key":"pod", - "value":{ - "stringValue":"app-7c474df6bc-xpm6j" - } - }, - { - "key":"container", - "value":{ - "stringValue":"app" - } - } - ] - }, - "instrumentationLibrarySpans":[ - { - "instrumentationLibrary":{ - - }, - "spans":[ - { - "traceId":"AAAAAAAAAABFFdxqWiBZ9g==", - "spanId":"UQZfs+d8Sdw=", - "parentSpanId":"Uoyxh+9zsBo=", - "name":"HTTP GET - root", - "kind":"SPAN_KIND_SERVER", - "startTimeUnixNano":"1626717501930340000", - "endTimeUnixNano":"1626717505130340000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"200" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"GET" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"/" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - } - ], - "status":{ - - } - }, - { - "traceId":"AAAAAAAAAABFFdxqWiBZ9g==", - "spanId":"H7/n/FTsqf0=", - "parentSpanId":"UQZfs+d8Sdw=", - "name":"HTTP Client", - "startTimeUnixNano":"1626717505126741000", - "endTimeUnixNano":"1626717505130038000", - "status":{ - - } - }, - { - "traceId":"AAAAAAAAAABFFdxqWiBZ9g==", - "spanId":"ERieXkZU3MU=", - "parentSpanId":"H7/n/FTsqf0=", - "name":"HTTP GET", - "kind":"SPAN_KIND_CLIENT", - "startTimeUnixNano":"1626717502630304000", - "endTimeUnixNano":"1626717505130304000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"200" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"GET" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"db:80" - } - }, - { - "key":"net/http.reused", - "value":{ - "boolValue":false - } - }, - { - "key":"net/http.was_idle", - "value":{ - "boolValue":false - } - } - ], - "events":[ - { - "timeUnixNano":"1626717505126754000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GetConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505126800000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSStart" - } - }, - { - "key":"host", - "value":{ - "stringValue":"db" - } - } - ] - }, - { - "timeUnixNano":"1626717505129605000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"DNSDone" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.106.8" - } - } - ] - }, - { - "timeUnixNano":"1626717505129609000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectStart" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.106.8:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505129678000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ConnectDone" - } - }, - { - "key":"network", - "value":{ - "stringValue":"tcp" - } - }, - { - "key":"addr", - "value":{ - "stringValue":"10.188.106.8:80" - } - } - ] - }, - { - "timeUnixNano":"1626717505129695000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotConn" - } - } - ] - }, - { - "timeUnixNano":"1626717505129727000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteHeaders" - } - } - ] - }, - { - "timeUnixNano":"1626717505129727000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"WroteRequest" - } - } - ] - }, - { - "timeUnixNano":"1626717505129965000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"GotFirstResponseByte" - } - } - ] - }, - { - "timeUnixNano":"1626717505130303000", - "attributes":[ - { - "key":"event", - "value":{ - "stringValue":"ClosedBody" - } - } - ] - } - ], - "status":{ - - } - } - ] - } - ] - }, - { - "resource":{ - "attributes":[ - { - "key":"service.name", - "value":{ - "stringValue":"db" - } - }, - { - "key":"cluster", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"namespace", - "value":{ - "stringValue":"tns-demo" - } - }, - { - "key":"opencensus.exporterversion", - "value":{ - "stringValue":"Jaeger-Go-2.22.1" - } - }, - { - "key":"host.name", - "value":{ - "stringValue":"db-7488656cb4-m8ljw" - } - }, - { - "key":"ip", - "value":{ - "stringValue":"10.136.11.152" - } - }, - { - "key":"client-uuid", - "value":{ - "stringValue":"392a5faabe967ba3" - } - }, - { - "key":"container", - "value":{ - "stringValue":"db" - } - }, - { - "key":"pod", - "value":{ - "stringValue":"db-7488656cb4-m8ljw" - } - } - ] - }, - "instrumentationLibrarySpans":[ - { - "instrumentationLibrary":{ - - }, - "spans":[ - { - "traceId":"AAAAAAAAAABFFdxqWiBZ9g==", - "spanId":"ZCqiD3w+XGc=", - "parentSpanId":"ERieXkZU3MU=", - "name":"HTTP GET - root", - "kind":"SPAN_KIND_SERVER", - "startTimeUnixNano":"1626717502629891000", - "endTimeUnixNano":"1626717505129891000", - "attributes":[ - { - "key":"http.status_code", - "value":{ - "intValue":"200" - } - }, - { - "key":"http.method", - "value":{ - "stringValue":"GET" - } - }, - { - "key":"http.url", - "value":{ - "stringValue":"/" - } - }, - { - "key":"component", - "value":{ - "stringValue":"net/http" - } - } - ], - "status":{ - - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/modules/generator/processor/servicegraphs/testdata/trace-with-failed-requests.json b/modules/generator/processor/servicegraphs/testdata/trace-with-failed-requests.json new file mode 100644 index 00000000000..d1abe8d3d93 --- /dev/null +++ b/modules/generator/processor/servicegraphs/testdata/trace-with-failed-requests.json @@ -0,0 +1,1311 @@ +{ + "batches": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "mythical-requester" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "kAf+pIRVStc=", + "name": "requester", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658325672496201216", + "endTimeUnixNano": "1658325672511518720", + "attributes": [ + { + "key": "beast", + "value": { + "stringValue": "illithid" + } + } + ], + "status": { + "code": "STATUS_CODE_ERROR" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-net", + "version": "0.27.1" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "H8vBui/9k+s=", + "parentSpanId": "kAf+pIRVStc=", + "name": "tcp.connect", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658325672496666880", + "endTimeUnixNano": "1658325672498567424", + "attributes": [ + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "net.peer.port", + "value": { + "stringValue": "4000" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "172.22.0.7" + } + }, + { + "key": "net.host.ip", + "value": { + "stringValue": "172.22.0.11" + } + }, + { + "key": "net.host.port", + "value": { + "intValue": "44212" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-http", + "version": "0.27.0" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "KJg4Ps+hpCE=", + "parentSpanId": "kAf+pIRVStc=", + "name": "POST /:endpoint", + "kind": "SPAN_KIND_SERVER", + "startTimeUnixNano": "1658325672499550976", + "endTimeUnixNano": "1658325672506860544", + "attributes": [ + { + "key": "http.url", + "value": { + "stringValue": "http://mythical-server:4000/illithid" + } + }, + { + "key": "http.host", + "value": { + "stringValue": "mythical-server:4000" + } + }, + { + "key": "net.host.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "http.method", + "value": { + "stringValue": "POST" + } + }, + { + "key": "http.target", + "value": { + "stringValue": "/illithid" + } + }, + { + "key": "http.request_content_length_uncompressed", + "value": { + "intValue": "16" + } + }, + { + "key": "http.flavor", + "value": { + "stringValue": "1.1" + } + }, + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + }, + { + "key": "span.kind", + "value": { + "intValue": "2" + } + }, + { + "key": "net.host.ip", + "value": { + "stringValue": "::ffff:172.22.0.7" + } + }, + { + "key": "net.host.port", + "value": { + "intValue": "4000" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "::ffff:172.22.0.11" + } + }, + { + "key": "net.peer.port", + "value": { + "intValue": "44212" + } + }, + { + "key": "http.status_code", + "value": { + "intValue": "500" + } + }, + { + "key": "http.status_text", + "value": { + "stringValue": "INTERNAL SERVER ERROR" + } + }, + { + "key": "http.route", + "value": { + "stringValue": "/:endpoint" + } + } + ], + "status": { + "code": "STATUS_CODE_ERROR" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-express", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "ixGu2J+yW7Y=", + "parentSpanId": "KJg4Ps+hpCE=", + "name": "middleware - query", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658325672499683072", + "endTimeUnixNano": "1658325672499706880", + "attributes": [ + { + "key": "http.route", + "value": { + "stringValue": "/" + } + }, + { + "key": "express.name", + "value": { + "stringValue": "query" + } + }, + { + "key": "express.type", + "value": { + "stringValue": "middleware" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-express", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "Ba0AIo2GnC8=", + "parentSpanId": "KJg4Ps+hpCE=", + "name": "middleware - expressInit", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658325672500851200", + "endTimeUnixNano": "1658325672500956416", + "attributes": [ + { + "key": "http.route", + "value": { + "stringValue": "/" + } + }, + { + "key": "express.name", + "value": { + "stringValue": "expressInit" + } + }, + { + "key": "express.type", + "value": { + "stringValue": "middleware" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-express", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "5Ksw2VlnSmA=", + "parentSpanId": "KJg4Ps+hpCE=", + "name": "middleware - jsonParser", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658325672501703680", + "endTimeUnixNano": "1658325672502426112", + "attributes": [ + { + "key": "http.route", + "value": { + "stringValue": "/" + } + }, + { + "key": "express.name", + "value": { + "stringValue": "jsonParser" + } + }, + { + "key": "express.type", + "value": { + "stringValue": "middleware" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-express", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "aStlqd29Nds=", + "parentSpanId": "KJg4Ps+hpCE=", + "name": "request handler - /:endpoint", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658325672502643712", + "endTimeUnixNano": "1658325672502647552", + "attributes": [ + { + "key": "http.route", + "value": { + "stringValue": "/:endpoint" + } + }, + { + "key": "express.name", + "value": { + "stringValue": "/:endpoint" + } + }, + { + "key": "express.type", + "value": { + "stringValue": "request_handler" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-pg", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "wa5s6jmo/Es=", + "parentSpanId": "KJg4Ps+hpCE=", + "name": "pg.query:INSERT", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658325672502820608", + "endTimeUnixNano": "1658325672505599232", + "attributes": [ + { + "key": "db.name", + "value": { + "stringValue": "postgres" + } + }, + { + "key": "db.system", + "value": { + "stringValue": "postgresql" + } + }, + { + "key": "db.connection_string", + "value": { + "stringValue": "jdbc:postgresql://mythical-database:5432/postgres" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "mythical-database" + } + }, + { + "key": "net.peer.port", + "value": { + "intValue": "5432" + } + }, + { + "key": "db.user", + "value": { + "stringValue": "postgres" + } + }, + { + "key": "db.statement", + "value": { + "stringValue": "INSERT INTO illithid(name) VALUES ($1)" + } + } + ], + "status": { + "message": "null value in column \"name\" of relation \"illithid\" violates not-null constraint", + "code": "STATUS_CODE_ERROR" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-http", + "version": "0.27.0" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "OkvVhGt0TNE=", + "parentSpanId": "KJg4Ps+hpCE=", + "name": "HTTP POST", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658325672507591168", + "endTimeUnixNano": "1658325672513276160", + "attributes": [ + { + "key": "http.url", + "value": { + "stringValue": "http://loki:3100/loki/api/v1/push" + } + }, + { + "key": "http.method", + "value": { + "stringValue": "POST" + } + }, + { + "key": "http.target", + "value": { + "stringValue": "/loki/api/v1/push" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "loki" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "172.22.0.6" + } + }, + { + "key": "net.peer.port", + "value": { + "intValue": "3100" + } + }, + { + "key": "http.host", + "value": { + "stringValue": "loki:3100" + } + }, + { + "key": "http.status_code", + "value": { + "intValue": "204" + } + }, + { + "key": "http.status_text", + "value": { + "stringValue": "NO CONTENT" + } + }, + { + "key": "http.flavor", + "value": { + "stringValue": "1.1" + } + }, + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + } + ], + "status": { + "code": "STATUS_CODE_OK" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-net", + "version": "0.27.1" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "hv+Rry3/+4A=", + "parentSpanId": "OkvVhGt0TNE=", + "name": "tcp.connect", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658325672507767552", + "endTimeUnixNano": "1658325672510471168", + "attributes": [ + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "loki" + } + }, + { + "key": "net.peer.port", + "value": { + "stringValue": "3100" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "172.22.0.6" + } + }, + { + "key": "net.host.ip", + "value": { + "stringValue": "172.22.0.7" + } + }, + { + "key": "net.host.port", + "value": { + "intValue": "48352" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-dns", + "version": "0.27.1" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "cp3Zs8O95zk=", + "parentSpanId": "OkvVhGt0TNE=", + "name": "dns.lookup", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658325672508146944", + "endTimeUnixNano": "1658325672509536512", + "attributes": [ + { + "key": "peer.ipv4", + "value": { + "stringValue": "172.22.0.6" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "mythical-requester" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "v3j1HkuA/7Y=", + "parentSpanId": "kAf+pIRVStc=", + "name": "log_to_loki", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658325672510916608", + "endTimeUnixNano": "1658325672521824256", + "status": { + "code": "STATUS_CODE_OK" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "mythical-requester" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "ncQw0lybaxU=", + "parentSpanId": "kAf+pIRVStc=", + "name": "log_to_loki", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658325672511422464", + "endTimeUnixNano": "1658325672520672256", + "status": { + "code": "STATUS_CODE_OK" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-net", + "version": "0.27.1" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "kFlGolt07S8=", + "parentSpanId": "kAf+pIRVStc=", + "name": "tcp.connect", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658325672512283904", + "endTimeUnixNano": "1658325672519590912", + "attributes": [ + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "loki" + } + }, + { + "key": "net.peer.port", + "value": { + "stringValue": "3100" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "172.22.0.6" + } + }, + { + "key": "net.host.ip", + "value": { + "stringValue": "172.22.0.11" + } + }, + { + "key": "net.host.port", + "value": { + "intValue": "38858" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-net", + "version": "0.27.1" + }, + "spans": [ + { + "traceId": "6Lbf+fjUSyjxsivDvS9naA==", + "spanId": "NEkL/q0FA4Q=", + "parentSpanId": "kAf+pIRVStc=", + "name": "tcp.connect", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658325672512482304", + "endTimeUnixNano": "1658325672517447936", + "attributes": [ + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "loki" + } + }, + { + "key": "net.peer.port", + "value": { + "stringValue": "3100" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "172.22.0.6" + } + }, + { + "key": "net.host.ip", + "value": { + "stringValue": "172.22.0.11" + } + }, + { + "key": "net.host.port", + "value": { + "intValue": "38856" + } + } + ], + "status": {} + } + ] + } + ] + } + ] +} diff --git a/modules/generator/processor/servicegraphs/testdata/trace-with-queue-database.json b/modules/generator/processor/servicegraphs/testdata/trace-with-queue-database.json new file mode 100644 index 00000000000..dd638b31795 --- /dev/null +++ b/modules/generator/processor/servicegraphs/testdata/trace-with-queue-database.json @@ -0,0 +1,1650 @@ +{ + "batches": [ + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "mythical-requester" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "1gZXnld4dYc=", + "name": "requester", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658320854877522688", + "endTimeUnixNano": "1658320854923357184", + "attributes": [ + { + "key": "beast", + "value": { + "stringValue": "manticore" + } + } + ], + "status": { + "code": "STATUS_CODE_OK" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-net", + "version": "0.27.1" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "U/Mym4Y9qV0=", + "parentSpanId": "1gZXnld4dYc=", + "name": "tcp.connect", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658320854877839616", + "endTimeUnixNano": "1658320854878545408", + "attributes": [ + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "net.peer.port", + "value": { + "stringValue": "4000" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "172.22.0.7" + } + }, + { + "key": "net.host.ip", + "value": { + "stringValue": "172.22.0.11" + } + }, + { + "key": "net.host.port", + "value": { + "intValue": "46950" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-http", + "version": "0.27.0" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "mZKWiJfzyEY=", + "parentSpanId": "1gZXnld4dYc=", + "name": "GET /:endpoint", + "kind": "SPAN_KIND_SERVER", + "startTimeUnixNano": "1658320854878927360", + "endTimeUnixNano": "1658320854908913408", + "attributes": [ + { + "key": "http.url", + "value": { + "stringValue": "http://mythical-server:4000/manticore" + } + }, + { + "key": "http.host", + "value": { + "stringValue": "mythical-server:4000" + } + }, + { + "key": "net.host.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "http.method", + "value": { + "stringValue": "GET" + } + }, + { + "key": "http.target", + "value": { + "stringValue": "/manticore" + } + }, + { + "key": "http.flavor", + "value": { + "stringValue": "1.1" + } + }, + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + }, + { + "key": "beast", + "value": { + "stringValue": "manticore" + } + }, + { + "key": "span.kind", + "value": { + "intValue": "2" + } + }, + { + "key": "net.host.ip", + "value": { + "stringValue": "::ffff:172.22.0.7" + } + }, + { + "key": "net.host.port", + "value": { + "intValue": "4000" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "::ffff:172.22.0.11" + } + }, + { + "key": "net.peer.port", + "value": { + "intValue": "46950" + } + }, + { + "key": "http.status_code", + "value": { + "intValue": "200" + } + }, + { + "key": "http.status_text", + "value": { + "stringValue": "OK" + } + }, + { + "key": "http.route", + "value": { + "stringValue": "/:endpoint" + } + } + ], + "status": { + "code": "STATUS_CODE_OK" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-express", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "A38EGjeny0Y=", + "parentSpanId": "mZKWiJfzyEY=", + "name": "middleware - query", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658320854879122688", + "endTimeUnixNano": "1658320854879143680", + "attributes": [ + { + "key": "http.route", + "value": { + "stringValue": "/" + } + }, + { + "key": "express.name", + "value": { + "stringValue": "query" + } + }, + { + "key": "express.type", + "value": { + "stringValue": "middleware" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-express", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "7eLzskA9GzQ=", + "parentSpanId": "mZKWiJfzyEY=", + "name": "middleware - expressInit", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658320854879322624", + "endTimeUnixNano": "1658320854879355136", + "attributes": [ + { + "key": "http.route", + "value": { + "stringValue": "/" + } + }, + { + "key": "express.name", + "value": { + "stringValue": "expressInit" + } + }, + { + "key": "express.type", + "value": { + "stringValue": "middleware" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-express", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "I+ErHCWWzIw=", + "parentSpanId": "mZKWiJfzyEY=", + "name": "middleware - jsonParser", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658320854879422208", + "endTimeUnixNano": "1658320854879444480", + "attributes": [ + { + "key": "http.route", + "value": { + "stringValue": "/" + } + }, + { + "key": "express.name", + "value": { + "stringValue": "jsonParser" + } + }, + { + "key": "express.type", + "value": { + "stringValue": "middleware" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-express", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "w4/Ni3Fq4S4=", + "parentSpanId": "mZKWiJfzyEY=", + "name": "request handler - /:endpoint", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658320854879524608", + "endTimeUnixNano": "1658320854879526400", + "attributes": [ + { + "key": "http.route", + "value": { + "stringValue": "/:endpoint" + } + }, + { + "key": "express.name", + "value": { + "stringValue": "/:endpoint" + } + }, + { + "key": "express.type", + "value": { + "stringValue": "request_handler" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-pg", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "JT4hL+I0IWw=", + "parentSpanId": "mZKWiJfzyEY=", + "name": "pg.query:SELECT", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658320854879610624", + "endTimeUnixNano": "1658320854903392000", + "attributes": [ + { + "key": "db.name", + "value": { + "stringValue": "postgres" + } + }, + { + "key": "db.system", + "value": { + "stringValue": "postgresql" + } + }, + { + "key": "db.connection_string", + "value": { + "stringValue": "jdbc:postgresql://mythical-database:5432/postgres" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "mythical-database" + } + }, + { + "key": "net.peer.port", + "value": { + "intValue": "5432" + } + }, + { + "key": "db.user", + "value": { + "stringValue": "postgres" + } + }, + { + "key": "db.statement", + "value": { + "stringValue": "SELECT name from manticore" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-http", + "version": "0.27.0" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "Iq8HyyCGMcA=", + "parentSpanId": "mZKWiJfzyEY=", + "name": "HTTP POST", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658320854909347584", + "endTimeUnixNano": "1658320854913202688", + "attributes": [ + { + "key": "http.url", + "value": { + "stringValue": "http://loki:3100/loki/api/v1/push" + } + }, + { + "key": "http.method", + "value": { + "stringValue": "POST" + } + }, + { + "key": "http.target", + "value": { + "stringValue": "/loki/api/v1/push" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "loki" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "172.22.0.6" + } + }, + { + "key": "net.peer.port", + "value": { + "intValue": "3100" + } + }, + { + "key": "http.host", + "value": { + "stringValue": "loki:3100" + } + }, + { + "key": "http.status_code", + "value": { + "intValue": "204" + } + }, + { + "key": "http.status_text", + "value": { + "stringValue": "NO CONTENT" + } + }, + { + "key": "http.flavor", + "value": { + "stringValue": "1.1" + } + }, + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + } + ], + "status": { + "code": "STATUS_CODE_OK" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-net", + "version": "0.27.1" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "5xenytYWGCM=", + "parentSpanId": "Iq8HyyCGMcA=", + "name": "tcp.connect", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658320854909465856", + "endTimeUnixNano": "1658320854911322112", + "attributes": [ + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "loki" + } + }, + { + "key": "net.peer.port", + "value": { + "stringValue": "3100" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "172.22.0.6" + } + }, + { + "key": "net.host.ip", + "value": { + "stringValue": "172.22.0.7" + } + }, + { + "key": "net.host.port", + "value": { + "intValue": "51090" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-server" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-dns", + "version": "0.27.1" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "G1lOVPULKHA=", + "parentSpanId": "Iq8HyyCGMcA=", + "name": "dns.lookup", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658320854909490688", + "endTimeUnixNano": "1658320854910292992", + "attributes": [ + { + "key": "peer.ipv4", + "value": { + "stringValue": "172.22.0.6" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "mythical-requester" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "oMg46pqD9yY=", + "parentSpanId": "1gZXnld4dYc=", + "name": "publish_to_queue", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658320854915519232", + "endTimeUnixNano": "1658320854916681216", + "status": { + "code": "STATUS_CODE_OK" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-amqplib", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "CbyBh8ln9LQ=", + "parentSpanId": "oMg46pqD9yY=", + "name": " -> messages send", + "kind": "SPAN_KIND_PRODUCER", + "startTimeUnixNano": "1658320854915559936", + "endTimeUnixNano": "1658320854915628800", + "attributes": [ + { + "key": "messaging.protocol_version", + "value": { + "stringValue": "0.9.1" + } + }, + { + "key": "messaging.url", + "value": { + "stringValue": "amqp://mythical-queue" + } + }, + { + "key": "messaging.protocol", + "value": { + "stringValue": "AMQP" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "mythical-queue" + } + }, + { + "key": "net.peer.port", + "value": { + "intValue": "5672" + } + }, + { + "key": "messaging.system", + "value": { + "stringValue": "rabbitmq" + } + }, + { + "key": "messaging.destination", + "value": { + "stringValue": "" + } + }, + { + "key": "messaging.destination_kind", + "value": { + "stringValue": "topic" + } + }, + { + "key": "messaging.rabbitmq.routing_key", + "value": { + "stringValue": "messages" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "mythical-requester" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "HZ43ugub274=", + "parentSpanId": "1gZXnld4dYc=", + "name": "log_to_loki", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658320854916730624", + "endTimeUnixNano": "1658320854930536704", + "status": { + "code": "STATUS_CODE_OK" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "mythical-requester" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "ByBJTXxe2aI=", + "parentSpanId": "1gZXnld4dYc=", + "name": "log_to_loki", + "kind": "SPAN_KIND_CLIENT", + "startTimeUnixNano": "1658320854923263232", + "endTimeUnixNano": "1658320854929491200", + "status": { + "code": "STATUS_CODE_OK" + } + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-net", + "version": "0.27.1" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "ivrh44gllP0=", + "parentSpanId": "1gZXnld4dYc=", + "name": "tcp.connect", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658320854923789312", + "endTimeUnixNano": "1658320854925569280", + "attributes": [ + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "loki" + } + }, + { + "key": "net.peer.port", + "value": { + "stringValue": "3100" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "172.22.0.6" + } + }, + { + "key": "net.host.ip", + "value": { + "stringValue": "172.22.0.11" + } + }, + { + "key": "net.host.port", + "value": { + "intValue": "41594" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-requester" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.4" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-net", + "version": "0.27.1" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "o/mJQtsdDeE=", + "parentSpanId": "1gZXnld4dYc=", + "name": "tcp.connect", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658320854924354560", + "endTimeUnixNano": "1658320854925760768", + "attributes": [ + { + "key": "net.transport", + "value": { + "stringValue": "ip_tcp" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "loki" + } + }, + { + "key": "net.peer.port", + "value": { + "stringValue": "3100" + } + }, + { + "key": "net.peer.ip", + "value": { + "stringValue": "172.22.0.6" + } + }, + { + "key": "net.host.ip", + "value": { + "stringValue": "172.22.0.11" + } + }, + { + "key": "net.host.port", + "value": { + "intValue": "41596" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-recorder" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "@opentelemetry/instrumentation-amqplib", + "version": "0.28.0" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "qMP7VjNGIK8=", + "parentSpanId": "CbyBh8ln9LQ=", + "name": "messages process", + "kind": "SPAN_KIND_CONSUMER", + "startTimeUnixNano": "1658320854925510400", + "endTimeUnixNano": "1658320854926209792", + "attributes": [ + { + "key": "messaging.protocol_version", + "value": { + "stringValue": "0.9.1" + } + }, + { + "key": "messaging.url", + "value": { + "stringValue": "amqp://mythical-queue" + } + }, + { + "key": "messaging.protocol", + "value": { + "stringValue": "AMQP" + } + }, + { + "key": "net.peer.name", + "value": { + "stringValue": "mythical-queue" + } + }, + { + "key": "net.peer.port", + "value": { + "intValue": "5672" + } + }, + { + "key": "messaging.system", + "value": { + "stringValue": "rabbitmq" + } + }, + { + "key": "messaging.destination", + "value": { + "stringValue": "" + } + }, + { + "key": "messaging.destination_kind", + "value": { + "stringValue": "topic" + } + }, + { + "key": "messaging.rabbitmq.routing_key", + "value": { + "stringValue": "messages" + } + }, + { + "key": "messaging.operation", + "value": { + "stringValue": "process" + } + } + ], + "status": {} + } + ] + } + ] + }, + { + "resource": { + "attributes": [ + { + "key": "service.name", + "value": { + "stringValue": "mythical-recorder" + } + }, + { + "key": "telemetry.sdk.language", + "value": { + "stringValue": "nodejs" + } + }, + { + "key": "telemetry.sdk.name", + "value": { + "stringValue": "opentelemetry" + } + }, + { + "key": "telemetry.sdk.version", + "value": { + "stringValue": "1.4.0" + } + }, + { + "key": "ip", + "value": { + "stringValue": "1.2.3.5" + } + } + ] + }, + "instrumentationLibrarySpans": [ + { + "instrumentationLibrary": { + "name": "mythical-recorder" + }, + "spans": [ + { + "traceId": "QpC1h3qZMN55u0KDZTmOzA==", + "spanId": "j9WiKB5PGKw=", + "parentSpanId": "qMP7VjNGIK8=", + "name": "process_message", + "kind": "SPAN_KIND_INTERNAL", + "startTimeUnixNano": "1658320854925532928", + "endTimeUnixNano": "1658320854963292160", + "status": {} + } + ] + } + ] + } + ] +} From c8a21fd29060a50f224ddebb1fa3dc8bd125b0f8 Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Wed, 20 Jul 2022 16:48:37 +0200 Subject: [PATCH 4/5] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e03baa97611..4718fe89c32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * [FEATURE] Mark `log_received_traces` as deprecated. New flag is `log_received_spans`. Extend distributor spans logger with optional features to include span attributes and a filter by error status. [#1465](https://github.com/grafana/tempo/pull/1465) (@faustodavid) * [FEATURE] Add tags option for s3 backends. This allows new objects to be written with the configured tags. [#1442](https://github.com/grafana/tempo/pull/1442) (@stevenbrookes) +* [FEATURE] Include messaging systems and databases in service graphs. [#1576](https://github.com/grafana/tempo/pull/1576) (@kvrhdn) * [CHANGE] metrics-generator: Changed added metric label `instance` to `__metrics_gen_instance` to reduce collisions with custom dimensions. [#1439](https://github.com/grafana/tempo/pull/1439) (@joe-elliott) * [CHANGE] Don't enforce `max_bytes_per_tag_values_query` when set to 0. [#1447](https://github.com/grafana/tempo/pull/1447) (@joe-elliott) * [CHANGE] Add new querier service in deployment jsonnet to serve `/status` endpoint. [#1474](https://github.com/grafana/tempo/pull/1474) (@annanay25) From 288cf3923d44e05d908ece76a78efe0b6ad5f5c0 Mon Sep 17 00:00:00 2001 From: Koenraad Verheyden Date: Tue, 2 Aug 2022 14:06:04 +0200 Subject: [PATCH 5/5] Make fallthrough more explicit --- modules/generator/processor/servicegraphs/servicegraphs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/generator/processor/servicegraphs/servicegraphs.go b/modules/generator/processor/servicegraphs/servicegraphs.go index 8159e101999..01a3c46572f 100644 --- a/modules/generator/processor/servicegraphs/servicegraphs.go +++ b/modules/generator/processor/servicegraphs/servicegraphs.go @@ -153,9 +153,9 @@ func (p *Processor) consume(resourceSpans []*v1_trace.ResourceSpans) (err error) switch span.Kind { case v1_trace.Span_SPAN_KIND_PRODUCER: + // override connection type and continue processing as span kind client connectionType = store.MessagingSystem fallthrough - case v1_trace.Span_SPAN_KIND_CLIENT: key := buildKey(hex.EncodeToString(span.TraceId), hex.EncodeToString(span.SpanId)) isNew, err = p.store.UpsertEdge(key, func(e *store.Edge) { @@ -176,9 +176,9 @@ func (p *Processor) consume(resourceSpans []*v1_trace.ResourceSpans) (err error) }) case v1_trace.Span_SPAN_KIND_CONSUMER: + // override connection type and continue processing as span kind server connectionType = store.MessagingSystem fallthrough - case v1_trace.Span_SPAN_KIND_SERVER: key := buildKey(hex.EncodeToString(span.TraceId), hex.EncodeToString(span.ParentSpanId)) isNew, err = p.store.UpsertEdge(key, func(e *store.Edge) {