Documentation ¶
Index ¶
- Constants
- Variables
- func AppendMetricData(dst *metricspb.Metric, elem *metricspb.Metric) *metricspb.Metric
- func AppendMetrics(dst []*metricspb.Metric, elems ...*metricspb.Metric) []*metricspb.Metric
- func AppendResourceLogs(dst []*logspb.ResourceLogs, elems ...*logspb.ResourceLogs) []*logspb.ResourceLogs
- func AppendResourceMetrics(dst []*metricspb.ResourceMetrics, elems ...*metricspb.ResourceMetrics) []*metricspb.ResourceMetrics
- func AppendResourceSpans(dst []*tracepb.ResourceSpans, elems ...*tracepb.ResourceSpans) []*tracepb.ResourceSpans
- func AppendScopeLogs(dst []*logspb.ScopeLogs, elems ...*logspb.ScopeLogs) []*logspb.ScopeLogs
- func AppendScopeMetrics(dst []*metricspb.ScopeMetrics, elems ...*metricspb.ScopeMetrics) []*metricspb.ScopeMetrics
- func AppendScopeSpans(dst []*tracepb.ScopeSpans, elems ...*tracepb.ScopeSpans) []*tracepb.ScopeSpans
- func EqualAttributes(attrs1 []*commonpb.KeyValue, attrs2 []*commonpb.KeyValue) bool
- func EqualMetric(metric1 *metricspb.Metric, metric2 *metricspb.Metric) bool
- func EqualResource(resource1 *resourcepb.Resource, resource2 *resourcepb.Resource) bool
- func EqualScope(scope1 *commonpb.InstrumentationScope, scope2 *commonpb.InstrumentationScope) bool
- func FilterResourceLogs(src []*logspb.ResourceLogs, ...) []*logspb.ResourceLogs
- func FilterResourceMetrics(src []*metricspb.ResourceMetrics, ...) []*metricspb.ResourceMetrics
- func FilterResourceSpans(src []*tracepb.ResourceSpans, ...) []*tracepb.ResourceSpans
- func HeadersFromContext(ctx context.Context) (http.Header, bool)
- func LogRecordInTimeRangeFilter(start, end time.Time) ...
- func MarshalIndentJSON(msg proto.Message, indent string) ([]byte, error)
- func MarshalJSON(msg proto.Message) ([]byte, error)
- func MetricDataPointInTimeRangeFilter(start, end time.Time) ...
- func PartitionByLogObservedTime(format string, tz *time.Location) func(*logspb.ResourceLogs) string
- func PartitionByLogSeverityNumber() func(*logspb.ResourceLogs) string
- func PartitionByLogSeverityText() func(*logspb.ResourceLogs) string
- func PartitionByLogTime(format string, tz *time.Location) func(*logspb.ResourceLogs) string
- func PartitionByMetricStartTime(format string, tz *time.Location) func(*metricspb.ResourceMetrics) string
- func PartitionByMetricTime(format string, tz *time.Location) func(*metricspb.ResourceMetrics) string
- func PartitionByMetricType() func(*metricspb.ResourceMetrics) string
- func PartitionBySpanEndTime(format string, tz *time.Location) func(*tracepb.ResourceSpans) string
- func PartitionBySpanStartTime(format string, tz *time.Location) func(*tracepb.ResourceSpans) string
- func PartitionResourceLogs(src []*logspb.ResourceLogs, getPartitionKey func(*logspb.ResourceLogs) string) map[string][]*logspb.ResourceLogs
- func PartitionResourceMetrics(src []*metricspb.ResourceMetrics, ...) map[string][]*metricspb.ResourceMetrics
- func PartitionResourceSpans(src []*tracepb.ResourceSpans, ...) map[string][]*tracepb.ResourceSpans
- func SpanInTimeRangeFilter(start, end time.Time) func(*resourcepb.Resource, *commonpb.InstrumentationScope, *tracepb.Span) bool
- func SplitResourceLogs(src []*logspb.ResourceLogs) []*logspb.ResourceLogs
- func SplitResourceMetrics(src []*metricspb.ResourceMetrics) []*metricspb.ResourceMetrics
- func SplitResourceSpans(src []*tracepb.ResourceSpans) []*tracepb.ResourceSpans
- func TotalDataPoints(src []*metricspb.ResourceMetrics) int
- func TotalLogRecords(src []*logspb.ResourceLogs) int
- func TotalSpans(src []*tracepb.ResourceSpans) int
- func UnmarshalJSON(data []byte, msg proto.Message) error
- type Client
- func (c *Client) Start(ctx context.Context) error
- func (c *Client) Stop(ctx context.Context) error
- func (c *Client) UploadLogs(ctx context.Context, protoLogs []*ResourceLogs) error
- func (c *Client) UploadMetrics(ctx context.Context, protoMetrics []*ResourceMetrics) error
- func (c *Client) UploadTraces(ctx context.Context, protoSpans []*ResourceSpans) error
- type ClientOption
- func ClientOptionsWithFlagSet(fs *flag.FlagSet, flagPrefix string, envPrefixes ...string) ClientOption
- func DefaultClientOptions(envPrefixes ...string) ClientOption
- func WithEndpoint(endpoint string) ClientOption
- func WithExportTimeout(exportTimeout time.Duration) ClientOption
- func WithGzip(gzip bool) ClientOption
- func WithHTTPClient(httpClient *http.Client) ClientOption
- func WithHeaders(headers map[string]string) ClientOption
- func WithHeadersString(headers string) ClientOption
- func WithLogger(logger *slog.Logger) ClientOption
- func WithLogsEndpoint(endpoint string) ClientOption
- func WithLogsExportTimeout(exportTimeout time.Duration) ClientOption
- func WithLogsGzip(gzip bool) ClientOption
- func WithLogsHTTPClient(httpClient *http.Client) ClientOption
- func WithLogsHeaders(headers map[string]string) ClientOption
- func WithLogsHeadersString(headers string) ClientOption
- func WithLogsProtocol(protocol string) ClientOption
- func WithLogsUserAgent(userAgent string) ClientOption
- func WithMetricsEndpoint(endpoint string) ClientOption
- func WithMetricsExportTimeout(exportTimeout time.Duration) ClientOption
- func WithMetricsGzip(gzip bool) ClientOption
- func WithMetricsHTTPClient(httpClient *http.Client) ClientOption
- func WithMetricsHeaders(headers map[string]string) ClientOption
- func WithMetricsHeadersString(headers string) ClientOption
- func WithMetricsProtocol(protocol string) ClientOption
- func WithMetricsUserAgent(userAgent string) ClientOption
- func WithProtocol(protocol string) ClientOption
- func WithTracesEndpoint(endpoint string) ClientOption
- func WithTracesExportTimeout(exportTimeout time.Duration) ClientOption
- func WithTracesGzip(gzip bool) ClientOption
- func WithTracesHTTPClient(httpClient *http.Client) ClientOption
- func WithTracesHeaders(headers map[string]string) ClientOption
- func WithTracesHeadersString(headers string) ClientOption
- func WithTracesProtocol(protocol string) ClientOption
- func WithTracesUserAgent(userAgent string) ClientOption
- func WithUserAgent(userAgent string) ClientOption
- type JSONDecoder
- type JSONEncoder
- type LogsEntry
- type LogsHandler
- type LogsHandlerFunc
- type LogsMiddlewareFunc
- type LogsRequest
- type LogsResponse
- type MetricsEntry
- type MetricsHandler
- type MetricsHandlerFunc
- type MetricsMiddlewareFunc
- type MetricsRequest
- type MetricsResponse
- type MiddlewareFunc
- type ProtoHandlerFunc
- type ResourceLogs
- type ResourceMetrics
- type ResourceSpans
- type ServerMux
- func (mux *ServerMux) Logs() LogsEntry
- func (mux *ServerMux) Metrics() MetricsEntry
- func (mux *ServerMux) Register(reg grpc.ServiceRegistrar)
- func (mux *ServerMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (mux *ServerMux) SetLogger(logger *slog.Logger)
- func (mux *ServerMux) Trace() TraceEntry
- func (mux *ServerMux) Use(m ...MiddlewareFunc) *ServerMux
- type TraceEntry
- type TraceHandler
- type TraceHandlerFunc
- type TraceMiddlewareFunc
- type TraceRequest
- type TraceResponse
- type UploadLogsPartialSuccessError
- type UploadMetricsPartialSuccessError
- type UploadTracesPartialSuccessError
Constants ¶
const ( Yearly = "2006" Monthly = "2006/01" Daily = "2006/01/02" Hourly = "2006/01/02/15" )
Variables ¶
var ( ErrAlreadyClosed = errors.New("already closed") ErrNotStarted = errors.New("not started") )
var AllowedProtocols = allowedProtocols
AllowedProtocols is the list of allowed protocol values.
var DefaultServerMux = NewServerMux()
Functions ¶
func AppendMetricData ¶ added in v0.3.0
func AppendMetrics ¶ added in v0.3.0
func AppendResourceLogs ¶ added in v0.3.0
func AppendResourceLogs(dst []*logspb.ResourceLogs, elems ...*logspb.ResourceLogs) []*logspb.ResourceLogs
func AppendResourceMetrics ¶ added in v0.3.0
func AppendResourceMetrics(dst []*metricspb.ResourceMetrics, elems ...*metricspb.ResourceMetrics) []*metricspb.ResourceMetrics
AppendResourceMetrics converts a list of ResourceMetrics into a list of ResourceMetrics with unique resources.
func AppendResourceSpans ¶ added in v0.3.0
func AppendResourceSpans(dst []*tracepb.ResourceSpans, elems ...*tracepb.ResourceSpans) []*tracepb.ResourceSpans
AppendResourceSpans converts a list of ResourceSpans into a list of ResourceSpans with unique resources.
func AppendScopeLogs ¶ added in v0.3.0
func AppendScopeMetrics ¶ added in v0.3.0
func AppendScopeMetrics(dst []*metricspb.ScopeMetrics, elems ...*metricspb.ScopeMetrics) []*metricspb.ScopeMetrics
func AppendScopeSpans ¶ added in v0.3.0
func AppendScopeSpans(dst []*tracepb.ScopeSpans, elems ...*tracepb.ScopeSpans) []*tracepb.ScopeSpans
func EqualAttributes ¶ added in v0.3.0
func EqualMetric ¶ added in v0.3.0
func EqualResource ¶ added in v0.3.0
func EqualResource(resource1 *resourcepb.Resource, resource2 *resourcepb.Resource) bool
func EqualScope ¶ added in v0.3.0
func EqualScope(scope1 *commonpb.InstrumentationScope, scope2 *commonpb.InstrumentationScope) bool
func FilterResourceLogs ¶ added in v0.4.0
func FilterResourceLogs(src []*logspb.ResourceLogs, filters ...func(*resourcepb.Resource, *commonpb.InstrumentationScope, *logspb.LogRecord) bool) []*logspb.ResourceLogs
FilterResourceLogs filters the given ResourceLogs slice based on the given filter function.
func FilterResourceMetrics ¶ added in v0.4.0
func FilterResourceMetrics(src []*metricspb.ResourceMetrics, filters ...func(*resourcepb.Resource, *commonpb.InstrumentationScope, *metricspb.Metric) bool) []*metricspb.ResourceMetrics
FilterResourceMetrics filters the given ResourceMetrics slice based on the given filter function.
func FilterResourceSpans ¶ added in v0.4.0
func FilterResourceSpans(src []*tracepb.ResourceSpans, filters ...func(*resourcepb.Resource, *commonpb.InstrumentationScope, *tracepb.Span) bool) []*tracepb.ResourceSpans
FilterResourceSpans filters the given ResourceSpans slice based on the given filter function.
func LogRecordInTimeRangeFilter ¶ added in v0.4.0
func LogRecordInTimeRangeFilter(start, end time.Time) func(*resourcepb.Resource, *commonpb.InstrumentationScope, *logspb.LogRecord) bool
func MarshalIndentJSON ¶ added in v0.2.4
MarshalIndentJSON marshals a proto.Message to indented JSON bytes. for OTLP, traceID and spanID are converted from base64 to hex.
func MarshalJSON ¶ added in v0.2.4
MarshalJSON marshals a proto.Message to JSON bytes. for OTLP, traceID and spanID are converted from base64 to hex.
func MetricDataPointInTimeRangeFilter ¶ added in v0.4.0
func MetricDataPointInTimeRangeFilter(start, end time.Time) func(*resourcepb.Resource, *commonpb.InstrumentationScope, *metricspb.Metric) bool
MetricInTimeRangeFilter returns a filter function that filters metrics based on the given time range.
func PartitionByLogObservedTime ¶ added in v0.3.0
PartitionByLogObservedTime returns a function that partitions ResourceLogs by Log observation time.
func PartitionByLogSeverityNumber ¶ added in v0.3.0
func PartitionByLogSeverityNumber() func(*logspb.ResourceLogs) string
PartitionByLogSeverityNumber returns a function that partitions ResourceLogs by Log severity number.
func PartitionByLogSeverityText ¶ added in v0.3.0
func PartitionByLogSeverityText() func(*logspb.ResourceLogs) string
PartitionByLogSeverityText returns a function that partitions ResourceLogs by Log severity text.
func PartitionByLogTime ¶ added in v0.3.0
PartitionByLogTime returns a function that partitions ResourceLogs by Log time.
func PartitionByMetricStartTime ¶ added in v0.3.0
func PartitionByMetricStartTime(format string, tz *time.Location) func(*metricspb.ResourceMetrics) string
PartitionByMetricStartTime returns a function that partitions ResourceMetrics by Metric start time.
func PartitionByMetricTime ¶ added in v0.3.0
func PartitionByMetricTime(format string, tz *time.Location) func(*metricspb.ResourceMetrics) string
PartitionByMetricTime returns a function that partitions ResourceMetrics by Metric time.
func PartitionByMetricType ¶ added in v0.3.0
func PartitionByMetricType() func(*metricspb.ResourceMetrics) string
func PartitionBySpanEndTime ¶ added in v0.3.0
PartitionBySpanEndTime returns a function that partitions ResourceSpans by Span end time.
func PartitionBySpanStartTime ¶ added in v0.3.0
PartitionBySpanStartTime returns a function that partitions ResourceSpans by Span start time.
func PartitionResourceLogs ¶ added in v0.3.0
func PartitionResourceLogs(src []*logspb.ResourceLogs, getPartitionKey func(*logspb.ResourceLogs) string) map[string][]*logspb.ResourceLogs
PartitionResourceLogs partitions the given ResourceLogs slice into multiple ResourceLogs slices, each containing only one log record, based on the given partition key.
func PartitionResourceMetrics ¶ added in v0.3.0
func PartitionResourceMetrics(src []*metricspb.ResourceMetrics, getPartitionKey func(*metricspb.ResourceMetrics) string) map[string][]*metricspb.ResourceMetrics
PartitionResourceMetrics partitions the given ResourceMetrics slice into multiple ResourceMetrics slices, each containing only one data point, based on the given partition key.
func PartitionResourceSpans ¶ added in v0.3.0
func PartitionResourceSpans(src []*tracepb.ResourceSpans, getPartitionKey func(*tracepb.ResourceSpans) string) map[string][]*tracepb.ResourceSpans
PartitionResourceSpans partitions the given ResourceSpans slice into multiple ResourceSpans slices, each containing only one Span, based on the given partition key.
func SpanInTimeRangeFilter ¶ added in v0.4.0
func SpanInTimeRangeFilter(start, end time.Time) func(*resourcepb.Resource, *commonpb.InstrumentationScope, *tracepb.Span) bool
SpanInTimeRangeFilter returns a filter function that filters spans based on the given time range.
func SplitResourceLogs ¶ added in v0.3.0
func SplitResourceLogs(src []*logspb.ResourceLogs) []*logspb.ResourceLogs
SplitResourceLogs splits the given ResourceLogs slice into multiple ResourceLogs slices, each containing only one log record.
func SplitResourceMetrics ¶ added in v0.3.0
func SplitResourceMetrics(src []*metricspb.ResourceMetrics) []*metricspb.ResourceMetrics
SplitResourceMetrics splits the given ResourceMetrics slice into multiple ResourceMetrics slices, each containing only one data point.
func SplitResourceSpans ¶ added in v0.3.0
func SplitResourceSpans(src []*tracepb.ResourceSpans) []*tracepb.ResourceSpans
SplitResourceSpans splits the given ResourceSpans slice into multiple ResourceSpans slices, each containing only one Span.
func TotalDataPoints ¶ added in v0.3.0
func TotalDataPoints(src []*metricspb.ResourceMetrics) int
TotalDataPoints returns the total number of data points in the given ResourceMetrics slice.
func TotalLogRecords ¶ added in v0.3.0
func TotalLogRecords(src []*logspb.ResourceLogs) int
TotalLogRecords returns the total number of log records in the given ResourceLogs slice.
func TotalSpans ¶ added in v0.3.0
func TotalSpans(src []*tracepb.ResourceSpans) int
TotalSpans returns the total number of spans in the given ResourceSpans slice.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is OTLP Low-Level Client
func (*Client) UploadLogs ¶
func (c *Client) UploadLogs(ctx context.Context, protoLogs []*ResourceLogs) error
func (*Client) UploadMetrics ¶
func (c *Client) UploadMetrics(ctx context.Context, protoMetrics []*ResourceMetrics) error
func (*Client) UploadTraces ¶
func (c *Client) UploadTraces(ctx context.Context, protoSpans []*ResourceSpans) error
type ClientOption ¶
type ClientOption func(*clientOptions) error
func ClientOptionsWithFlagSet ¶ added in v0.2.1
func ClientOptionsWithFlagSet(fs *flag.FlagSet, flagPrefix string, envPrefixes ...string) ClientOption
ClientOptionsWithFlagSet returns the client options from the flag set.
func DefaultClientOptions ¶
func DefaultClientOptions(envPrefixes ...string) ClientOption
DefaultClientOptions returns the default client options from the environment variables. see https://opentelemetry.io/docs/specs/otel/protocol/exporter e.g. envPrefixes = []string{"OTEL_EXPORTER_"} OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
func WithEndpoint ¶
func WithEndpoint(endpoint string) ClientOption
WithEndpoint sets the endpoint to be used with the request.
func WithExportTimeout ¶
func WithExportTimeout(exportTimeout time.Duration) ClientOption
WithExportTimeout sets the timeout to be used with the request.
func WithGzip ¶
func WithGzip(gzip bool) ClientOption
WithGzip sets the gzip compression to be used with the request.
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient sets the http client to be used with the request.
func WithHeaders ¶
func WithHeaders(headers map[string]string) ClientOption
WithHeaders sets the headers to be sent with the request.
func WithHeadersString ¶ added in v0.2.1
func WithHeadersString(headers string) ClientOption
WithHeadersString sets the headers to be sent with the request. e.g. "key1=value1,key2=value2"
func WithLogger ¶
func WithLogger(logger *slog.Logger) ClientOption
WithLogger sets the logger to be used with the request.
func WithLogsEndpoint ¶
func WithLogsEndpoint(endpoint string) ClientOption
WithLogsEndpoint sets the endpoint to be used with the log request. by default, the endpoint is shared with all signals.
func WithLogsExportTimeout ¶
func WithLogsExportTimeout(exportTimeout time.Duration) ClientOption
WithLogsExportTimeout sets the timeout to be used with the log request. by default, the timeout is shared with all signals.
func WithLogsGzip ¶
func WithLogsGzip(gzip bool) ClientOption
WithLogsGzip sets the gzip compression to be used with the log request. by default, the gzip compression is shared with all signals.
func WithLogsHTTPClient ¶
func WithLogsHTTPClient(httpClient *http.Client) ClientOption
WithLogsHTTPClient sets the http client to be used with the log request. by default, the http client is shared with all signals.
func WithLogsHeaders ¶
func WithLogsHeaders(headers map[string]string) ClientOption
WithLogsHeaders sets the headers to be sent with the log request. by default, the headers are shared with all signals.
func WithLogsHeadersString ¶ added in v0.2.1
func WithLogsHeadersString(headers string) ClientOption
WithLogsHeadersString sets the headers to be sent with the log request. by default, the headers are shared with all signals. e.g. "key1=value1,key2=value2"
func WithLogsProtocol ¶
func WithLogsProtocol(protocol string) ClientOption
WithLogsProtocol sets the protocol to be used with the log request. by default, the protocol is shared with all signals.
func WithLogsUserAgent ¶
func WithLogsUserAgent(userAgent string) ClientOption
WithLogsUserAgent sets the user agent to be sent with the log request. by default, the user agent is shared with all signals.
func WithMetricsEndpoint ¶
func WithMetricsEndpoint(endpoint string) ClientOption
WithMetricsEndpoint sets the endpoint to be used with the metrics request. by default, the endpoint is shared with all signals.
func WithMetricsExportTimeout ¶
func WithMetricsExportTimeout(exportTimeout time.Duration) ClientOption
WithMetricsExportTimeout sets the timeout to be used with the metrics request. by default, the timeout is shared with all signals.
func WithMetricsGzip ¶
func WithMetricsGzip(gzip bool) ClientOption
WithMetricsGzip sets the gzip compression to be used with the metrics request. by default, the gzip compression is shared with all signals.
func WithMetricsHTTPClient ¶
func WithMetricsHTTPClient(httpClient *http.Client) ClientOption
WithMetricsHTTPClient sets the http client to be used with the metrics request. by default, the http client is shared with all signals.
func WithMetricsHeaders ¶
func WithMetricsHeaders(headers map[string]string) ClientOption
WithMetricsHeaders sets the headers to be sent with the metrics request. by default, the headers are shared with all signals.
func WithMetricsHeadersString ¶ added in v0.2.1
func WithMetricsHeadersString(headers string) ClientOption
WithMetricsHeadersString sets the headers to be sent with the metrics request. by default, the headers are shared with all signals. e.g. "key1=value1,key2=value2"
func WithMetricsProtocol ¶
func WithMetricsProtocol(protocol string) ClientOption
WithMetricsProtocol sets the protocol to be used with the metrics request. by default, the protocol is shared with all signals.
func WithMetricsUserAgent ¶
func WithMetricsUserAgent(userAgent string) ClientOption
WithMetricsUserAgent sets the user agent to be sent with the metrics request. by default, the user agent is shared with all signals.
func WithProtocol ¶
func WithProtocol(protocol string) ClientOption
WithProtocol sets the protocol to be used with the request.
func WithTracesEndpoint ¶
func WithTracesEndpoint(endpoint string) ClientOption
WithTracesEndpoint sets the endpoint to be used with the trace request. by default, the endpoint is shared with all signals.
func WithTracesExportTimeout ¶
func WithTracesExportTimeout(exportTimeout time.Duration) ClientOption
WithTracesExportTimeout sets the timeout to be used with the trace request. by default, the timeout is shared with all signals.
func WithTracesGzip ¶
func WithTracesGzip(gzip bool) ClientOption
WithTracesGzip sets the gzip compression to be used with the trace request. by default, the gzip compression is shared with all signals.
func WithTracesHTTPClient ¶
func WithTracesHTTPClient(httpClient *http.Client) ClientOption
WithTracesHTTPClient sets the http client to be used with the trace request. by default, the http client is shared with all signals.
func WithTracesHeaders ¶
func WithTracesHeaders(headers map[string]string) ClientOption
WithTracesHeaders sets the headers to be sent with the trace request. by default, the headers are shared with all signals.
func WithTracesHeadersString ¶ added in v0.2.1
func WithTracesHeadersString(headers string) ClientOption
WithTracesHeadersString sets the headers to be sent with the trace request. by default, the headers are shared with all signals. e.g. "key1=value1,key2=value2"
func WithTracesProtocol ¶
func WithTracesProtocol(protocol string) ClientOption
WithTracesProtocol sets the protocol to be used with the trace request. by default, the protocol is shared with all signals.
func WithTracesUserAgent ¶
func WithTracesUserAgent(userAgent string) ClientOption
WithTracesUserAgent sets the user agent to be sent with the trace request. by default, the user agent is shared with all signals.
func WithUserAgent ¶
func WithUserAgent(userAgent string) ClientOption
WithUserAgent sets the user agent to be sent with the request.
type JSONDecoder ¶ added in v0.2.4
type JSONDecoder struct {
// contains filtered or unexported fields
}
func NewJSONDecoder ¶ added in v0.2.4
func NewJSONDecoder(reader io.Reader) *JSONDecoder
func (*JSONDecoder) More ¶ added in v0.2.4
func (d *JSONDecoder) More() bool
type JSONEncoder ¶ added in v0.2.4
type JSONEncoder struct {
// contains filtered or unexported fields
}
func NewJSONEncoder ¶ added in v0.2.4
func NewJSONEncoder(writer io.Writer) *JSONEncoder
func (*JSONEncoder) SetIndent ¶ added in v0.2.4
func (e *JSONEncoder) SetIndent(indent string)
type LogsEntry ¶
type LogsEntry interface { Handle(handler LogsHandler) HandleFunc(handler func(ctx context.Context, request *LogsRequest) (*LogsResponse, error)) Use(m ...LogsMiddlewareFunc) LogsEntry }
type LogsHandler ¶
type LogsHandler interface {
HandleLogs(ctx context.Context, request *LogsRequest) (*LogsResponse, error)
}
type LogsHandlerFunc ¶
type LogsHandlerFunc func(ctx context.Context, request *LogsRequest) (*LogsResponse, error)
func (LogsHandlerFunc) HandleLogs ¶
func (f LogsHandlerFunc) HandleLogs(ctx context.Context, request *LogsRequest) (*LogsResponse, error)
type LogsMiddlewareFunc ¶
type LogsMiddlewareFunc func(next LogsHandler) LogsHandler
type LogsRequest ¶
type LogsRequest = logspb.ExportLogsServiceRequest
type LogsResponse ¶
type LogsResponse = logspb.ExportLogsServiceResponse
type MetricsEntry ¶
type MetricsEntry interface { Handle(handler MetricsHandler) HandleFunc(handler func(ctx context.Context, request *MetricsRequest) (*MetricsResponse, error)) Use(m ...MetricsMiddlewareFunc) MetricsEntry }
type MetricsHandler ¶
type MetricsHandler interface {
HandleMetrics(ctx context.Context, request *MetricsRequest) (*MetricsResponse, error)
}
type MetricsHandlerFunc ¶
type MetricsHandlerFunc func(ctx context.Context, request *MetricsRequest) (*MetricsResponse, error)
func (MetricsHandlerFunc) HandleMetrics ¶
func (f MetricsHandlerFunc) HandleMetrics(ctx context.Context, request *MetricsRequest) (*MetricsResponse, error)
type MetricsMiddlewareFunc ¶
type MetricsMiddlewareFunc func(next MetricsHandler) MetricsHandler
type MetricsRequest ¶
type MetricsRequest = metricspb.ExportMetricsServiceRequest
type MetricsResponse ¶
type MetricsResponse = metricspb.ExportMetricsServiceResponse
type MiddlewareFunc ¶
type MiddlewareFunc func(next ProtoHandlerFunc) ProtoHandlerFunc
type ProtoHandlerFunc ¶
type ResourceLogs ¶
type ResourceLogs = logspb.ResourceLogs
type ResourceMetrics ¶
type ResourceMetrics = metricspb.ResourceMetrics
type ResourceSpans ¶
type ResourceSpans = tracepb.ResourceSpans
type ServerMux ¶
type ServerMux struct {
// contains filtered or unexported fields
}
func NewServerMux ¶
func NewServerMux() *ServerMux
func (*ServerMux) Metrics ¶
func (mux *ServerMux) Metrics() MetricsEntry
func (*ServerMux) Register ¶
func (mux *ServerMux) Register(reg grpc.ServiceRegistrar)
func (*ServerMux) ServeHTTP ¶
func (mux *ServerMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ServerMux) Trace ¶
func (mux *ServerMux) Trace() TraceEntry
func (*ServerMux) Use ¶
func (mux *ServerMux) Use(m ...MiddlewareFunc) *ServerMux
type TraceEntry ¶
type TraceEntry interface { Handle(handler TraceHandler) HandleFunc(handler func(ctx context.Context, request *TraceRequest) (*TraceResponse, error)) Use(m ...TraceMiddlewareFunc) TraceEntry }
type TraceHandler ¶
type TraceHandler interface {
HandleTrace(ctx context.Context, request *TraceRequest) (*TraceResponse, error)
}
TraceHandler is an interface that must be implemented by the user of the Server to handle trace requests.
type TraceHandlerFunc ¶
type TraceHandlerFunc func(ctx context.Context, request *TraceRequest) (*TraceResponse, error)
TraceHandlerFunc is a function type that implements the TraceHandler interface.
func (TraceHandlerFunc) HandleTrace ¶
func (f TraceHandlerFunc) HandleTrace(ctx context.Context, request *TraceRequest) (*TraceResponse, error)
type TraceMiddlewareFunc ¶
type TraceMiddlewareFunc func(next TraceHandler) TraceHandler
type TraceRequest ¶
type TraceRequest = tracepb.ExportTraceServiceRequest
type TraceResponse ¶
type TraceResponse = tracepb.ExportTraceServiceResponse
type UploadLogsPartialSuccessError ¶
type UploadLogsPartialSuccessError struct {
// contains filtered or unexported fields
}
func (*UploadLogsPartialSuccessError) Error ¶
func (e *UploadLogsPartialSuccessError) Error() string
func (*UploadLogsPartialSuccessError) Response ¶
func (e *UploadLogsPartialSuccessError) Response() *collogspb.ExportLogsServiceResponse
type UploadMetricsPartialSuccessError ¶
type UploadMetricsPartialSuccessError struct {
// contains filtered or unexported fields
}
func (*UploadMetricsPartialSuccessError) Error ¶
func (e *UploadMetricsPartialSuccessError) Error() string
func (*UploadMetricsPartialSuccessError) Response ¶
func (e *UploadMetricsPartialSuccessError) Response() *colmetricpb.ExportMetricsServiceResponse
type UploadTracesPartialSuccessError ¶
type UploadTracesPartialSuccessError struct {
// contains filtered or unexported fields
}
func (*UploadTracesPartialSuccessError) Error ¶
func (e *UploadTracesPartialSuccessError) Error() string
func (*UploadTracesPartialSuccessError) Response ¶
func (e *UploadTracesPartialSuccessError) Response() *coltracepb.ExportTraceServiceResponse