Skip to content

Conversation

@iamkirkbater
Copy link
Contributor

@iamkirkbater iamkirkbater commented Aug 4, 2025

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
      }
    }]
  }]
}

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 4, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 4, 2025

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 4, 2025

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 4, 2025
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

Details

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.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 8, 2025
@openshift-bot
Copy link

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

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 6, 2025
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants