Documentation
¶
Overview ¶
Package otelharpy provides middleware that instruments JSON-RPC servers with OpenTelemetry tracing and metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶ added in v0.6.1
type Metrics struct { // Next is the next exchanger in the middleware stack. Next harpy.Exchanger // MeterProvider is the OpenTelemetry MeterProvider used to create meters. MeterProvider metric.MeterProvider // ServiceName is an application specific service name to use in the span // name and attributes. // // It may be prefixed with a dot-separated "package name", for example // "myapp.test.EchoService". // // It may be empty, in which case it is omitted from the span. ServiceName string // contains filtered or unexported fields }
Metrics is an implementation of harpy.Exchanger that provides OpenTelemetry metrics for each JSON-RPC request.
type Tracing ¶ added in v0.6.0
type Tracing struct { // Next is the next exchanger in the middleware stack. Next harpy.Exchanger // TracerProvider is the OpenTelemetry TracerProvider to use for creating // spans. TracerProvider trace.TracerProvider // ServiceName is an application specific service name to use in the span // name and attributes. // // It may be prefixed with a dot-separated "package name", for example // "myapp.test.EchoService". // // It may be empty, in which case it is omitted from the span. ServiceName string // CreateNewSpan controls whether a new span is created for each request, or // JSON-RPC attributes are added to an existing span. // // By default it is assumed that the transport layer is responsibe for // creating the span, and no new span will be created. CreateNewSpan bool // contains filtered or unexported fields }
Tracing is an implementation of harpy.Exchanger that provides OpenTelemetry tracing for each JSON-RPC request.
It adheres to the OpenTelemetry RPC semantic conventions as specified in https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md.
Click to show internal directories.
Click to hide internal directories.