Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sfx exporter: rename working-set and page-fault metrics #679

Merged
merged 1 commit into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions exporter/signalfxexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@ func TestDefaultTranslationRules(t *testing.T) {
require.Equal(t, 1, len(dps))
require.Equal(t, 3, len(dps[0].Dimensions))
require.Equal(t, int64(10e9), *dps[0].Value.IntValue)

// memory page faults and working set renames
_, ok = metrics["container_memory_working_set_bytes"]
require.True(t, ok, "container_memory_working_set_bytes not found")
_, ok = metrics["container_memory_page_faults"]
require.True(t, ok, "container_memory_page_faults not found")
_, ok = metrics["container_memory_major_page_faults"]
require.True(t, ok, "container_memory_major_page_faults not found")
}

func md() consumerdata.MetricsData {
Expand Down Expand Up @@ -500,6 +508,111 @@ func md() consumerdata.MetricsData {
},
},
},
{
MetricDescriptor: &metricspb.MetricDescriptor{
Name: "container.memory.working_set",
Unit: "bytes",
Type: metricspb.MetricDescriptor_GAUGE_INT64,
LabelKeys: []*metricspb.LabelKey{
{Key: "host"},
{Key: "kubernetes_node"},
{Key: "kubernetes_cluster"},
},
},
Timeseries: []*metricspb.TimeSeries{
{
StartTimestamp: &timestamp.Timestamp{},
LabelValues: []*metricspb.LabelValue{{
Value: "host0",
HasValue: true,
}, {
Value: "node0",
HasValue: true,
}, {
Value: "cluster0",
HasValue: true,
}},
Points: []*metricspb.Point{{
Timestamp: &timestamp.Timestamp{
Seconds: 1596000000,
},
Value: &metricspb.Point_Int64Value{
Int64Value: 1000,
},
}},
},
},
},
{
MetricDescriptor: &metricspb.MetricDescriptor{
Name: "container.memory.page_faults",
Unit: "",
Type: metricspb.MetricDescriptor_GAUGE_INT64,
LabelKeys: []*metricspb.LabelKey{
{Key: "host"},
{Key: "kubernetes_node"},
{Key: "kubernetes_cluster"},
},
},
Timeseries: []*metricspb.TimeSeries{
{
StartTimestamp: &timestamp.Timestamp{},
LabelValues: []*metricspb.LabelValue{{
Value: "host0",
HasValue: true,
}, {
Value: "node0",
HasValue: true,
}, {
Value: "cluster0",
HasValue: true,
}},
Points: []*metricspb.Point{{
Timestamp: &timestamp.Timestamp{
Seconds: 1596000000,
},
Value: &metricspb.Point_Int64Value{
Int64Value: 1000,
},
}},
},
},
},
{
MetricDescriptor: &metricspb.MetricDescriptor{
Name: "container.memory.major_page_faults",
Unit: "",
Type: metricspb.MetricDescriptor_GAUGE_INT64,
LabelKeys: []*metricspb.LabelKey{
{Key: "host"},
{Key: "kubernetes_node"},
{Key: "kubernetes_cluster"},
},
},
Timeseries: []*metricspb.TimeSeries{
{
StartTimestamp: &timestamp.Timestamp{},
LabelValues: []*metricspb.LabelValue{{
Value: "host0",
HasValue: true,
}, {
Value: "node0",
HasValue: true,
}, {
Value: "cluster0",
HasValue: true,
}},
Points: []*metricspb.Point{{
Timestamp: &timestamp.Timestamp{
Seconds: 1596000000,
},
Value: &metricspb.Point_Int64Value{
Int64Value: 1000,
},
}},
},
},
},
},
}
return md
Expand Down
3 changes: 3 additions & 0 deletions exporter/signalfxexporter/translation/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ translation_rules:
container.filesystem.capacity: container_fs_capacity_bytes
container.filesystem.usage: container_fs_usage_bytes
container.memory.available: container_memory_available_bytes
container.memory.major_page_faults: container_memory_major_page_faults
container.memory.page_faults: container_memory_page_faults
container.memory.rss: container_memory_rss_bytes
container.memory.usage: container_memory_usage_bytes
container.memory.working_set: container_memory_working_set_bytes
k8s.node.cpu.utilization: cpu.utilization

# k8s cluster receiver metrics
Expand Down