cloud_pubsub plugin: New plugin publishing to or subscribing from Google Cloud Pub...
[collectd.git] / src / collectd.conf.pod
index da8e873..a356017 100644 (file)
@@ -1574,6 +1574,114 @@ Connection timeout in seconds. Defaults to B<2>.
 
 =back
 
+=head2 Plugin C<cloud_pubsub>
+
+The B<cloud_pubsub> plugin sends metrics to I<Google Cloud Pub/Sub>, a highly
+available message queueing service. The data is encoded in I<collectd's> JSON
+export format.
+
+B<Synopsis:>
+
+ <Plugin "cloud_pubsub">
+   <Publish "topic_name">
+     CredentialFile "/path/to/credentials.json"
+     Project "project_name"
+     Email "0123456789012-abcdefghijklmnopqrstuvwxyzabcdef@developer.gserviceaccount.com
+
+     StoreRates true
+     BufferSize 65536
+   </Publish>
+   <Subscribe "subscription_name">
+     CredentialFile "/path/to/credentials.json"
+     Project "project_name"
+     Email "0123456789012-abcdefghijklmnopqrstuvwxyzabcdef@developer.gserviceaccount.com
+   </Subscribe>
+ </Plugin>
+
+The configuration consists of one or more C<Publish> blocks, each configuring
+one topic to post metrics to. Inside each C<Publish> block, the following
+configuration options are available:
+
+=over 4
+
+=item B<CredentialFile> I<file>
+
+Path to a JSON credentials file holding the credentials for a GCP service
+account.
+
+If B<CredentialFile> is not specified, the plugin uses I<Application Default
+Credentials>. That means which credentials are used depends on the environment:
+
+=over 4
+
+=item
+
+The environment variable C<GOOGLE_APPLICATION_CREDENTIALS> is checked. If this
+variable is specified it should point to a JSON file that defines the
+credentials.
+
+=item
+
+The path C<${HOME}/.config/gcloud/application_default_credentials.json> is
+checked. This is where credentials used by the I<gcloud> command line utility
+are stored. You can use C<gcloud auth application-default login> to create
+these credentials.
+
+Please note that these credentials are often of your personal account, not a
+service account, and are therefore unfit to be used in a production
+environment.
+
+=item
+
+When running on GCE, the built-in service account associated with the virtual
+machine instance is used.
+See also the B<Email> option below.
+
+=back
+
+For B<Publish> blocks, the service account / user requires the
+C<roles/pubsub.publisher> role.
+
+=item B<Project> I<Name>
+
+The I<Project ID> or the I<Project Number> of the I<Stackdriver Account>. The
+I<Project ID> is a string identifying the GCP project, which you can chose
+freely when creating a new project. The I<Project Number> is a 12-digit decimal
+number. You can look up both on the I<Developer Console>.
+
+This setting is optional. If not set, the project ID is read from the
+credentials file or determined from the GCE's metadata service.
+
+=item B<Email> I<Email> (GCE only)
+
+Choses the GCE I<Service Account> used for authentication.
+
+Each GCE instance has a C<default> I<Service Account> but may also be
+associated with additional I<Service Accounts>. This is often used to restrict
+the permissions of services running on the GCE instance to the required
+minimum. The I<cloud_pubsub plugin> requires the
+C<https://www.googleapis.com/auth/pubsub> scope. When multiple I<Service
+Accounts> are available, this option selects which one is used by
+I<cloud_pubsub plugin>.
+
+=item B<StoreRates> B<false>|B<true> (Publish only)
+
+If set to true, counters are converted to a rate before submitting.
+Defaults to B<false> because this plugin itself cannot consume non-gauge
+metrics that have been converted to rates.
+
+=item B<BufferSize> I<Bytes> (Publish only)
+
+Sets the size of the buffer used to build requests to I<Cloud Pub/Sub>, in
+bytes. Must be at least 1024E<nbsp>bytes. Defaults to 65536 (64E<nbsp>kiByte).
+
+=item B<MaxMessages> I<Number> (Subscribe only)
+
+Sets the maximum number of messages to receive from Cloud Pub/Sub at once.
+Defaults to 1000.
+
+=back
+
 =head2 Plugin C<conntrack>
 
 This plugin collects IP conntrack statistics.