|
| 1 | +# OpenTelemetry::Resource::Detector::GoogleCloudPlatform |
| 2 | + |
| 3 | +The `opentelemetry-resource-detector-google_cloud_platform` gem provides a Google Cloud Platform resource detector for OpenTelemetry. |
| 4 | + |
| 5 | +## What is OpenTelemetry? |
| 6 | + |
| 7 | +OpenTelemetry is an open source observability framework, providing a general-purpose API, SDK, and related tools required for the instrumentation of cloud-native software, frameworks, and libraries. |
| 8 | + |
| 9 | +OpenTelemetry provides a single set of APIs, libraries, agents, and collector services to capture distributed traces and metrics from your application. You can analyze them using Prometheus, Jaeger, and other observability tools. |
| 10 | + |
| 11 | +## How does this gem fit in? |
| 12 | + |
| 13 | +The `opentelemetry-resource-detector-google_cloud_platform` gem provides a means of retrieving a resource for supported environments following the resource semantic conventions. |
| 14 | + |
| 15 | +## How do I get started? |
| 16 | + |
| 17 | +Install the gem using: |
| 18 | + |
| 19 | +```console |
| 20 | +gem install opentelemetry-sdk |
| 21 | +gem install opentelemetry-resource-detector-google_cloud_platform |
| 22 | +``` |
| 23 | + |
| 24 | +Or, if you use Bundler, include `opentelemetry-sdk` and `opentelemetry-resource-detector-google_cloud_platform` in your `Gemfile`. |
| 25 | + |
| 26 | +```rb |
| 27 | +require 'opentelemetry/sdk' |
| 28 | +require 'opentelemetry/resource/detector' |
| 29 | + |
| 30 | +OpenTelemetry::SDK.configure do |c| |
| 31 | + c.resource = OpenTelemetry::Resource::Detector::GoogleCloudPlatform.detect |
| 32 | +end |
| 33 | +``` |
| 34 | + |
| 35 | +This will populate the following resource attributes for compute running on Google Cloud Platform: |
| 36 | + |
| 37 | +* Compute Engine: |
| 38 | +* * `cloud.provider` |
| 39 | +* * `cloud.account.id` |
| 40 | +* * `cloud.region` |
| 41 | +* * `cloud.availability_zone` |
| 42 | +* * `host.id` |
| 43 | +* * `host.name` |
| 44 | + |
| 45 | +* Google Kubernetes Engine: |
| 46 | +* * `k8s.cluster.name` |
| 47 | +* * `k8s.namespace.name` |
| 48 | +* * `k8s.pod.name` |
| 49 | +* * `k8s.node.name` |
| 50 | +* * `container.name` |
| 51 | + |
| 52 | +* Google Cloud Run: |
| 53 | +* * `cloud.provider` |
| 54 | +* * `cloud.account.id` |
| 55 | +* * `cloud.region` |
| 56 | +* * `cloud.availability_zone` |
| 57 | +* * `faas.name` |
| 58 | +* * `faas.version` |
| 59 | + |
| 60 | +## How can I get involved? |
| 61 | + |
| 62 | +The `opentelemetry-resource-detector-google_cloud_platform` gem source is on GitHub, along with related gems. |
| 63 | + |
| 64 | +The OpenTelemetry Ruby gems are maintained by the OpenTelemetry Ruby special interest group (SIG). You can get involved by joining us on our [GitHub Discussions][discussions-url], [Slack Channel][slack-channel] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig]. |
| 65 | + |
| 66 | +## License |
| 67 | + |
| 68 | +The `opentelemetry-resource-detector-google_cloud_platform` gem is distributed under the Apache 2.0 license. See LICENSE for more information. |
| 69 | + |
| 70 | +[ruby-sig]: https://github.com/open-telemetry/community#ruby-sig |
| 71 | +[community-meetings]: https://github.com/open-telemetry/community#community-meetings |
| 72 | +[slack-channel]: https://cloud-native.slack.com/archives/C01NWKKMKMY |
| 73 | +[discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions |
| 74 | + |
0 commit comments