<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Contrib on BeamFoundry Rays Fiber</title><link>https://rays.bfdy.dev/rays-fiber/docs/5-middlewares/contrib/</link><description>Recent content in Contrib on BeamFoundry Rays Fiber</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://rays.bfdy.dev/rays-fiber/docs/5-middlewares/contrib/index.xml" rel="self" type="application/rss+xml"/><item><title>Otel</title><link>https://rays.bfdy.dev/rays-fiber/docs/5-middlewares/contrib/1-otel/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rays.bfdy.dev/rays-fiber/docs/5-middlewares/contrib/1-otel/</guid><description>&lt;h1 id="otel-middleware"&gt;Otel Middleware&lt;a class="anchor" href="#otel-middleware"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;&lt;em&gt;📖 &lt;strong&gt;Official Go Fiber Documentation:&lt;/strong&gt; &lt;a href="https://docs.gofiber.io/contrib/otel/"&gt;https://docs.gofiber.io/contrib/otel/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;OpenTelemetry instrumentation middleware adapted from &lt;code&gt;github.com/gofiber/contrib/v3/otel&lt;/code&gt;.&lt;/p&gt;&#10;&lt;h2 id="installation"&gt;Installation&lt;a class="anchor" href="#installation"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;go get github.com/BeamFoundry/rays-fiber/pkg/middleware/contrib/otel&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="programmatic-configuration-interfaces"&gt;Programmatic Configuration Interfaces&lt;a class="anchor" href="#programmatic-configuration-interfaces"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;If your Controller or &lt;code&gt;FiberPathFilter&lt;/code&gt; implements any of the following methods, the &lt;code&gt;Otel&lt;/code&gt; middleware will automatically bind them:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;OtelNext() func(fiber.Ctx) bool&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelTracerProvider() oteltrace.TracerProvider&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelMeterProvider() otelmetric.MeterProvider&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelPropagators() propagation.TextMapPropagator&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelResponsePropagators() propagation.TextMapPropagator&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelPublicEndpointFn() func(fiber.Ctx) bool&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelSpanStartOptions() []oteltrace.SpanStartOption&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelSpanNameFormatter() func(fiber.Ctx) string&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelCustomAttributes() func(fiber.Ctx) []attribute.KeyValue&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelCustomResponseAttributes() func(fiber.Ctx) []attribute.KeyValue&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelCustomMetricAttributes() func(fiber.Ctx) []attribute.KeyValue&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelCustomResponseMetricAttributes() func(fiber.Ctx) []attribute.KeyValue&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;OtelOptions(options []otel.Option) []otel.Option&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="example-configuring-otel"&gt;Example: Configuring &lt;code&gt;Otel&lt;/code&gt;&lt;a class="anchor" href="#example-configuring-otel"&gt;&lt;/a&gt;&lt;/h3&gt;&#10;&lt;p&gt;Here is an example of a controller embedding the middleware and implementing the &lt;code&gt;OtelOptions&lt;/code&gt; interface to customize the underlying &lt;code&gt;otel.Option&lt;/code&gt; slice:&lt;/p&gt;</description></item></channel></rss>