Skip to content

Commit 3876978

Browse files
authored
fix(auth): add InternalOptions.TelemetryAttributes for internal client use (#13641)
refs: googleapis/google-api-go-client#3442
1 parent 736b758 commit 3876978

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

auth/grpctransport/grpctransport.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@ type InternalOptions struct {
200200
// SkipValidation bypasses validation on Options. It should only be used
201201
// internally for clients that needs more control over their transport.
202202
SkipValidation bool
203+
// TelemetryAttributes specifies a map of telemetry attributes to be added
204+
// to all OpenTelemetry signals, such as tracing and metrics, for purposes
205+
// including representing the static identity of the client (e.g., service
206+
// name, version). These attributes are expected to be consistent across all
207+
// signals to enable cross-signal correlation.
208+
//
209+
// It should only be used internally by generated clients. Callers should not
210+
// modify the map after it is passed in.
211+
TelemetryAttributes map[string]string
203212
}
204213

205214
// Dial returns a GRPCClientConnPool that can be used to communicate with a

auth/httptransport/httptransport.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ type InternalOptions struct {
168168
// for the credentials. It should only be used internally for clients that
169169
// need more control over their transport. The default is false.
170170
SkipUniverseDomainValidation bool
171+
// TelemetryAttributes specifies a map of telemetry attributes to be added
172+
// to all OpenTelemetry signals, such as tracing and metrics, for purposes
173+
// including representing the static identity of the client (e.g., service
174+
// name, version). These attributes are expected to be consistent across all
175+
// signals to enable cross-signal correlation.
176+
//
177+
// It should only be used internally by generated clients. Callers should not
178+
// modify the map after it is passed in.
179+
TelemetryAttributes map[string]string
171180
}
172181

173182
// AddAuthorizationMiddleware adds a middleware to the provided client's

0 commit comments

Comments
 (0)