Files
a81fd9a459 chore: remove MD009, MD010, MD012 exceptions (#15048)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Remove some markdownlint exceptions: trailing whitespace, hard tabs,
consecutive blank lines.

Mostly solved by running `markdownlint --fix .` after removing the
exceptions, with some manual changes to correct indentation in Go code
blocks.

Tabs are typical for actual Go code but I've replaced with two spaces
here - other option is just keeping the hard tabs exception in.

<!-- Issue number if applicable -->
#### Link to tracking issue
Partially fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/14731

#### Testing

* ran `markdownlint .` after removing rules and making fixes, verified
no issues

<!--Describe the documentation added.-->
#### Documentation

None. Modified existing documentation.

---------

Co-authored-by: Alex Boten <[email protected]>
2026-04-02 17:25:32 +00:00

1.3 KiB

OpenTelemetry Collector Middleware Configuration

This package implements a configuration struct for referring to middleware extensions.

Overview

The configmiddleware package defines a Config type that allows components to configure middleware extensions, typically as an ordered list. This support is built in for push-based receivers configured through confighttp and configgrpc, as for example in the OTLP receiver:

receivers:
  otlp:
    protocols:
      http:
        middlewares:
          - id: limitermiddleware

Methods

The package provides four key methods to retrieve appropriate middleware handlers:

  1. GetHTTPClientRoundTripper: Obtains a function to wrap an HTTP client with a middleware extension via a http.RoundTripper.

  2. GetHTTPServerHandler: Obtains a function to wrap an HTTP server with a middleware extension via a http.Handler.

  3. GetGRPCClientOptions: Obtains a []grpc.DialOption that configure a middleware extension for gRPC clients.

  4. GetGRPCServerOptions: Obtains a []grpc.ServerOption that configure a middleware extension for gRPC servers.

These functions are typically called during Start() by a component, passing the component.Host extensions. An error is returned if the named extension cannot be found.