Code Monkey home page Code Monkey logo

snowflake-prometheus-exporter's Introduction

snowflake-prometheus-exporter

Exports Snowflake warehouse, database, table, and replication statistics for a Snowflake account via HTTP for Prometheus consumption.

Configuration

Command line flags

The exporter may be configured through its command line flags:

  -h, --help                 Show context-sensitive help (also try --help-long and --help-man).
      --web.listen-address=:9975 ...
                             Addresses on which to expose metrics and web interface. Repeatable for multiple addresses.
      --web.telemetry-path="/metrics"
                             Path under which to expose metrics.
      --account=ACCOUNT      The account to collect metrics for.
      --username=USERNAME    The username for the user used when querying metrics.
      --password=PASSWORD    The password for the user used when querying metrics.
      --private-key-path     The path to the user's RSA private key file.
      --private-key-password The password for the user's RSA private key.
      --role="ACCOUNTADMIN"  The role to use when querying metrics.
      --warehouse=WAREHOUSE  The warehouse to use when querying metrics.
      --version              Show application version.
      --log.level=info       Only log messages with the given severity or above. One of: [debug, info, warn, error]
      --log.format=logfmt    Output format of log messages. One of: [logfmt, json]

Example usage:

./snowflake-exporter --account=XXXXXXX-YYYYYYY --username=USERNAME --password=PASSWORD --warehouse=WAREHOUSE --role=ACCOUNTADMIN

Example usage (with private key):

./snowflake-exporter --account=XXXXXXX-YYYYYYY --username=USERNAME --private-key-path=./PRIVATE_KEY.p8 --warehouse=WAREHOUSE --role=ACCOUNTADMIN

If both password and private key file are specified, the private key takes precedence.

Environment Variables

Alternatively, the exporter may be configured using environment variables:

Name Description
SNOWFLAKE_EXPORTER_ACCOUNT The account to collect metrics for.
SNOWFLAKE_EXPORTER_USERNAME The username for the user used when querying metrics.
SNOWFLAKE_EXPORTER_PASSWORD The password for the user used when querying metrics.
SNOWFLAKE_EXPORTER_PRIVATE_KEY_PATH The path to the user's RSA private key file.
SNOWFLAKE_EXPORTER_PRIVATE_KEY_PASSWORD The password for the user's RSA private key (not required for unencrypted keys).
SNOWFLAKE_EXPORTER_ROLE The role to use when querying metrics.
SNOWFLAKE_EXPORTER_WAREHOUSE The warehouse to use when querying metrics.
SNOWFLAKE_EXPORTER_WEB_TELEMETRY_PATH Path under which to expose metrics.

Example usage:

SNOWFLAKE_EXPORTER_ACCOUNT=XXXXXXX-YYYYYYY \
SNOWFLAKE_EXPORTER_USERNAME=USERNAME \
SNOWFLAKE_EXPORTER_PASSWORD=PASSWORD \
SNOWFLAKE_EXPORTER_ROLE=ACCOUNTADMIN \
SNOWFLAKE_EXPORTER_WAREHOUSE=WAREHOUSE \
./snowflake-exporter

Example usage (with private key):

SNOWFLAKE_EXPORTER_ACCOUNT=XXXXXXX-YYYYYYY \
SNOWFLAKE_EXPORTER_USERNAME=USERNAME \
SNOWFLAKE_EXPORTER_PRIVATE_KEY_PATH=./PRIVATE_KEY.p8 \
SNOWFLAKE_EXPORTER_ROLE=ACCOUNTADMIN \
SNOWFLAKE_EXPORTER_WAREHOUSE=WAREHOUSE \
./snowflake-exporter

RSA Key-Pair Authentication

The exporter supports RSA authentication in place of a password. Follow this guide to configure key-pair authentication in your Snowflake environment.

Note: The exporter supports both encrypted and unencrypted private keys. Both example usages below are for encrypted keys. For accurate example usages for environments with an unencrypted private key, remove the --private-key-password flag or SNOWFLAKE_EXPORTER_PRIVATE_KEY_PASSWORD variable respectively.

Example usage (flags):

./snowflake-exporter --account=XXXXXXX-YYYYYYY --username=USERNAME --private-key-path=/PATH/TO/rsa_key.p8 --private-key-password=PASSWORD --warehouse=WAREHOUSE --role=ACCOUNTADMIN

Example usage (environment vars):

SNOWFLAKE_EXPORTER_ACCOUNT=XXXXXXX-YYYYYYY \
SNOWFLAKE_EXPORTER_USERNAME=USERNAME \
SNOWFLAKE_EXPORTER_PRIVATE_KEY_PATH=/PATH/TO/rsa_key.p8 \
SNOWFLAKE_EXPORTER_PRIVATE_KEY_PASSWORD=RSAPASSWORD \
SNOWFLAKE_EXPORTER_ROLE=ACCOUNTADMIN \
SNOWFLAKE_EXPORTER_WAREHOUSE=WAREHOUSE \
./snowflake-exporter

snowflake-prometheus-exporter's People

Contributors

binaryfissiongames avatar caleb-hurshman avatar gaantunes avatar dasomeone avatar ksc98 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.