Skip to content

Commit

Permalink
chore: fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Nov 20, 2023
1 parent 8600fdf commit 422e2db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/chotel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func main() {
})
}

// App is the trace exporter application.
type App struct {
log *zap.Logger
metrics *app.Metrics
Expand All @@ -64,6 +65,7 @@ const DDL = `CREATE TABLE IF NOT EXISTS opentelemetry_span_export
TTL toStartOfMinute(exported_at) + INTERVAL 10 MINUTE
`

// NewApp initializes the trace exporter application.
func NewApp(logger *zap.Logger, metrics *app.Metrics) (*App, error) {
a := &App{
log: logger,
Expand All @@ -81,6 +83,7 @@ func NewApp(logger *zap.Logger, metrics *app.Metrics) (*App, error) {
return a, nil
}

// Run starts and runs the application.
func (a *App) Run(ctx context.Context) error {
ctx = zctx.Base(ctx, a.log)
if err := a.setup(ctx); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions integration/chotele2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type randomIDGenerator struct {
}

// NewSpanID returns a non-zero span ID from a randomly-chosen sequence.
func (gen *randomIDGenerator) NewSpanID(ctx context.Context, traceID trace.TraceID) (sid trace.SpanID) {
func (gen *randomIDGenerator) NewSpanID(context.Context, trace.TraceID) (sid trace.SpanID) {
gen.Lock()
defer gen.Unlock()
gen.rand.Read(sid[:])
Expand All @@ -39,7 +39,7 @@ func (gen *randomIDGenerator) NewSpanID(ctx context.Context, traceID trace.Trace

// NewIDs returns a non-zero trace ID and a non-zero span ID from a
// randomly-chosen sequence.
func (gen *randomIDGenerator) NewIDs(ctx context.Context) (tid trace.TraceID, sid trace.SpanID) {
func (gen *randomIDGenerator) NewIDs(context.Context) (tid trace.TraceID, sid trace.SpanID) {
gen.Lock()
defer gen.Unlock()
gen.rand.Read(tid[:])
Expand Down
5 changes: 5 additions & 0 deletions internal/chtrace/chtrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Table struct {
Attributes proto.ColMap[string, string] // attribute
}

// Rows returns Trace per row.
func (t Table) Rows() []Trace {
var out []Trace
for i := 0; i < t.TraceID.Rows(); i++ {
Expand All @@ -40,6 +41,7 @@ func (t Table) Rows() []Trace {
return out
}

// Trace is a single trace span.
type Trace struct {
TraceID trace.TraceID
SpanID trace.SpanID
Expand All @@ -50,6 +52,7 @@ type Trace struct {
Attributes map[string]string
}

// Result returns proto.Results for Table.
func (t *Table) Result() proto.Results {
return proto.Results{
{Name: "trace_id", Data: &t.TraceID},
Expand All @@ -63,6 +66,7 @@ func (t *Table) Result() proto.Results {
}
}

// Columns returns column names (and mappings) for doing SELECTS.
func (t *Table) Columns() []string {
var out []string
for _, v := range t.Result() {
Expand All @@ -78,6 +82,7 @@ func (t *Table) Columns() []string {
return out
}

// NewTable creates and initializes new Table.
func NewTable() *Table {
return &Table{
OperationName: new(proto.ColStr).LowCardinality(),
Expand Down

0 comments on commit 422e2db

Please sign in to comment.