Skip to content

Commit

Permalink
Add fixture based test for bool metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
psx95 committed Jun 22, 2023
1 parent 133b6b6 commit 777a342
Show file tree
Hide file tree
Showing 3 changed files with 766 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ var MetricsTestCases = []TestCase{
cfg.MetricConfig.Prefix = "workload.googleapis.com"
},
},
{
Name: "Boolean valued gauge metrics represented through int gauges",
OTLPInputFixturePath: "testdata/fixtures/metrics/boolean_gauge_metrics.json",
ExpectFixturePath: "testdata/fixtures/metrics/boolean_gauge_metrics_expect.json",
SkipForSDK: true, // Boolean valued metrics not implemented in SDK
},
{
Name: "Delta Counter",
OTLPInputFixturePath: "testdata/fixtures/metrics/delta_counter_metrics.json",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"resourceMetrics": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "unknown_service:sample"
}
},
{
"key": "telemetry.sdk.language",
"value": {
"stringValue": "go"
}
},
{
"key": "telemetry.sdk.name",
"value": {
"stringValue": "opentelemetry"
}
},
{
"key": "telemetry.sdk.version",
"value": {
"stringValue": "1.16.0"
}
}
]
},
"scopeMetrics": [
{
"scope": {
"name": "github.com/GoogleCloudPlatform/opentelemetry-operations-go/example/collector/metric"
},
"metrics": [
{
"name": "observer-boolean-collector",
"unit": "{gcp.BOOL}",
"gauge": {
"dataPoints": [
{
"attributes": [
{
"key": "key",
"value": {
"stringValue": "value"
}
}
],
"startTimeUnixNano": "11651379494838206464",
"timeUnixNano": "1687377293673694987",
"asInt": "0"
}
]
}
}
]
}
],
"schemaUrl": "https://opentelemetry.io/schemas/1.17.0"
}
]
}
Loading

0 comments on commit 777a342

Please sign in to comment.