Skip to content
New issue

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

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

Already on GitHub? # to your account

Project path and agent name information #26

Merged
merged 12 commits into from
Apr 30, 2018

Conversation

dcoraboeuf
Copy link
Contributor

@dcoraboeuf dcoraboeuf commented Feb 22, 2018

This PR adds:

  • the project path to all metrics (relative path to the job for those in folders)
  • the name of the agent the build has run on, for the basic Jenkins metrics
  • some tests

Best regards,
Damien

@@ -64,7 +67,8 @@ public boolean hasReport() {
.addField(BUILD_STATUS_MESSAGE, build.getBuildStatusSummary().message)
.addField(BUILD_RESULT, result)
.addField(BUILD_RESULT_ORDINAL, ordinal)
.addField(BUILD_IS_SUCCESSFUL, ordinal < 2 ? true : false)
.addField(BUILD_IS_SUCCESSFUL, ordinal < 2)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a simplification of the code

@asimell
Copy link
Contributor

asimell commented Feb 26, 2018

Hi,
Could you change this PR to merge into the development branch instead of master?

@dcoraboeuf dcoraboeuf changed the base branch from master to development February 26, 2018 09:08
@dcoraboeuf
Copy link
Contributor Author

Done :)

@dcoraboeuf
Copy link
Contributor Author

Hi,

While testing in production and exploiting those metrics in Grafana, I realised that the agent name should actually be a tag, and not a field.

@dcoraboeuf
Copy link
Contributor Author

I'll soon append a correction.

@asimell asimell merged commit 37950d7 into jenkinsci:development Apr 30, 2018
@@ -24,6 +26,7 @@ public AbstractPointGenerator(MeasurementRenderer projectNameRenderer) {
Point.Builder builder = Point
.measurement(name)
.addField(PROJECT_NAME, renderedProjectName)
.addField(PROJECT_PATH, build.getParent().getRelativeNameFrom(Jenkins.getInstance()))
Copy link
Contributor

@darxriggs darxriggs Jul 3, 2019

Choose a reason for hiding this comment

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

@asimell I suggest that PROJECT_PATH is also added as tag. Otherwise it's not possible to filter for or group by it. I created pull request #65 for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

An even better alternative could be to remove PROJECT_PATH (tag and field) completely and add a tag like PARENT which contains the parent folder like folder1/subfolder5 of a job with path folder1/subfolder5/job2.

With this more normalized schema it would be possible to filter and group by the parent (which could be for example folders for different areas in Jenkins or the main folder/job of a multi-branch job where each branch / pull request / tag is a separate job).

What's your opinion on this @asimell and @dcoraboeuf?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants