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

Add telemetry for Jenkins uptime #8596

Merged
merged 1 commit into from
Oct 14, 2023

Conversation

daniel-beck
Copy link
Member

@daniel-beck daniel-beck commented Oct 11, 2023

@dwnusbaum and I noticed unexpected distribution of correlators (see JEP-214) in the submissions to our telemetry trials (my #8440 and #7470 and and Devin's #7342).

While most correlation IDs are submitted multiple times, up to once per day, there are outliers:

  • A significant number of correlation IDs are only seen once, indicating very short-lived instances. JFR disables usage stats submission, so that's not it.
  • A few correlation IDs are seen more than once per day during the collection period, sometimes many times per day. Our best guess so far is cloned Jenkins home directories, but some might also be frequently restarting instances.

In both cases (mostly the second though), collecting Jenkins uptime should be able to help understand what's going on.

This does not use jenkins.model.Uptime as data source, as that's not stable given system time changes (I filed JENKINS-72157).

Testing done

def tel = ExtensionList.lookupSingleton(jenkins.telemetry.impl.Uptime)
def json = tel.createContent()
println ((json.get('now') - json.get('start')) / 1000 / 1000 / 1000)

Changed system time by 5 minutes, re-ran this, no significant jump.

Also locally changed the start date to Oct 10 and manually triggered submission (ExtensionList.lookupSingleton(jenkins.telemetry.Telemetry.TelemetryReporter.class).run()), then checked it in Uplink.

Screenshot 2023-10-11 at 11 22 20

Proposed changelog entries

  • Add telemetry for Jenkins uptime.

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

@daniel-beck daniel-beck added the rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Oct 11, 2023
</ul>

Additionally this trial collects the list of installed plugins, their version, and the version of Jenkins.
This data will help understand unexpected submission frequency of other trials' data.
Copy link
Member Author

Choose a reason for hiding this comment

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

Slightly different wording than in the screenshot.

@@ -0,0 +1,11 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core">
This trial collects two timestamps:
Copy link
Member

Choose a reason for hiding this comment

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

Why collect both endpoints instead of just the difference? I guess this makes it easier to tell when a single correlator is somehow being used by multiple instances because of overlapping but non-equal endpoints. Are there any other reasons?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess this makes it easier to tell when a single correlator is somehow being used by multiple instances because of overlapping but non-equal endpoints.

That's the idea. Multiple submissions will have the same start time if and only if Jenkins wasn't restarted in between.

Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

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

/label ready-for-merge


This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Oct 13, 2023
@NotMyFault NotMyFault merged commit 3218599 into jenkinsci:master Oct 14, 2023
17 checks passed
@MarkEWaite
Copy link
Contributor

@daniel-beck this seems to me like it might be a good candidate for backporting to the 2.426.1 LTS. Should it be an LTS candidate for 2.426.1 or would you prefer to wait for a later LTS release?

@daniel-beck
Copy link
Member Author

@MarkEWaite Thanks for the reminder! I filed JENKINS-72248. I'm happy to wait if it's already late for 2.426.1.

MarkEWaite pushed a commit to MarkEWaite/jenkins that referenced this pull request Oct 30, 2023
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
(cherry picked from commit 3218599)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants