feat(trace): support otlp http exporter (#2746)

* feat(trace): support otlp http exporter

* chore: use otlptracehttp v1.10.0 not upgrade grpc version prevent other modules break

* refactor(trace): rename exporter kind grpc to otlpgrpc.

BREAKING CHANGE: trace Config.Batcher should use otlpgrpc instead of grpc now.
This commit is contained in:
cong
2023-01-03 22:49:30 +08:00
committed by GitHub
parent ec7ac43948
commit 42413dc294
5 changed files with 26 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ func TestStartAgent(t *testing.T) {
endpoint1 = "localhost:1234"
endpoint2 = "remotehost:1234"
endpoint3 = "localhost:1235"
endpoint4 = "localhost:1236"
)
c1 := Config{
Name: "foo",
@@ -36,7 +37,12 @@ func TestStartAgent(t *testing.T) {
c5 := Config{
Name: "grpc",
Endpoint: endpoint3,
Batcher: "grpc",
Batcher: kindOtlpGrpc,
}
c6 := Config{
Name: "otlphttp",
Endpoint: endpoint4,
Batcher: kindOtlpHttp,
}
StartAgent(c1)
@@ -45,12 +51,13 @@ func TestStartAgent(t *testing.T) {
StartAgent(c3)
StartAgent(c4)
StartAgent(c5)
StartAgent(c6)
lock.Lock()
defer lock.Unlock()
// because remotehost cannot be resolved
assert.Equal(t, 3, len(agents))
assert.Equal(t, 4, len(agents))
_, ok := agents[""]
assert.True(t, ok)
_, ok = agents[endpoint1]