1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00

Update example to use jaeger exporter and update Readme (#143)

* update http example to use jaeger exporter and sdk.

* update image location.

* remove extra parameters for jaeger.
This commit is contained in:
rghetia
2019-09-25 13:22:33 -07:00
committed by GitHub
parent 7966e63342
commit a853377a2f
10 changed files with 224 additions and 51 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ type SpanData struct {
// from StartTime by the duration of the span.
EndTime time.Time
// The values of Attributes each have type string, bool, or int64.
Attributes map[string]interface{}
Attributes []core.KeyValue
MessageEvents []Event
Links []apitrace.Link
Status codes.Code
+4 -3
View File
@@ -272,13 +272,14 @@ func (s *span) interfaceArrayToMessageEventArray() []Event {
return messageEventArr
}
func (s *span) lruAttributesToAttributeMap() map[string]interface{} {
attributes := make(map[string]interface{})
func (s *span) lruAttributesToAttributeMap() []core.KeyValue {
attributes := make([]core.KeyValue, 0, s.lruAttributes.simpleLruMap.Len())
for _, key := range s.lruAttributes.simpleLruMap.Keys() {
value, ok := s.lruAttributes.simpleLruMap.Get(key)
if ok {
key := key.(core.Key)
attributes[key.Name] = value
value := value.(core.Value)
attributes = append(attributes, core.KeyValue{Key: key, Value: value})
}
}
return attributes
+16 -6
View File
@@ -186,9 +186,12 @@ func TestSetSpanAttributes(t *testing.T) {
TraceID: tid,
TraceOptions: 0x1,
},
ParentSpanID: sid,
Name: "span0",
Attributes: map[string]interface{}{"key1": core.Value{Type: core.STRING, String: "value1"}},
ParentSpanID: sid,
Name: "span0",
Attributes: []core.KeyValue{{
Key: core.Key{Name: "key1"},
Value: core.Value{Type: core.STRING, String: "value1"},
}},
HasRemoteParent: true,
}
if diff := cmp.Diff(got, want); diff != "" {
@@ -217,9 +220,16 @@ func TestSetSpanAttributesOverLimit(t *testing.T) {
},
ParentSpanID: sid,
Name: "span0",
Attributes: map[string]interface{}{
"key1": core.Value{Type: core.STRING, String: "value3"},
"key4": core.Value{Type: core.STRING, String: "value4"}},
Attributes: []core.KeyValue{
{
Key: core.Key{Name: "key1"},
Value: core.Value{Type: core.STRING, String: "value3"},
},
{
Key: core.Key{Name: "key4"},
Value: core.Value{Type: core.STRING, String: "value4"},
},
},
HasRemoteParent: true,
DroppedAttributeCount: 1,
}