googlemanagedprometheusexporter

package module
v1.67.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

README

Google Managed Prometheus Exporter

This exporter can be used to send metrics to Google Cloud Managed Service for Prometheus. It is an extension of the official Google Managed Prometheus Exporter, with additional configuration options.

Supported pipelines

  • Metrics

How It Works

  1. The user configures this exporter in a pipeline
  2. If the pipeline does not use the prometheus receiver with the gcp detector, set resource attributes in the pipeline as described in the upstream documentation.
  3. Metrics are sent to Google Cloud.

Configuration

Field Type Default Required Description
credentials_file string false The credentials file used to authenticate the GPM client. Ignored if credentials is set.
credentials string false The credentials JSON used to authenticate the GPM client.
metric.endpoint string false The endpoint where metric data is sent to.
metric object false The metric settings of the exporter.
project string false The GCP project used when exporting telemetry data. If not set, the exporter will attempt to extract the value from the specified credentials.
use_insecure boolean false false Uses gRPC communication if true. Only has an effect if the endpoint is set.
user_agent string StanzaLogAgent false Overrides the user agent used when making requests.
sending_queue object false Determines how telemetry data is buffered before exporting. See the documentation for the exporter helper for more information.

Example configuration

This configuration scrapes the agent's self metrics, using a credentials file to authenticate.

receivers:
  # Scrape the agent's self metrics with the prometheus receiver
  prometheus:
    config:
      scrape_configs:
        - job_name: 'otel-collector'
          scrape_interval: 30s
          static_configs:
            - targets: ['0.0.0.0:8888']
processors:
  batch:
  # The location label is required. Here we are specifying use us-east1-a.
  # "namespace" and "cluster" may also be set here, if desired.
  # Alternatively, the resourcedetection processor may be used with the "gcp" detector if running in gcp.
  resource:
    attributes:
      # Add a location 
      - key: "location"
        value: "us-east1-a"
        action: "upsert"

exporters:
  googlemanagedprometheus:
    credentials_file: ${CREDENTIALS_FILE_PATH}

service:
  pipelines:
    metrics:
      receivers: [prometheus]
      processors: [resource, batch]
      exporters: [googlemanagedprometheus]

Documentation

Overview

Package googlemanagedprometheusexporter provides a wrapper around the official googlemanagedprometheusexporter component that exposes some quality of life improvements in configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(collectorVersion string) exporter.Factory

NewFactory creates a factory for the googlecloud exporter

Types

type Config

type Config struct {
	Credentials     string      `mapstructure:"credentials"`
	CredentialsFile string      `mapstructure:"credentials_file"`
	GMPConfig       *gmp.Config `mapstructure:",squash"`
}

Config is the config the google managed prometheus exporter

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the config

Jump to

Keyboard shortcuts

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