MCPcopy
hub / github.com/grpc/grpc-go / newPluginOption

Function newPluginOption

stats/opentelemetry/csm/pluginoption.go:58–65  ·  view source on GitHub ↗

newPluginOption returns a new pluginOption with local labels and metadata exchange labels derived from the environment.

(ctx context.Context)

Source from the content-addressed store, hash-verified

56// newPluginOption returns a new pluginOption with local labels and metadata
57// exchange labels derived from the environment.
58func newPluginOption(ctx context.Context) internal.PluginOption {
59 localLabels, metadataExchangeLabelsEncoded := constructMetadataFromEnv(ctx)
60
61 return &pluginOption{
62 localLabels: localLabels,
63 metadataExchangeLabelsEncoded: metadataExchangeLabelsEncoded,
64 }
65}
66
67// NewLabelsMD returns a metadata.MD with the CSM labels as an encoded protobuf
68// Struct as the value of "x-envoy-peer-metadata".

Callers 5

TestGetLabelsMethod · 0.85
EnableObservabilityFunction · 0.85
TestXDSLabelsMethod · 0.85

Calls 1

constructMetadataFromEnvFunction · 0.85

Tested by 4

TestGetLabelsMethod · 0.68
TestXDSLabelsMethod · 0.68