metadata.go 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package ecsutil // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil"
  4. // TaskMetadata defines task metadata for a task
  5. type TaskMetadata struct {
  6. AvailabilityZone string `json:"AvailabilityZone,omitempty"`
  7. Cluster string `json:"Cluster,omitempty"`
  8. Containers []ContainerMetadata `json:"Containers,omitempty"`
  9. Family string `json:"Family,omitempty"`
  10. KnownStatus string `json:"KnownStatus,omitempty"`
  11. LaunchType string `json:"LaunchType,omitempty"`
  12. Limits Limits `json:"Limits,omitempty"`
  13. PullStartedAt string `json:"PullStartedAt,omitempty"`
  14. PullStoppedAt string `json:"PullStoppedAt,omitempty"`
  15. Revision string `json:"Revision,omitempty"`
  16. ServiceName string `json:"ServiceName,omitempty"`
  17. TaskARN string `json:"TaskARN,omitempty"`
  18. }
  19. // ContainerMetadata defines container metadata for a container
  20. type ContainerMetadata struct {
  21. ContainerARN string `json:"ContainerARN,omitempty"`
  22. ContainerName string `json:"Name,omitempty"`
  23. CreatedAt string `json:"CreatedAt,omitempty"`
  24. DockerID string `json:"DockerId,omitempty"`
  25. DockerName string `json:"DockerName,omitempty"`
  26. ExitCode *int64 `json:"ExitCode,omitempty"`
  27. FinishedAt string `json:"FinishedAt,omitempty"`
  28. Image string `json:"Image,omitempty"`
  29. ImageID string `json:"ImageID,omitempty"`
  30. KnownStatus string `json:"KnownStatus,omitempty"`
  31. Labels map[string]string `json:"Labels,omitempty"`
  32. Limits Limits `json:"Limits,omitempty"`
  33. LogDriver string `json:"LogDriver,omitempty"`
  34. LogOptions LogOptions `json:"LogOptions,omitempty"`
  35. Networks []Network `json:"Networks,omitempty"`
  36. StartedAt string `json:"StartedAt,omitempty"`
  37. Type string `json:"Type,omitempty"`
  38. }
  39. // Limits defines the Cpu and Memory limits
  40. type Limits struct {
  41. CPU *float64 `json:"CPU,omitempty"`
  42. Memory *uint64 `json:"Memory,omitempty"`
  43. }
  44. // LogOptions defines the CloudWatch configuration
  45. type LogOptions struct {
  46. LogGroup string `json:"awslogs-group,omitempty"`
  47. Region string `json:"awslogs-region,omitempty"`
  48. Stream string `json:"awslogs-stream,omitempty"`
  49. }
  50. type Network struct {
  51. IPv4Addresses []string `json:"IPv4Addresses,omitempty"`
  52. NetworkMode string `json:"NetworkMode,omitempty"`
  53. }