googlemanagedprometheus

package module
v0.0.0-...-c1fc7e6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

README

Google Managed Service for Prometheus Collector Exporter

Building a container image with the googlemanagedprometheus exporter

In your own fork of open-telemetry/opentelemetry-collector-releases, add your own "distribution" directory within the distributions directory, based on either the otelcol or otelcol-contrib distributions. In the exporters list in manifest.yaml, add:

exporters:
  - gomod: "github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector/googlemanagedprometheus v0.29.0"

The syntax of manifest.yaml is described in the Collector Builder documentation.

In the configs directory, add your collector configuration yaml file, which should look something like:

receivers:
    prometheus:
        config:
          scrape_configs:
            # TODO: Add your prometheus scrape configuration here.
            # Using kubernetes_sd_configs with namespaced resources
            # ensures the namespace is set on your metrics.
processors:
    batch:
        # batch metrics before sending to reduce API usage
        send_batch_max_size: 200
        send_batch_size: 200
        timeout: 5s
    memory_limiter:
        # drop metrics if memory usage gets too high
        check_interval: 1s
        limit_percentage: 65
        spike_limit_percentage: 20
    resourcedetection:
        # detect cluster name and location
        detectors: [gce, gke]
        timeout: 10s
exporters:
    googlemanagedprometheus:

Change the Dockerfile in your directory within distributions to point to your collector config here.

Finally, build the image:

DISTRIBUTIONS=my-distribution make build

Additional Options

The filterprocessor can filter out metrics. The metricstransformprocessor can manipulate metrics in a variety of ways, including synthesizing new metrics from other metrics, adding or removing labels, renaming metrics, and scaling metrics. metric_relabl_configs within the prometheus receiver configuration can also be used to manipulate metrics.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMetricName

func GetMetricName(baseName string, metric pdata.Metric) string

func MapToPrometheusTarget

func MapToPrometheusTarget(res pdata.Resource) *monitoredrespb.MonitoredResource

func NewFactory

func NewFactory() component.ExporterFactory

NewFactory creates a factory for the googlemanagedprometheus exporter

Types

type Config

type Config struct {
	config.ExporterSettings `mapstructure:",squash"`
	GMPConfig               `mapstructure:",squash"`

	// Timeout for all API calls. If not set, defaults to 12 seconds.
	exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
	exporterhelper.QueueSettings   `mapstructure:"sending_queue"`
	exporterhelper.RetrySettings   `mapstructure:"retry_on_failure"`
}

Config defines configuration for Google Cloud Managed Service for Prometheus exporter.

func (*Config) Validate

func (cfg *Config) Validate() error

type GMPConfig

type GMPConfig struct {
	ProjectID    string                 `mapstructure:"project"`
	UserAgent    string                 `mapstructure:"user_agent"`
	ClientConfig collector.ClientConfig `mapstructure:",squash"`
}

GMPConfig is a subset of the collector config.

Jump to

Keyboard shortcuts

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