Skip to content

Commit

Permalink
Add comments to exported fields
Browse files Browse the repository at this point in the history
  • Loading branch information
damemi committed Aug 28, 2024
1 parent 9e3247b commit b8e9fff
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/pkg/instrumentation/probe/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,42 @@ import (

// Event is a telemetry event that happens within an instrumented package.
type Event struct {
// Package is the name of the instrumented package.
Package string
// Kind is the trace.SpanKind for the event.
Kind trace.SpanKind
// SpanEvents is a list of spans for this event.
SpanEvents []*SpanEvent
}

// Status represents the OpenTelemetry status code and description for a span.
type Status struct {
// Code is the OpenTelemetry status code for a span.
Code codes.Code
// Description is the string for this status.
Description string
}

// SpanEvent represents a probed span.
type SpanEvent struct {
// SpanName is the name of the span.
SpanName string
// Attributes is a list of OpenTelemetry attributes for the span.
Attributes []attribute.KeyValue
// StartTime is the start time for the span.
StartTime int64
// EndTime is the end time for the span.
EndTime int64
// SpanContext is the context for this span.
SpanContext *trace.SpanContext
// ParentSpanContext is the context for this span's parent (if applicable).
ParentSpanContext *trace.SpanContext
// Status is the status of this span.
Status Status
// TracerName is the name of the tracer associated with this span.
TracerName string
// TracerVersion is the version of the tracer associated with this span.
TracerVersion string
// TracerSchema is the schema for the tracer associated with this span.
TracerSchema string
}
4 changes: 4 additions & 0 deletions pkg/opentelemetry/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ package opentelemetry

import "go.opentelemetry.io/auto/pkg/probe"

// OpenTelemetryController is a controller that converts probe Events to
// OpenTelemetry spans and exports them.
type OpenTelemetryController interface {
// Trace receives a probe.Event and handles conversion to OpenTelemetry
// format and exporting.
Trace(event *probe.Event)
}
1 change: 1 addition & 0 deletions pkg/probe/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ package probe

import "go.opentelemetry.io/auto/internal/pkg/instrumentation/probe"

// Event represents a probed span event.
type Event = probe.Event

0 comments on commit b8e9fff

Please sign in to comment.