Shivaneep o11y template logic - #9064
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for telemetry tracing by adding the enableTelemetryTracing option to the GAPIC generator, client options, and templates, along with corresponding unit tests. The feedback highlights a potential compilation issue where getGaxTracer is imported in the generated templates but not yet used, which will trigger unused local errors if noUnusedLocals is enabled in the generated client's configuration.
| import jsonProtos = require('../../protos/protos.json'); | ||
| import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; | ||
| {%- endif %} | ||
| {% if api.enableTelemetryTracing %} import { getGaxTracer } from 'google-gax'; {% endif %} |
There was a problem hiding this comment.
Importing getGaxTracer without using it in the generated client code will cause compilation errors (e.g., TS6133: 'getGaxTracer' is declared but its value is never read) when noUnusedLocals is enabled in the generated client's tsconfig.json.
If the telemetry tracing logic is not yet implemented in the templates, please remove this import or implement the tracer usage in this pull request.
| import {getJSON} from '../json-helper.cjs'; | ||
| // @ts-ignore | ||
| const dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
| {% if api.enableTelemetryTracing %} import { getGaxTracer } from 'google-gax'; {% endif %} |
There was a problem hiding this comment.
Importing getGaxTracer without using it in the generated client code will cause compilation errors (e.g., TS6133: 'getGaxTracer' is declared but its value is never read) when noUnusedLocals is enabled in the generated client's tsconfig.json.
If the telemetry tracing logic is not yet implemented in the templates, please remove this import or implement the tracer usage in this pull request.
317f5d3 to
445a74d
Compare
No description provided.