-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for bool valued metrics * Adds collector specific example * Remove debug print statements * Add unit tests * Remove lingering debug statement * Fix go lint error(s) * Remove special attribute keys prior to GCM export The keys are removed from labelDescriptors and metricLabels so as to prevent creation of separate time-series data for distinct values for those labels. * Refactor: early return for better readability * Revert "Adds collector specific example" This reverts commit 1c68822. * Fix linter error * Support boolean metrics via units * Add log warning explaining failed bool conversion * Add missing tests to increase coverage * Add fixture based test for bool metrics * Invert check in convertMetricKindToBoolIfSupported Co-authored-by: Mike Dame <mikedame@google.com> * Update test fixtures with additional cases * Fix documentation for numberDataPointToValue Co-authored-by: Aaron Abbott <aaronabbott@google.com> * Update code formatting Co-authored-by: Aaron Abbott <aaronabbott@google.com> * Remove boolean support for Non-Monotonic Sum * Rename convertMetricKindToBoolIfSupported -> convertToBoolIfMetricKindSupported --------- Co-authored-by: Mike Dame <mikedame@google.com> Co-authored-by: Aaron Abbott <aaronabbott@google.com>
- Loading branch information
1 parent
ddd884e
commit 207e0d8
Showing
5 changed files
with
1,030 additions
and
8 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
91 changes: 91 additions & 0 deletions
91
exporter/collector/integrationtest/testdata/fixtures/metrics/boolean_gauge_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,91 @@ | ||
{ | ||
"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-1" | ||
} | ||
} | ||
], | ||
"startTimeUnixNano": "11651379494838206464", | ||
"timeUnixNano": "1687377293673694987", | ||
"asInt": "0" | ||
}, | ||
{ | ||
"attributes": [ | ||
{ | ||
"key": "key", | ||
"value": { | ||
"stringValue": "value-2" | ||
} | ||
} | ||
], | ||
"startTimeUnixNano": "1688083417576000000", | ||
"timeUnixNano": "1688083820000000000", | ||
"asInt": "393" | ||
}, | ||
{ | ||
"attributes": [ | ||
{ | ||
"key": "key", | ||
"value": { | ||
"stringValue": "value-3" | ||
} | ||
} | ||
], | ||
"startTimeUnixNano": "1688083940000000000", | ||
"timeUnixNano": "1688084000000000000", | ||
"asInt": "-272" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"schemaUrl": "https://opentelemetry.io/schemas/1.17.0" | ||
} | ||
] | ||
} |
Oops, something went wrong.