Skip to content

Commit

Permalink
rename log struct
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzk1 committed Dec 29, 2024
1 parent bd606ce commit c575410
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions exporter/logzioexporter/from_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) 2018 Uber Technologies, Inc.
// SPDX-License-Identifier: Apache-2.0

package logzioexporter
package logzioexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/logzioexporter"

import (
"strings"
Expand Down Expand Up @@ -55,8 +55,8 @@ type process struct {
Tag map[string]any `json:"tag,omitempty"`
}

// log is a log emitted in a span
type log struct {
// spanLog is a log emitted in a span
type spanLog struct {
Timestamp uint64 `json:"timestamp"`
Fields []keyValue `json:"fields"`
}
Expand Down Expand Up @@ -91,7 +91,7 @@ type span struct {
Tags []keyValue `json:"tags"`
// Alternative representation of tags for better kibana support
Tag map[string]any `json:"tag,omitempty"`
Logs []log `json:"logs"`
Logs []spanLog `json:"logs"`
Process process `json:"process,omitempty"`
}

Expand Down Expand Up @@ -178,14 +178,14 @@ func (fd fromDomain) convertKeyValuesString(keyValues model.KeyValues) ([]keyVal
return kvs, tagsMap
}

func (fromDomain) convertLogs(logs []model.Log) []log {
out := make([]log, len(logs))
func (fromDomain) convertLogs(logs []model.Log) []spanLog {
out := make([]spanLog, len(logs))
for i, l := range logs {
var kvs []keyValue
for _, kv := range l.Fields {
kvs = append(kvs, convertKeyValue(kv))
}
out[i] = log{
out[i] = spanLog{
Timestamp: model.TimeAsEpochMicroseconds(l.Timestamp),
Fields: kvs,
}
Expand Down
2 changes: 1 addition & 1 deletion exporter/logzioexporter/logziospan.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type logzioSpan struct {
Duration uint64 `json:"duration"`
Tags []keyValue `json:"JaegerTags,omitempty"`
Tag map[string]any `json:"JaegerTag,omitempty"`
Logs []log `json:"logs"`
Logs []spanLog `json:"logs"`
Process process `json:"process,omitempty"`
Type string `json:"type"`
}
Expand Down

0 comments on commit c575410

Please sign in to comment.