Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1911 from kawych/release-1.5
Browse files Browse the repository at this point in the history
Cherry-pick changes from PR #1906 to 1.5 release branch
  • Loading branch information
kawych committed Dec 11, 2017
2 parents 847771c + 5011e97 commit a2a35ba
Show file tree
Hide file tree
Showing 244 changed files with 39,390 additions and 9,841 deletions.
431 changes: 278 additions & 153 deletions Godeps/Godeps.json

Large diffs are not rendered by default.

142 changes: 72 additions & 70 deletions metrics/sinks/stackdriver/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,224 +14,226 @@

package stackdriver

import google_api5 "google.golang.org/genproto/googleapis/api/metric"

var (
// Known metrics metadata

// Container metrics

containerUptimeMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "kubernetes.io/container/uptime",
}

cpuContainerCoreUsageTimeMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "kubernetes.io/container/cpu/core_usage_time",
}

cpuRequestedCoresMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "kubernetes.io/container/cpu/request_cores",
}

cpuLimitCoresMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "kubernetes.io/container/cpu/limit_cores",
}

memoryContainerUsedBytesMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/container/memory/used_bytes",
}

memoryRequestedBytesMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/container/memory/request_bytes",
}

memoryLimitBytesMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/container/memory/limit_bytes",
}

restartCountMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/container/restart_count",
}

// Pod metrics

volumeUsedBytesMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/pod/volume/used_bytes",
}

volumeTotalBytesMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/pod/volume/total_bytes",
}

networkPodReceivedBytesMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/pod/network/received_bytes_count",
}

networkPodSentBytesMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/pod/network/sent_bytes_count",
}

// Node metrics

cpuNodeCoreUsageTimeMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "kubernetes.io/node/cpu/core_usage_time",
}

cpuTotalCoresMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "kubernetes.io/node/cpu/total_cores",
}

cpuAllocatableCoresMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "kubernetes.io/node/cpu/allocatable_cores",
}

memoryNodeUsedBytesMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/node/memory/used_bytes",
}

memoryTotalBytesMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/node/memory/total_bytes",
}

memoryAllocatableBytesMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/node/memory/allocatable_bytes",
}

networkNodeReceivedBytesMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/node/network/received_bytes_count",
}

networkNodeSentBytesMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/node/network/sent_bytes_count",
}

cpuNodeDaemonCoreUsageTimeMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "kubernetes.io/node_daemon/cpu/core_usage_time",
}

memoryNodeDaemonUsedBytesMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "kubernetes.io/node_daemon/memory/used_bytes",
}

// Old resource model metrics

legacyUptimeMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "container.googleapis.com/container/uptime",
}

legacyCPUReservedCoresMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "container.googleapis.com/container/cpu/reserved_cores",
}

legacyCPUUsageTimeMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "DOUBLE",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_DOUBLE,
Name: "container.googleapis.com/container/cpu/usage_time",
}

legacyNetworkRxMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "container.googleapis.com/container/network/received_bytes_count",
}

legacyNetworkTxMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "container.googleapis.com/container/network/sent_bytes_count",
}

legacyMemoryLimitMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "container.googleapis.com/container/memory/bytes_total",
}

legacyMemoryBytesUsedMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "container.googleapis.com/container/memory/bytes_used",
}

legacyMemoryPageFaultsMD = &metricMetadata{
MetricKind: "CUMULATIVE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_CUMULATIVE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "container.googleapis.com/container/memory/page_fault_count",
}

legacyDiskBytesUsedMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "container.googleapis.com/container/disk/bytes_used",
}

legacyDiskBytesTotalMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "container.googleapis.com/container/disk/bytes_total",
}

legacyAcceleratorMemoryTotalMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "container.googleapis.com/container/accelerator/memory_total",
}

legacyAcceleratorMemoryUsedMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "container.googleapis.com/container/accelerator/memory_used",
}

legacyAcceleratorDutyCycleMD = &metricMetadata{
MetricKind: "GAUGE",
ValueType: "INT64",
MetricKind: google_api5.MetricDescriptor_GAUGE,
ValueType: google_api5.MetricDescriptor_INT64,
Name: "container.googleapis.com/container/accelerator/duty_cycle",
}
)
Loading

0 comments on commit a2a35ba

Please sign in to comment.