Package org.microproxy.otel
Class OtelLauncherExtension
java.lang.Object
org.microproxy.otel.OtelLauncherExtension
- All Implemented Interfaces:
LauncherExtension
Adds
--otel and its options to the command line when this module is on the class path.
OpenTelemetry's OTEL_* environment variables configure it first, and the options
override them; setting OTEL_EXPORTER_OTLP_ENDPOINT (or a signal's endpoint) turns it on
without --otel, and OTEL_SDK_DISABLED=true keeps it off.-
Constructor Summary
ConstructorsConstructorDescriptionCreates the extension, reading the process's environment.OtelLauncherExtension(Map<String, String> env) Creates the extension with another environment, for tests. -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(HttpProxyServerBootstrap bootstrap, PrintStream console) Applies the parsed options, after the built-in ones;HttpProxyServerBootstrap.getChainProxyManager()shows any upstream configuration to wrap.booleanparseOption(String option, Deque<String> args) Consumesoptionif it belongs to this extension, taking any values from the front ofargs.usage()Returns help lines for the options this extension adds, formatted like the built-in ones.
-
Constructor Details
-
OtelLauncherExtension
public OtelLauncherExtension()Creates the extension, reading the process's environment. -
OtelLauncherExtension
Creates the extension with another environment, for tests.- Parameters:
env- the environment variables
-
-
Method Details
-
usage
Description copied from interface:LauncherExtensionReturns help lines for the options this extension adds, formatted like the built-in ones.- Specified by:
usagein interfaceLauncherExtension- Returns:
- help lines for the options this extension adds, formatted like the built-in ones
-
parseOption
Description copied from interface:LauncherExtensionConsumesoptionif it belongs to this extension, taking any values from the front ofargs. Returns false for options it does not recognise.- Specified by:
parseOptionin interfaceLauncherExtension- Parameters:
option- the command-line option to parseargs- the remaining command-line arguments- Returns:
- whether this extension consumed the option
-
configure
Description copied from interface:LauncherExtensionApplies the parsed options, after the built-in ones;HttpProxyServerBootstrap.getChainProxyManager()shows any upstream configuration to wrap.- Specified by:
configurein interfaceLauncherExtension- Parameters:
bootstrap- the proxy configuration to extendconsole- the output stream for status messages and diagnostics
-