You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I have been trying to set this up multiple times and haven't been able to. My sample instrumentation file contains
import { NodeSDK } from '@opentelemetry/sdk-node'
import {
ConsoleMetricExporter,
PeriodicExportingMetricReader,
} from '@opentelemetry/sdk-metrics'
import {GrpcInstrumentation} from "@opentelemetry/instrumentation-grpc";
// For troubleshooting, set the log level to DiagLogLevel.DEBUG
// import {diag, trace, DiagConsoleLogger, DiagLogLevel} from "@opentelemetry/api";
// diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.VERBOSE)
const openTelemetrySDK = new NodeSDK({
metricReader: new PeriodicExportingMetricReader({
exporter: new ConsoleMetricExporter(),
exportIntervalMillis: 1000
}),
instrumentations: [
new GrpcInstrumentation({
enabled: true
})
]
})
// This method monkey patches the grpc client classes and injects the OpenTelemetry methods.
openTelemetrySDK.start()
process.on('SIGTERM', () => {
openTelemetrySDK.shutdown().then(
() => console.info('SDK shutdown successfully'),
err => console.info('Error shutting down SDK', err),
)
})
// This must be the first thing that needs to be imported or before the first import of grpc-js happens.
export default openTelemetrySDK
And to run my main file, I use the command npx ts-node --require ./src/instrumentation.ts src/greeter_client.ts. if I enable diag DEBUG logging, then I can see all those trace logs containing the grpc status, method, service_name, status_code, etc. However, I am unable to see any histogram type metrics for the continuously fired Unary Call from src/greeter_client.ts.
Hi @rathsai - metrics for gRPC are curently not implemented yet. Implementation is currently blocked by semantic conventions updates. I created an issue to track this #5250 and the blockers for implementation.
@rathsai - I'll close this issue as we now have a documented path forward for this feature (#5250) - if there are any additional questions, please feel free to comment over at #5250. Thanks 🙂
Hi,
I have been trying to see metrics printed for instruments like
grpc.client.attempt. duration
,grpc.client.call.duration
, etc as per mentioned in the doc: https://grpc.io/docs/guides/opentelemetry-metrics/#client-per-attempt-instrumentsHowever, I have been trying to set this up multiple times and haven't been able to. My sample instrumentation file contains
Dependencies
And to run my
main
file, I use the commandnpx ts-node --require ./src/instrumentation.ts src/greeter_client.ts
. if I enablediag
DEBUG logging, then I can see all those trace logs containing the grpc status, method, service_name, status_code, etc. However, I am unable to see any histogram type metrics for the continuously fired Unary Call fromsrc/greeter_client.ts
.Next, while searching around for solutions, I stumbled upon this doc https://opentelemetry.io/docs/languages/js/getting-started/nodejs/ and using the suggestion, I only started receiving http instrument metrics but not grpc instrument metrics.
Any idea how I can setup ?
The text was updated successfully, but these errors were encountered: