-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add config to call
CreateServiceTimeSeries
(#259)
* Initial implementation of create service time series. * Add a test case for create service timeseries. * Add logic to auto-detect project id if not configured. * Fix from code review * Fix resource to be one that has retention policy for integration tests.
- Loading branch information
Showing
7 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
exporter/collector/testdata/fixtures/create_service_timeseries_metrics.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"resourceMetrics": [ | ||
{ | ||
"resource": { | ||
"attributes": [ | ||
{ | ||
"key": "cloud.platform", | ||
"value": { | ||
"stringValue": "gcp_kubernetes_engine" | ||
} | ||
}, | ||
{ | ||
"key": "k8s.node.name", | ||
"value": { | ||
"stringValue": "gke-rabbitmq-test-dev-default-pool-4ffbde79-k6w0" | ||
} | ||
}, | ||
{ | ||
"key": "cloud.availability_zone", | ||
"value": { | ||
"stringValue": "us-central1-c" | ||
} | ||
}, | ||
{ | ||
"key": "k8s.cluster.name", | ||
"value": { | ||
"stringValue": "rabbitmq-test-dev" | ||
} | ||
} | ||
] | ||
}, | ||
"instrumentationLibraryMetrics": [ | ||
{ | ||
"instrumentationLibrary": {}, | ||
"metrics": [ | ||
{ | ||
"name":"kubernetes.io/internal/nodes/clustermetrics/node_network_availability_transition_time", | ||
"description":"Node network unavailable condition last transition time (seconds since epoch)", | ||
"gauge":{ | ||
"dataPoints":[ | ||
{ | ||
"attributes":[ | ||
{ | ||
"key":"network_unavailable", | ||
"value":{ | ||
"stringValue":"False" | ||
} | ||
} | ||
], | ||
"timeUnixNano":"1639162382976000000", | ||
"asInt":"1639069893" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
36 changes: 36 additions & 0 deletions
36
exporter/collector/testdata/fixtures/create_service_timeseries_metrics_expect.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"createServiceTimeSeriesRequests": [ | ||
{ | ||
"timeSeries": [ | ||
{ | ||
"metric": { | ||
"type": "kubernetes.io/internal/nodes/clustermetrics/node_network_availability_transition_time", | ||
"labels": { | ||
"network_unavailable": "False" | ||
} | ||
}, | ||
"resource": { | ||
"type": "k8s_node", | ||
"labels": { | ||
"cluster_name": "rabbitmq-test-dev", | ||
"location": "us-central1-c", | ||
"node_name": "gke-rabbitmq-test-dev-default-pool-4ffbde79-k6w0" | ||
} | ||
}, | ||
"metricKind": "GAUGE", | ||
"valueType": "INT64", | ||
"points": [ | ||
{ | ||
"interval": { | ||
"endTime": "1970-01-01T00:00:00Z" | ||
}, | ||
"value": { | ||
"int64Value": "1639069893" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |