googlecloudspannerreceiver

package module
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 18 Imported by: 7

README

Google Cloud Spanner Receiver

Status
Stability beta: metrics
Distributions contrib
Issues Open issues Closed issues
Code Owners @varunraiko
Emeritus @architjugran, @kiranmayib

Google Cloud Spanner enable you to investigate issues with your database by exposing via Total and Top N built-in tables:

  • Query statistics
  • Read statistics
  • Transaction statistics
  • Lock statistics
  • and others

Note: Total and Top N built-in tables are used with 1 minute statistics granularity.

The ultimate goal of Google Cloud Spanner Receiver is to collect and transform those statistics into metrics that would be convenient for further analysis by users.

Getting Started

The following configuration example is:

receivers:
  googlecloudspanner:
    collection_interval: 60s
    initial_delay: 1s
    top_metrics_query_max_rows: 100
    backfill_enabled: true
    cardinality_total_limit: 200000
    hide_topn_lockstats_rowrangestartkey: false
    truncate_text: false
    projects:
      - project_id: "spanner project 1"
        service_account_key: "path to spanner project 1 service account json key"
        instances:
          - instance_id: "id1"
            databases:
              - "db11"
              - "db12"
          - instance_id: "id2"
            databases:
              - "db21"
              - "db22"
      - project_id: "spanner project 2"
        service_account_key: "path to spanner project 2 service account json key"
        instances:
          - instance_id: "id3"
            databases:
              - "db31"
              - "db32"
          - instance_id: "id4"
            databases:
              - "db41"
              - "db42"

Brief description of configuration properties:

  • googlecloudspanner - name of the Cloud Spanner Receiver related section in OpenTelemetry collector configuration file
  • collection_interval - this receiver runs periodically. Each time it runs, it queries Google Cloud Spanner, creates metrics, and sends them to the next consumer (default: 1 minute). It is not recommended to change the default value of collection interval, since new values for metrics in the Spanner database appear only once a minute.
  • initial_delay defines how long this receiver waits before starting.
  • top_metrics_query_max_rows - max number of rows to fetch from Top N built-in table(100 by default)
  • backfill_enabled - turn on/off 1-hour data backfill(by default it is turned off)
  • cardinality_total_limit - limit of active series per 24 hours period. If specified, turns on cardinality filtering and handling. If zero or not specified, cardinality is not handled. You can read this document for more information about cardinality handling and filtering.
  • hide_topn_lockstats_rowrangestartkey - if true, masks PII (key values) in row_range_start_key label for the "top minute lock stats" metric
  • truncate_text - if true, the query text is truncated to 1024 characters.
  • projects - list of GCP projects
    • project_id - identifier of GCP project
    • service_account_key - path to service account JSON key It is highly recommended to set this property to the correct value. In case it is empty, the Application Default Credentials will be used for the database connection.
    • instances - list of Google Cloud Spanner instance for connection
      • instance_id - identifier of Google Cloud Spanner instance
      • databases - list of databases used from this instance

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

Types

type Config

type Config struct {
	scraperhelper.ControllerConfig `mapstructure:",squash"`

	TopMetricsQueryMaxRows            int       `mapstructure:"top_metrics_query_max_rows"`
	BackfillEnabled                   bool      `mapstructure:"backfill_enabled"`
	CardinalityTotalLimit             int       `mapstructure:"cardinality_total_limit"`
	Projects                          []Project `mapstructure:"projects"`
	HideTopnLockstatsRowrangestartkey bool      `mapstructure:"hide_topn_lockstats_rowrangestartkey"`
	TruncateText                      bool      `mapstructure:"truncate_text"`
}

func (*Config) Validate

func (config *Config) Validate() error

type Instance

type Instance struct {
	ID        string   `mapstructure:"instance_id"`
	Databases []string `mapstructure:"databases"`
}

func (Instance) Validate

func (instance Instance) Validate() error

type Project

type Project struct {
	ID                string     `mapstructure:"project_id"`
	ServiceAccountKey string     `mapstructure:"service_account_key"`
	Instances         []Instance `mapstructure:"instances"`
}

func (Project) Validate

func (project Project) Validate() error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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