package
0.0.0-20231119072055-2de4230fa16d
Repository: https://github.com/opsramp/husky.git
Documentation: pkg.go.dev
# README
OTLP Translator
This module provides an easy to use way of converting OTLP requests into easily ingestible data structures (eg []map[string]interface{}
).
This makes consuming the OTLP wire format easier and more consistent.
### Traces
You can either provide the OTLP trace request directly or a HTTP request object that contains the request in the body.
// HTTP Request
ri := GetRequestInfoFromHttpHeaders(request.header) // (request.header http.Header)
res, err := TranslateHttpTraceRequest(request.body, ri) //(request.body io.Reader, ri RequestInfo)
// OTLP Trace gRPC
res, err := TranslateGrpcTraceRequest(request) // (request *collectorTrace.ExportTraceServiceRequest)
Common
The library also includes generic ways to extract request information (API Key, Dataset, etc).
// HTTP request
requestInfo := GetRequestInfoFromHttpHeaders(header) // (header http.Header)
// gRPC request context
requestInfo := GetRequestInfoFromGrpcMetadata(ctx) // (ctx context.Context)
# Functions
No description provided by the author
No description provided by the author
BytesToTraceID returns an ID suitable for use for spans and traces.
DetermineClassification returns a map of labels classifying the type of the span based on the predefined attributes in the span.
GetRequestInfoFromGrpcMetadata parses relevant gRPC metadata from an incoming request context.
GetRequestInfoFromHttpHeaders parses relevant incoming HTTP headers.
List of HTTP Content Encodings supported for OTLP ingest.
List of HTTP Content Types supported for OTLP ingest.
Check whether we support a given HTTP Content Type for OTLP.
No description provided by the author
TranslateLogsRequest translates an OTEL proto log request into Tracing Proxy friendly structure RequestInfo is the parsed information from the gRPC metadata.
TranslateLogsRequestFromReader translates an OTLP log request into Honeycomb-friendly structure from a reader (eg HTTP body) RequestInfo is the parsed information from the gRPC metadata.
TranslateTraceRequest translates an OTLP/gRPC request into OpsRamp-friendly structure RequestInfo is the parsed information from the gRPC metadata.
TranslateTraceRequestFromReader translates an OTLP/HTTP request into Honeycomb-friendly structure RequestInfo is the parsed information from the HTTP headers.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
No description provided by the author
ErrMissingAPIKeyHeader = OTLPError{"missing 'x-opsramp-team' header", http.StatusUnauthorized, codes.Unauthenticated}.
# Structs
Batch represents Honeycomb events grouped by their target dataset SizeBytes is the total byte size of the OTLP structure that represents this batch.
Event represents a single Honeycomb event.
No description provided by the author
RequestInfo represents information parsed from either HTTP headers or gRPC metadata.
TranslateOTLPRequestResult represents an OTLP request translated into Honeycomb-friendly structure RequestSize is total byte size of the entire OTLP request Batches represent events grouped by their target dataset.
TranslateTraceRequestResult represents an OTLP trace request translated into Opsramp-friendly structure RequestSize is total byte size of the entire OTLP request Batches represent events grouped by their target dataset.