Documentation ¶
Index ¶
- func NewGCEMetadataProvider() gceDataProvider
- type GCEMetadataProvider
- type GCEResource
- type GCEResourceBuilder
- type GCEResourceBuilderInterface
- type Resource
- type UnrecognizedPlatformResource
- func (UnrecognizedPlatformResource) MonitoredResource() *monitoredres.MonitoredResource
- func (UnrecognizedPlatformResource) OTelResourceAttributes() map[string]string
- func (UnrecognizedPlatformResource) ProjectName() string
- func (UnrecognizedPlatformResource) PrometheusStyleMetadata() map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGCEMetadataProvider ¶
func NewGCEMetadataProvider() gceDataProvider
Types ¶
type GCEMetadataProvider ¶
type GCEMetadataProvider struct {
// contains filtered or unexported fields
}
Provide the GCE metadata using the on-VM metadata server The following metadata are not available on the metadata server: * Labels * Subnet URL
type GCEResource ¶
type GCEResource struct { Project string Zone string Network string Subnetwork string PublicIP string PrivateIP string InstanceID string InstanceName string Tags string MachineType string DefaultScopes []string Metadata map[string]string Label map[string]string InterfaceIPv4 map[string]string }
GCEResource implements the Resource interface and provide attributes of the VM when on GCE
func (GCEResource) MonitoredResource ¶
func (r GCEResource) MonitoredResource() *monitoredres.MonitoredResource
func (GCEResource) OTelResourceAttributes ¶
func (r GCEResource) OTelResourceAttributes() map[string]string
func (GCEResource) ProjectName ¶
func (r GCEResource) ProjectName() string
func (GCEResource) PrometheusStyleMetadata ¶
func (r GCEResource) PrometheusStyleMetadata() map[string]string
type GCEResourceBuilder ¶
type GCEResourceBuilder struct {
// contains filtered or unexported fields
}
func (*GCEResourceBuilder) GetResource ¶
func (gd *GCEResourceBuilder) GetResource() (Resource, error)
Return a resource instance with all the attributes based on the single and nested attributes spec
type Resource ¶
type Resource interface { ProjectName() string MonitoredResource() *monitoredres.MonitoredResource OTelResourceAttributes() map[string]string PrometheusStyleMetadata() map[string]string }
An implementation of the Resource interface will have fields represent available attributes about the current monitoring resource.
func GetGCEResource ¶
func GetResource ¶
Get a resource instance for the current environment; In order to access the attributes of a specific type of resource, needs to cast the returned Resource instance to its underlying type: actual, ok := resource.(GCEResource)
type UnrecognizedPlatformResource ¶
type UnrecognizedPlatformResource struct { }
UnrecognizedPlatformResource that returns an empty resource instance without any attributes for unrecognized environments
func (UnrecognizedPlatformResource) MonitoredResource ¶
func (UnrecognizedPlatformResource) MonitoredResource() *monitoredres.MonitoredResource
func (UnrecognizedPlatformResource) OTelResourceAttributes ¶
func (UnrecognizedPlatformResource) OTelResourceAttributes() map[string]string
func (UnrecognizedPlatformResource) ProjectName ¶
func (UnrecognizedPlatformResource) ProjectName() string
func (UnrecognizedPlatformResource) PrometheusStyleMetadata ¶
func (UnrecognizedPlatformResource) PrometheusStyleMetadata() map[string]string