Resource detector for Google Cloud Platform.
Compatible with OpenTelemetry JS API and SDK 1.0+
.
The GCP resource detector requires Node.JS 10+ due to a dependency on gcp-metadata
which uses features only available in Node.JS 10+.
npm install --save @opentelemetry/resource-detector-gcp
import { detectResources } from '@opentelemetry/resources'; import { gcpDetector } from '@opentelemetry/resource-detector-gcp' const resource = await detectResources({ detectors: [gcpDetector], }) const tracerProvider = new NodeTracerProvider({ resource });
This package uses @opentelemetry/semantic-conventions
version 1.22+
, which implements Semantic Convention Version 1.7.0
project-id
from GCP Metadata project cloud.availability_zone Value of zone
from GCP Metadata instance cloud.provider The cloud provider. In this context, it's always "gcp" container.name Value of Environment Variable CONTAINER_NAME
host.id Value of id
from GCP Metadata instance host.name Value of hostname
from GCP Metadata instance k8s.cluster.name Value of attributes/cluster-name
from GCP Metadata instance k8s.namespace.name Value of Environment Variable NAMESPACE
k8s.pod.name Value of Environment Variable HOSTNAME
Apache 2.0 - See LICENSE for more information.
Share feedback Package Sidebar Installnpm i @opentelemetry/resource-detector-gcp
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4