osdctl
osdctl copied to clipboard
minimal example of working metrics
A minimal working example of metric collection using iamkirkbater/cobra-otel-metrics.
Marking this as a draft as I'd still like to finish adding some functionality to the cobra-otel-metrics package itself around the opt-in data controls. Additionally I'd like to get a working HTTP or GRPC collector working and test this "over the net". This is currently using a stdout exporter, which just creates a bunch of, what would be best considered "noise" to the average person, but here is what the metric would look like for a osdctl cluster context --cluster-id command invocation:
{
"Resource": [{"Key":"service.name","Value":{"Type":"STRING","Value":"osdctl"}}],
"ScopeMetrics":[{
"Scope":{"Name":"cobra-otel-metrics","Version":"","SchemaURL":"","Attributes":null},
"Metrics":[{
"Name":"cluster-context",
"Description":"Command Invocation",
"Unit":"1",
"Data":{
"DataPoints":[{
"Attributes":[
{"Key":"cluster-id","Value":{"Type":"INT64","Value":1}},
{"Key":"tty","Value":{"Type":"BOOL","Value":true}}
],
"StartTime":"2025-08-04T10:15:29.409684-04:00",
"Time":"2025-08-04T10:15:31.405611-04:00",
"Value":1
}],
"Temporality":"CumulativeTemporality",
"IsMonotonic":true
}
}]
}]
}
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: iamkirkbater
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [iamkirkbater]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale