|
| 1 | +# Google Cloud Spanner Receiver |
| 2 | + |
| 3 | +<!-- status autogenerated section --> |
| 4 | +| Status | | |
| 5 | +| ------------- |-----------| |
| 6 | +| Stability | [beta]: metrics | |
| 7 | +| Distributions | [contrib] | |
| 8 | +| Issues | [](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fgooglecloudspanner) [](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fgooglecloudspanner) | |
| 9 | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dashpole](https://www.github.com/dashpole), [@dsimil](https://www.github.com/dsimil), [@KiranmayiB](https://www.github.com/KiranmayiB), [@harishbohara11](https://www.github.com/harishbohara11) | |
| 10 | +| Emeritus | [@architjugran](https://www.github.com/architjugran), [@varunraiko](https://www.github.com/varunraiko) | |
| 11 | + |
| 12 | +[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta |
| 13 | +[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib |
| 14 | +<!-- end autogenerated section --> |
| 15 | + |
| 16 | +Google Cloud Spanner enable you to investigate issues with your database |
| 17 | +by exposing via [Total and Top N built-in tables](https://cloud.google.com/spanner/docs/introspection): |
| 18 | +- Query statistics |
| 19 | +- Read statistics |
| 20 | +- Transaction statistics |
| 21 | +- Lock statistics |
| 22 | +- and others |
| 23 | + |
| 24 | +_Note_: Total and Top N built-in tables are used with 1 minute statistics granularity. |
| 25 | + |
| 26 | +The ultimate goal of Google Cloud Spanner Receiver is to collect and transform those statistics into metrics |
| 27 | +that would be convenient for further analysis by users. |
| 28 | + |
| 29 | +## Getting Started |
| 30 | + |
| 31 | +The following configuration example is: |
| 32 | + |
| 33 | +```yaml |
| 34 | +receivers: |
| 35 | + googlecloudspanner: |
| 36 | + collection_interval: 60s |
| 37 | + initial_delay: 1s |
| 38 | + top_metrics_query_max_rows: 100 |
| 39 | + backfill_enabled: true |
| 40 | + cardinality_total_limit: 200000 |
| 41 | + hide_topn_lockstats_rowrangestartkey: false |
| 42 | + truncate_text: false |
| 43 | + projects: |
| 44 | + - project_id: "spanner project 1" |
| 45 | + service_account_key: "path to spanner project 1 service account json key" |
| 46 | + instances: |
| 47 | + - instance_id: "id1" |
| 48 | + databases: |
| 49 | + - "db11" |
| 50 | + - "db12" |
| 51 | + - instance_id: "id2" |
| 52 | + databases: |
| 53 | + - "db21" |
| 54 | + - "db22" |
| 55 | + - project_id: "spanner project 2" |
| 56 | + service_account_key: "path to spanner project 2 service account json key" |
| 57 | + instances: |
| 58 | + - instance_id: "id3" |
| 59 | + databases: |
| 60 | + - "db31" |
| 61 | + - "db32" |
| 62 | + - instance_id: "id4" |
| 63 | + databases: |
| 64 | + - "db41" |
| 65 | + - "db42" |
| 66 | +``` |
| 67 | +
|
| 68 | +Brief description of configuration properties: |
| 69 | +- **googlecloudspanner** - name of the Cloud Spanner Receiver related section in OpenTelemetry collector configuration file |
| 70 | +- **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.** |
| 71 | +- **initial_delay** defines how long this receiver waits before starting. |
| 72 | +- **top_metrics_query_max_rows** - max number of rows to fetch from Top N built-in table(100 by default) |
| 73 | +- **backfill_enabled** - turn on/off 1-hour data backfill(by default it is turned off) |
| 74 | +- **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](cardinality.md) for more information about cardinality handling and filtering. |
| 75 | +- **hide_topn_lockstats_rowrangestartkey** - if true, masks PII (key values) in row_range_start_key label for the "top minute lock stats" metric |
| 76 | +- **truncate_text** - if true, the query text is truncated to 1024 characters. |
| 77 | +- **projects** - list of GCP projects |
| 78 | + - **project_id** - identifier of GCP project |
| 79 | + - **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](https://google.aip.dev/auth/4110) will be used for the database connection. |
| 80 | + - **instances** - list of Google Cloud Spanner instance for connection |
| 81 | + - **instance_id** - identifier of Google Cloud Spanner instance |
| 82 | + - **databases** - list of databases used from this instance |
| 83 | +
|
0 commit comments