public TextMapPropagationRegistry(IHeadersConfig headersConfig)
        {
            var textPropagator = TextMapPropagator.NewTextMapPropagator(headersConfig);

            AddCodec(BuiltinFormats.TextMap, textPropagator, textPropagator);

            var httpHeaderPropagator = TextMapPropagator.NewHTTPHeaderPropagator(headersConfig);

            AddCodec(BuiltinFormats.HttpHeaders, httpHeaderPropagator, httpHeaderPropagator);
        }
Esempio n. 2
0
 public static TextMapPropagator NewHTTPHeaderPropagator(IHeadersConfig headersConfig)
 {
     return(new TextMapPropagator(headersConfig, HttpUtility.UrlEncode, HttpUtility.UrlDecode));
 }
Esempio n. 3
0
 public static TextMapPropagator NewTextMapPropagator(IHeadersConfig headersConfig)
 {
     return(new TextMapPropagator(headersConfig, (val) => val, (val) => val));
 }
Esempio n. 4
0
 public TextMapPropagator(IHeadersConfig headersConfig, Func <string, string> encodeValue, Func <string, string> decodeValue)
 {
     _headersConfig = headersConfig ?? throw new ArgumentNullException(nameof(headersConfig));
     _encodeValue   = encodeValue ?? throw new ArgumentNullException(nameof(encodeValue));
     _decodeValue   = decodeValue ?? throw new ArgumentNullException(nameof(decodeValue));
 }