Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

gRPC client methods are not patched correctly when loaded with @grpc/proto-loader #873

@jordanworner

Description

@jordanworner

When a proto file is loaded with @grpc/proto-loaded the method names are UpperCamelCase and a property called originalName is added to the method definition that has the lowerCamelCase name.

The client constructor in the grpc module creates a method alias using the originalName.

The problem is the alias is created before the methods are patched, so you can use both to make gRPC calls but only the UpperCamelCase method is traced.

import { loadSync } from "@grpc/proto-loader";
import grpc from "grpc";

const credentials = grpc.credentials.createInsecure();

const packageDefinition = loadSync("myservice.proto");
const descriptor = grpc.loadPackageDefinition(packageDefinition);
const client = new descriptor.mypackage.ApiTokenService("0.0.0.0:50051", credentials);

console.log(client.MyMethod);
console.log(client.myMethod);

Only client.MyMethod uses clientMethodTrace.

Metadata

Metadata

Assignees

Labels

api: cloudtraceIssues related to the googleapis/cloud-trace-nodejs API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions