opentelemetry-collector-contrib icon indicating copy to clipboard operation
opentelemetry-collector-contrib copied to clipboard

[receiver/gitproviderreceiver] add branch time, commit, and line metrics

Open adrielp opened this issue 1 year ago • 6 comments

Description:

Adds the following branch based metrics.

  • git.repository.branch.time
  • git.repository.branch.commit.aheadby.count
  • git.repository.branch.commit.behindby.count
  • git.repository.branch.line.deletion.count
  • git.repository.branch.line.addition.count

Additionally brings this receiver very close to the source version in the Liatrio Distro. Brings the testing up to par as well. After this pull request is merged, I'd like to move this component to alpha status so it can be built within the contrib binary and used by others. Once in alpha, I'd like to bring over the newest metric (repository.cve.count), bring over the GitLab scraper, and potentially propose a new component I developed to work in-tandem with this receiver, the GitHub App Authentication extension.

Link to tracking Issue:

#22028

Testing: Brings testing inline with source and include scrape testing.

Documentation:

Updated the documentation to reflect the additional metrics.

adrielp avatar May 02 '24 02:05 adrielp

@crobert-1 - ready for another pass. Appreciate the review. For some reason the diff on the review tab is cached for me from GitHub. I resolved a bunch of conversations so if you see something resolved that I said changed, but doesn't appear changed, let me know / clear your cache maybe. IDK why GitHub's not reflecting the changes on the review right now.

adrielp avatar May 04 '24 14:05 adrielp

The failed links check is complaining about me linking to the file in main which hasn't been merged yet, so doesn't exist. Would it be better to link to the commit hash instead of main or just merge in as the check will pass next go-around?

adrielp avatar May 09 '24 16:05 adrielp

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: adrielp / name: Adriel Perkins (415a590479c550e6b3ea293e23aaf5233b4d7b00, b7317df5f9ed64fb2f7a7a453538fe8515f3356f, 23fae24a72e953dbc4372e17b9bdb40dd1d0e23c, f2db26388310f25d7dbcf2e6e2ecfe73e4da594e, eb6ab5ecd5374717e0450b2c84748c5ac1e91215, dbe98657431b058d1a6c87b3e3cc1bad4c5099dd, 093e09d99d7b93664a84b8806fb05fe0fa8c3e36, e33b48bac519edb9c57f119a14843283fedbe111, 263971b2939dc4b9d742c4e7e81ab540b4f3beae, a4cce659c7fc1bd08453a70ba2b694ebacef38b3, 04aee2851832995c738fcc25fc103562bbe26e26, ae25cdbac72223066f523a4809430544a4d982fc, f0370b51fc6f2cf4ba930e8ce9541ade24682a66, 1084ac3bb7622b7b441a43a1f6a885f13e3645ac, 8c2466932a3a6505a61d5b3d327f4e112442c8c1, 3c5afdc7c3dfcdca7ea0598e9cd17b178d07c964, 5db15e36eca78b4b2fa39d75b3564876e10276ae, a312f7928f939338fb0da254ca044e34728f9be7, 03c7bc258f219fe76bd857efcb292ccba3b983af, c82c97b87e7f9368e5205724c0ab9009fa4f9ddf, cf1f39d32377a96c631a72fbace408dbe0e6a12c, 0a6d2112284ab598c310c70d10fb65584a32cdb1, b906a06f590c69f79e4fb7994bce0d13d4f3b44f, 64f388473677ba5301b06c4c4b92a78ca3f9b3fe, 753257a2d0302982db34a7a5798e6b001b8cebb4, 6211eea3f644741fed40d70bf499d5632d565214, 194c68c83138c236e056adc449621f3b28f3a4a9, b4b579b6a5c57e181a34b0c1e9dffe6f2a078f5a, d8bf63d2ac58d1f2e2e7856a94d6bf980ded8b06, 75c121411f4fee561bee5ef66af898a017ae8651, a03fed2e1ed650df9d2fe413118ac335b784d8e3, 51686bbd6778313308bb6d28f381ef9b81d65646)

CLA Missing ID CLA Not Signed

@crobert-1 - not sure why this one is showing up.

I checked that commit (it's a ways back) and it has my name and email which is signed (other commits prove that). I thought at first it was your email in the co-authored section, but your name & email on that match other commits in the main branch that have passed fine.

EDIT: must be old/cached (even though it says updated an hour ago) because the check that runs in the workflows is passing.

adrielp avatar May 21 '24 01:05 adrielp

CLA Missing ID CLA Not Signed

@crobert-1 - not sure why this one is showing up.

I checked that commit (it's a ways back) and it has my name and email which is signed (other commits prove that). I thought at first it was your email in the co-authored section, but your name & email on that match other commits in the main branch that have passed fine.

EDIT: must be old/cached (even though it says updated an hour ago) because the check that runs in the workflows is passing.

It's an EasyCLA bug, unrelated to this PR. (This was hit on another PR as well, here's the comment with more context.)

crobert-1 avatar May 21 '24 14:05 crobert-1

@crobert-1 - made a couple small logging statement updates & fixed a bug with metric build record statements running from within goroutines (mutex lock) - just wanted to let you know the change while waiting for another review.

adrielp avatar May 21 '24 18:05 adrielp

/easycla

crobert-1 avatar May 22 '24 14:05 crobert-1

Only failing action is check-links, but the links it's failing on are being added in this PR, so I think it's acceptable to merge as-is.

crobert-1 avatar Jun 04 '24 15:06 crobert-1

Only failing action is check-links, but the links it's failing on are being added in this PR, so I think it's acceptable to merge as-is.

The link would be valid if it was a relative link:

[ghsread]: ./internal/scraper/githubscraper/README.md#github-limitations

But that's not blocking.

andrzej-stencel avatar Jun 05 '24 09:06 andrzej-stencel