Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/gitproviderreceiver] add Pull Request metrics #29642

Merged
merged 49 commits into from
Feb 6, 2024

Conversation

4lch4
Copy link
Contributor

@4lch4 4lch4 commented Dec 4, 2023

Description:
This is the 3rd PR for the gitproviderreceiver that adds functionality for the following Pull Request metrics:

  • git.repository.pull_request.open.count
  • git.repository.pull_request.open.time
  • git.repository.pull_request.merged.count
  • git.repository.pull_request.merged.time
  • git.repository.pull_request.approved.time

Link to tracking Issue: #22028

Testing:
Basic tests included for new functionality.

Documentation:
Documentation has been updated to include information regarding the new metrics.

4lch4 added 13 commits November 27, 2023 18:16
This commit adds the definitions for the new metrics to the metadata.yaml file. It also includes the resulting updates for the code that's auto-generated.
This commit adds the `getPullRequests` method to the `helpers.go` file.

I'm making this such a small commit mostly so I can verify my GitKraken client can create a commit and sign it properly.
When adding the code for the 4 metrics I set out to do, I realized adding the other 2 (PR Approval Time & PR Deployment Time) were really simple and easy to add so I included them as well. I can just as easily remove it if the team decides otherwise once I talk to them.
This commit adds the actual logic to gather & emit the PR metrics.
This commit adds the `getAgeHrs` function which will return the age/duration between two `time.Time` objects in hours.
Copy link

linux-foundation-easycla bot commented Dec 4, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@4lch4
Copy link
Contributor Author

4lch4 commented Dec 5, 2023

I resolved the merge conflicts so it should be ready to review :)

4lch4 added 2 commits December 5, 2023 14:32
This commit renames the test function to be in line with the function it's testing.
@4lch4
Copy link
Contributor Author

4lch4 commented Jan 5, 2024

Okay, this PR is finally ready to merge. My last commits reverted the earlier suggested change where units were things like unit: "{pull_request}" as it broke the receiver. We can add this back later, but I've reverted it to finish this PR.

EDIT (2024/01/05 @ 12:52 CST): I'll edit this later with further information on what exactly it broke.

EDIT (2024/01/09 @ 11:17 CST): Looks like I'm unable to reproduce the issue so this can be ignored.

Copy link
Member

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 👏 🙇

@atoulme atoulme added the ready to merge Code review completed; ready to merge by maintainers label Jan 9, 2024
@djaglowski djaglowski added the Run Windows Enable running windows test on a PR label Jan 10, 2024
@adrielp
Copy link
Contributor

adrielp commented Jan 16, 2024

Looks like the build-and-test for windows is failing because it's trying to test a podman receiver on windows. This shouldn't block the merge of this pr correct @atoulme @astencel-sumo ?

@adrielp
Copy link
Contributor

adrielp commented Feb 2, 2024

Have resolved several conflicts after changes to main and changes for lifecycle tests being merged. Workflows have been re-run now and the unrelated windows workflows that were previously failing look to be fixed. We're good to go!

@codeboten codeboten merged commit f2d8efe into open-telemetry:main Feb 6, 2024
150 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 6, 2024
@adrielp adrielp deleted the more-github-metrics branch February 28, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Code review completed; ready to merge by maintainers receiver/gitprovider Run Windows Enable running windows test on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants