From cdd7ad020e165fe680703b6d3319b908b682fb7a Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 20 Oct 2023 17:12:29 +0300 Subject: jaeger-client -> opentelemetry --- vendor/open-telemetry/exporter-otlp/Protocols.php | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 vendor/open-telemetry/exporter-otlp/Protocols.php (limited to 'vendor/open-telemetry/exporter-otlp/Protocols.php') diff --git a/vendor/open-telemetry/exporter-otlp/Protocols.php b/vendor/open-telemetry/exporter-otlp/Protocols.php new file mode 100644 index 000000000..96b04d8bf --- /dev/null +++ b/vendor/open-telemetry/exporter-otlp/Protocols.php @@ -0,0 +1,36 @@ + ContentTypes::PROTOBUF, + self::HTTP_PROTOBUF => ContentTypes::PROTOBUF, + self::HTTP_JSON => ContentTypes::JSON, + self::HTTP_NDJSON => ContentTypes::NDJSON, + ]; + + public static function validate(string $protocol): void + { + if (!array_key_exists($protocol, self::PROTOCOLS)) { + throw new UnexpectedValueException('Unknown protocol: ' . $protocol); + } + } + + public static function contentType(string $protocol): string + { + self::validate($protocol); + + return self::PROTOCOLS[$protocol]; + } +} -- cgit v1.2.3-54-g00ecf