MCPcopy
hub / github.com/grafana/tempo / makeSpan

Function makeSpan

modules/distributor/distributor_test.go:1787–1809  ·  view source on GitHub ↗
(traceID, spanID, name string, status *v1.Status, attributes ...*v1_common.KeyValue)

Source from the content-addressed store, hash-verified

1785}
1786
1787func makeSpan(traceID, spanID, name string, status *v1.Status, attributes ...*v1_common.KeyValue) *v1.Span {
1788 if status == nil {
1789 status = &v1.Status{Code: v1.Status_STATUS_CODE_OK}
1790 }
1791
1792 traceIDBytes, err := hex.DecodeString(traceID)
1793 if err != nil {
1794 panic(err)
1795 }
1796 spanIDBytes, err := hex.DecodeString(spanID)
1797 if err != nil {
1798 panic(err)
1799 }
1800
1801 return &v1.Span{
1802 Name: name,
1803 TraceId: traceIDBytes,
1804 SpanId: spanIDBytes,
1805 Status: status,
1806 Kind: v1.Span_SPAN_KIND_SERVER,
1807 Attributes: attributes,
1808 }
1809}
1810
1811func makeScope(spans ...*v1.Span) *v1.ScopeSpans {
1812 return &v1.ScopeSpans{

Callers 4

TestLogReceivedSpansFunction · 0.85
TestRateLimitRespectedFunction · 0.85
TestArtificialLatencyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected