googleclientauthextension

package module
v0.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

README

Authenticator - Google Client Credentials

Status
Stability alpha

This extension provides Google OAuth2 Client Credentials and Metadata for gRPC and http based exporters.

The authenticator type has to be set to googleclientauth.

Configuration

extensions:
  googleclientauth:

receivers:
  otlp:
    protocols:
      grpc:

exporters:
  otlp/withauth:
    endpoint: 0.0.0.0:5000
    ca_file: /tmp/certs/ca.pem
    auth:
      authenticator: googleclientauth

service:
  extensions: [googleclientauth]
  pipelines:
    metrics:
      receivers: [otlp]
      processors: []
      exporters: [otlp/withauth]

Following are the configuration fields:

  • project - The Google Cloud Project telemetry is sent to if the gcp.project.id resource attribute is not set. If unspecified, this is determined using application default credentials.
  • scopes - The oauth 2.0 scopes requested by the extension.
  • quota_project - The project for quota and billing purposes. The caller must have serviceusage.services.use permission on the project.

Building into a Collector

This extension is not included in any collector distributions today. To build a collector with this component, add the following to your collector builder configuration:

extensions:
  - import: github.com/GoogleCloudPlatform/opentelemetry-operations-go/extension/googleclientauthextension
    gomod: github.com/GoogleCloudPlatform/opentelemetry-operations-go/extension/googleclientauthextension v0.43.0

Documentation

Overview

Package googleclientauthextension provides gRPC and HTTP credentials and metadata using Application Default Credentials: https://cloud.google.com/docs/authentication#adc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultConfig added in v0.46.0

func CreateDefaultConfig() component.Config

func CreateExtension added in v0.46.0

func NewFactory

func NewFactory() extension.Factory

NewFactory creates a factory for the GCP Auth extension.

Types

type Config

type Config struct {
	// Project is the project telemetry is sent to if the gcp.project.id
	// resource attribute is not set. If unspecified, this is determined using
	// application default credentials.
	Project string `mapstructure:"project"`

	// QuotaProject specifies a project for quota and billing purposes. The
	// caller must have serviceusage.services.use permission on the project.
	//
	// For more information please read:
	// https://cloud.google.com/apis/docs/system-parameters
	QuotaProject string `mapstructure:"quota_project"`

	// Scope specifies optional requested permissions.
	// See https://datatracker.ietf.org/doc/html/rfc6749#section-3.3
	Scopes []string `mapstructure:"scopes,omitempty"`
}

Config stores the configuration for GCP Client Credentials.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the extension configuration is valid.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL