Chore: Add grafana-apiserver (#70721)
* add grafana-apiserver * remove watchset & move provisioning and http server to background services * remove scheme * otel fixes (#70874) * remove module ProvideRegistry test * use certgenerator from apiserver package * Control collector/pdata from going to v1.0.0-rc8 (as Tempo 1.5.1 would have it)
This commit is contained in:
@@ -5,15 +5,17 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"go.opentelemetry.io/collector/pdata/pcommon"
|
||||
"go.opentelemetry.io/collector/pdata/ptrace"
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/data"
|
||||
"github.com/stretchr/testify/require"
|
||||
otlp "go.opentelemetry.io/collector/model/otlp"
|
||||
"go.opentelemetry.io/collector/model/pdata"
|
||||
"go.opentelemetry.io/collector/model/otlp"
|
||||
)
|
||||
|
||||
func TestTraceToFrame(t *testing.T) {
|
||||
t.Run("should transform tempo protobuf response into dataframe", func(t *testing.T) {
|
||||
// For what ever reason you cannot easily create pdata.Traces for the TraceToFrame from something more readable
|
||||
// For what ever reason you cannot easily create ptrace.Traces for the TraceToFrame from something more readable
|
||||
// like json. You could tediously create the structures manually using all the setters for everything or use
|
||||
// https://github.com/grafana/tempo/tree/master/pkg/tempopb to create the protobuf structs from something like
|
||||
// json. At the moment just saving some real tempo proto response into file and loading was the easiest and
|
||||
@@ -60,14 +62,14 @@ func TestTraceToFrame(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
var index int
|
||||
otTrace.ResourceSpans().RemoveIf(func(rsp pdata.ResourceSpans) bool {
|
||||
rsp.InstrumentationLibrarySpans().RemoveIf(func(sp pdata.InstrumentationLibrarySpans) bool {
|
||||
sp.Spans().RemoveIf(func(span pdata.Span) bool {
|
||||
otTrace.ResourceSpans().RemoveIf(func(rsp ptrace.ResourceSpans) bool {
|
||||
rsp.ScopeSpans().RemoveIf(func(sp ptrace.ScopeSpans) bool {
|
||||
sp.Spans().RemoveIf(func(span ptrace.Span) bool {
|
||||
if index == 0 {
|
||||
span.SetTraceID(pdata.NewTraceID([16]byte{0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7}))
|
||||
span.SetTraceID(pcommon.NewTraceID([16]byte{0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7}))
|
||||
}
|
||||
if index == 1 {
|
||||
span.SetTraceID(pdata.NewTraceID([16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7}))
|
||||
span.SetTraceID(pcommon.NewTraceID([16]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7}))
|
||||
}
|
||||
index++
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user