Source File
monitored_resources.go
Belonging Package
contrib.go.opencensus.io/exporter/stackdriver/monitoredresource/aws
package aws
import (
)
type Interface interface {
type EC2Instance struct {
func ( *EC2Instance) () ( string, map[string]string) {
= map[string]string{
"aws_account": .AWSAccount,
"instance_id": .InstanceID,
"region": .Region,
}
return "aws_ec2_instance",
}
func () Interface {
return func() Interface {
detectOnce.Do(func() {
autoDetected = detectResourceType(retrieveAWSIdentityDocument())
})
return autoDetected
}()
}
func ( *awsIdentityDocument) *EC2Instance {
:= EC2Instance{
AWSAccount: .accountID,
InstanceID: .instanceID,
Region: fmt.Sprintf("aws:%s", .region),
}
return &
}
var detectOnce sync.Once
func ( *awsIdentityDocument) Interface {
if != nil {
return createEC2InstanceMonitoredResource()
}
return nil
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |