How to use @creditkarma/thrift-client-zipkin-filter - 6 common examples

To help you get started, we’ve selected a few @creditkarma/thrift-client-zipkin-filter 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 / thrift-server-ecosystem / src / calculator-service.ts View on Github external
async function init(): Promise {
    const SERVER_CONFIG = await config().get('calculator-service')
    const ADD_SERVER_CONFIG = await config().get('add-service')

    // Create thrift client
    const thriftClient: AddService.Client = createHttpClient(
        AddService.Client,
        {
            hostName: ADD_SERVER_CONFIG.host,
            port: ADD_SERVER_CONFIG.port,
            register: [
                ThriftClientZipkinFilter({
                    localServiceName: 'calculator-service',
                    remoteServiceName: 'add-service',
                    tracerConfig: {
                        endpoint: 'http://localhost:9411/api/v1/spans',
                        httpInterval: 1000,
                        httpTimeout: 5000,
                        sampleRate: 1.0,
                    },
                }),
            ],
        },
    )

    const impl = new Calculator.Processor({
        ping(): void {
            return
github creditkarma / thrift-server / packages / thrift-integration / src / client / client.ts View on Github external
},
            }),
        ])
    }

    // Create thrift client
    const thriftClient: Calculator.Client = createHttpClient(
        Calculator.Client,
        {
            hostName: HAPI_CALC_SERVER_CONFIG.hostName,
            port: HAPI_CALC_SERVER_CONFIG.port,
            protocol: protocolType,
            register:
                sampleRate > 0
                    ? [
                          ThriftClientZipkinFilter({
                              localServiceName: 'calculator-client',
                              remoteServiceName: 'calculator-service',
                              tracerConfig: {
                                  endpoint: process.env.ZIPKIN_ENDPOINT,
                                  zipkinVersion:
                                      process.env.ZIPKIN_VERSION === 'v2'
                                          ? 'v2'
                                          : 'v1',
                                  sampleRate,
                                  httpInterval: 0,
                              },
                          }),
                          ThriftClientTimingFilter({
                              remoteServiceName: 'calculator-service',
                          }),
                      ]
github creditkarma / thrift-server / packages / thrift-integration / src / express-calculator-service.ts View on Github external
export function createServer(sampleRate: number = 0): express.Application {
    // Create thrift client
    const addServiceClient: AddService.Client = createHttpClient(
        AddService.Client,
        {
            hostName: ADD_SERVER_CONFIG.hostName,
            port: ADD_SERVER_CONFIG.port,
            register:
                sampleRate > 0
                    ? [
                          ThriftClientZipkinFilter({
                              localServiceName: 'calculator-service',
                              remoteServiceName: 'add-service',
                              tracerConfig: {
                                  endpoint: process.env.ZIPKIN_ENDPOINT,
                                  zipkinVersion:
                                      process.env.ZIPKIN_VERSION === 'v2'
                                          ? 'v2'
                                          : 'v1',
                                  httpInterval: 0,
                              },
                          }),
                          ThriftClientTimingFilter({
                              remoteServiceName: 'add-service',
                          }),
                      ]
                    : [
github creditkarma / thrift-server / packages / thrift-server-ecosystem / src / client.ts View on Github external
endpoint: 'http://localhost:9411/api/v1/spans',
                httpInterval: 1000,
                httpTimeout: 5000,
                sampleRate: 1.0,
            },
        }),
    )

    // Create thrift client
    const thriftClient: Calculator.Client = createHttpClient(
        Calculator.Client,
        {
            hostName: SERVER_CONFIG.host,
            port: SERVER_CONFIG.port,
            register: [
                ThriftClientZipkinFilter({
                    localServiceName: 'calculator-client',
                    remoteServiceName: 'calculator-service',
                    tracerConfig: {
                        endpoint: 'http://localhost:9411/api/v1/spans',
                        httpInterval: 1000,
                        httpTimeout: 5000,
                        sampleRate: 1.0,
                    },
                }),
            ],
        },
    )

    function symbolToOperation(sym: string): Operation {
        switch (sym) {
            case 'add':
github creditkarma / thrift-server / packages / thrift-integration / src / hapi-calculator-service.ts View on Github external
export async function createServer(
    sampleRate: number = 0,
    protocolType: ProtocolType = 'binary',
): Promise {
    // Create thrift client
    const addServiceClient: AddService.Client = createHttpClient(
        AddService.Client,
        {
            hostName: ADD_SERVER_CONFIG.hostName,
            port: ADD_SERVER_CONFIG.port,
            register:
                sampleRate > 0
                    ? [
                          ThriftClientZipkinFilter({
                              localServiceName: 'calculator-service',
                              remoteServiceName: 'add-service',
                              tracerConfig: {
                                  endpoint: process.env.ZIPKIN_ENDPOINT,
                                  zipkinVersion:
                                      process.env.ZIPKIN_VERSION === 'v2'
                                          ? 'v2'
                                          : 'v1',
                                  sampleRate,
                                  httpInterval: 0,
                              },
                          }),
                          ThriftClientTimingFilter({
                              remoteServiceName: 'add-service',
                          }),
                      ]
github creditkarma / thrift-server / packages / thrift-integration / src / calculator-strict-unions.ts View on Github external
export async function createServer(
    sampleRate: number = 0,
    protocolType: ProtocolType = 'binary',
): Promise {
    // Create thrift client
    const addServiceClient: AddService.Client = createHttpClient(
        AddService.Client,
        {
            hostName: ADD_SERVER_CONFIG.hostName,
            port: ADD_SERVER_CONFIG.port,
            register:
                sampleRate > 0
                    ? [
                          ThriftClientZipkinFilter({
                              localServiceName: 'calculator-service',
                              remoteServiceName: 'add-service',
                              tracerConfig: {
                                  endpoint: process.env.ZIPKIN_ENDPOINT,
                                  zipkinVersion:
                                      process.env.ZIPKIN_VERSION === 'v2'
                                          ? 'v2'
                                          : 'v1',
                                  sampleRate,
                                  httpInterval: 0,
                              },
                          }),
                          ThriftClientTimingFilter({
                              remoteServiceName: 'add-service',
                          }),
                      ]

@creditkarma/thrift-client-zipkin-filter

Zipkin tracing for thrift-client

Apache-2.0
Latest version published 2 years ago

Package Health Score

43 / 100
Full package analysis

Popular @creditkarma/thrift-client-zipkin-filter functions