github.com/observiq/bindplane-agent@v1.51.0/config/google_cloud_exporter/README.md (about) 1 # Google Cloud Exporter Prerequisites 2 3 The Google Cloud Exporter supports Metrics, Logs, and Traces. This directory contains sub directories with usercase 4 specific configurations, all of which are compatible with Google Cloud Monitoring. 5 6 ## Google Cloud APIs 7 8 Enable the following APIs. 9 - Cloud Metrics 10 - Cloud Logging 11 - Cloud Tracing 12 13 To learn more about enabling APIs, see the [documentation](https://cloud.google.com/endpoints/docs/openapi/enable-api). 14 15 ## Authentication 16 17 The Google Cloud exporter supports three authentication mechanisms. 18 19 **Google Application Default Credentials** 20 21 When running within Google Cloud, instances with the correct [scopes](https://developers.google.com/identity/protocols/oauth2/scopes#monitoring) for monitoring, logging and tracing will have 22 the ability to send telemetry to Google Cloud without further configuration. Simply define the Google Cloud exporter in your configuration. 23 24 ```yaml 25 exporters: 26 googlecloud: 27 ``` 28 29 **Credential File** 30 31 A Google Cloud Service Account can used for authentication by creating a service account and key. 32 - [Create a service account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) with the following roles: 33 - Metrics: `roles/monitoring.metricWriter` 34 - Logs: `roles/logging.logWriter` 35 - Traces: `roles/cloudtrace.agent` 36 - [Create a service account json key](https://cloud.google.com/iam/docs/creating-managing-service-account-keys) and place it on the system that is running the agent. 37 38 The `credentials_file` parameter can be set: 39 ```yaml 40 exporters: 41 googlecloud: 42 credentials_file: /opt/observiq-otel-collector/credentials.json 43 ``` 44 45 **Credential JSON** 46 47 Using a credential JSON is an alternative to credential file. Instead of placing the service account key file on the system, it is embedded into the config. The service 48 account setup and credential file creation is idential to the `Credential File` option. 49 50 Setting the `credentials` parameter will override the `credentials_file` parameter. 51 52 The `credentials` parameter can be set by embedding the credential json: 53 ```yaml 54 exporters: 55 googlecloud: 56 # this is a fake credential json 57 credentials: '{ "type": "service_account", "project_id": "myproject", "private_key_id": "bt47a39d576b495709711c0536348edb41baf7cb", "private_key": "-----BEGIN PRIVATE KEY-----\nFIIEvQIBADANBgkqhkiG9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QL0b4vd+oWQ8CcNRNACySqeNP\nxSdqpfJmtQKBgANYup+EodU2n5MvVoMrkqsBxYsstVyUAKPUc8CsjSAaxi5g8eBs\nRw8hv5EMsDmmMQB9crBbbClZzhDRqCPugVm6mFpK1aHpnu3BpaU6/ixVbG0f+40j\n6XK22ijJN2ZXMXgw1l+wXGuE/LE3r3dPFgF+OvQxegRoWsPWx9MTF6ylAoGBAKSl\nnIrx/p3y1BjmiHNV+I9eWu8rmccYS46CmpaUPrPMZWKV5TBx5RdUKmoR6LXuuKt9\nGj/F0jhVUe05kk5eU6BDb4/Iz8Qq8G7ROYpolHg1AoR9Gd7vo2LydQGYk19kC8N6\nomFW0yr5WpXn8EvPxi/QwnDTvSECod7FstFLfOS9AoGANBIZghBf8HwphoHEV6q1\n+OkiCJF7Daf16ZGm6HBbDUzd6prC/lNzGFJcY97uNQy4C6p3v/OJzibvQAHb68ap\nEtZ+7M1TJN8x78BmX2NwGoC0Yjg42gt0nvulRnTrSZvnr2vyjkexhQ0lwkeuMYE5\nQGfwz9DP01LHNFF2711tMWY=\n-----END PRIVATE KEY-----\n", "client_email": "serviceaccount@myproject.iam.gserviceaccount.com", "client_id": "006890467469331372107", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "token_uri": "https://oauth2.googleapis.com/token", "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/serviceaccount%40myproject.iam.gserviceaccount.com" }' 58 ```