How to use the @creditkarma/thrift-server-core.formatUrl function in @creditkarma/thrift-server-core

To help you get started, we’ve selected a few @creditkarma/thrift-server-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github creditkarma / thrift-server / packages / zipkin-tracing-hapi / src / main / ZipkinTracingHapi.ts View on Github external
return tracer.scoped(() => {
                        const traceId: TraceId = instrumentation.recordRequest(
                            requestMethod,
                            Core.formatUrl(url.format(request.url)),
                            (header: string): option.IOption => {
                                const val = normalHeaders[header.toLowerCase()]
                                if (val !== null && val !== undefined) {
                                    return new option.Some(val)
                                } else {
                                    return option.None
                                }
                            },
                        )

                        const traceHeaders: Core.IRequestHeaders = headersForTraceId(
                            traceId,
                        )

                        // Update headers on request object
                        for (const key in traceHeaders) {
github creditkarma / thrift-server / packages / thrift-client-zipkin-filter / src / main / ThriftClientZipkinFilter.ts View on Github external
return tracer.scoped(() => {
                    const updatedHeaders: IRequestHeaders = instrumentation.recordRequest(
                        { headers: {} },
                        formatUrl(request.uri),
                        request.methodName || '',
                    ).headers

                    const traceId: TraceId = tracer.id
                    const withLD5Headers: IRequestHeaders = applyL5DHeaders(
                        requestHeaders,
                        updatedHeaders,
                    )

                    return next(request.data, { headers: withLD5Headers }).then(
                        (res: IRequestResponse) => {
                            instrumentation.recordResponse(
                                traceId as any,
                                `${res.statusCode}`,
                            )
                            return res
github creditkarma / thrift-server / packages / thrift-client-ttwitter-filter / src / main / ThriftClientTTwitterFilter.ts View on Github external
return tracer.scoped(() => {
                            const {
                                headers,
                            }: any = instrumentation.recordRequest(
                                { headers: {} },
                                formatUrl(request.uri),
                                request.methodName || 'post',
                            )

                            const normalHeaders: any = Object.keys(
                                headers,
                            ).reduce((acc: any, name: string) => {
                                acc[name.toLowerCase()] = headers[name]
                                return acc
                            }, {})

                            const requestHeader: TTwitter.IRequestHeader = {
                                trace_id: new Int64(
                                    `0x${normalHeaders[ZipkinHeaders.TraceId]}`,
                                ),
                                span_id: new Int64(
                                    `0x${normalHeaders[ZipkinHeaders.SpanId]}`,