Skip to content

Spring boot package [Threads - data stream]#2981

Merged
mtojek merged 11 commits intoelastic:mainfrom
sunny-elastic:package_spring_boot_threads
Apr 27, 2022
Merged

Spring boot package [Threads - data stream]#2981
mtojek merged 11 commits intoelastic:mainfrom
sunny-elastic:package_spring_boot_threads

Conversation

@sunny-elastic
Copy link
Copy Markdown
Contributor

@sunny-elastic sunny-elastic commented Apr 3, 2022

What does this PR do?

  • Generated the skeleton of Spring Boot integration package.
  • Added Threads data stream
  • Added data collection logic.
  • Added the ingest pipelines.
  • Mapped fields according to the ECS schema and added Fields metadata in the appropriate yml files.
  • Added system test cases.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that Threads data stream collect metrics.
  • I have added an entry to my package's changelog.yml file.
  • If I'm introducing a new feature, I have modified the Kibana version constraint in my package's manifest.yml file to point to the latest Elastic stack release (e.g. ^8.0.0).

How to test this PR locally

  • Clone integrations repo.
  • Install elastic-package locally.
  • Start elastic stack using elastic-package.
  • Move to integrations/packages/spring_boot directory.
  • Run the following command to run tests.

elastic-package test

Note: We have covered dashboards and the visualisations for all data streams of spring boot into separate PR. Also Kibana version will be updated to 8.1.0 in manifest.yml after testing this integration on 8.1.0.

@sunny-elastic sunny-elastic requested a review from a team as a code owner April 3, 2022 07:59
@elasticmachine
Copy link
Copy Markdown

elasticmachine commented Apr 3, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-04-27T06:29:26.390+0000

  • Duration: 17 min 39 sec

Test stats 🧪

Test Results
Failed 0
Passed 16
Skipped 0
Total 16

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@sunny-elastic sunny-elastic requested a review from mtojek April 3, 2022 08:17
@sunny-elastic sunny-elastic self-assigned this Apr 3, 2022
@sunny-elastic sunny-elastic added enhancement New feature or request Team:Integrations Label for the Integrations team New Integration Issue or pull request for creating a new integration package. labels Apr 3, 2022
@elasticmachine
Copy link
Copy Markdown

Pinging @elastic/integrations (Team:Integrations)

@mtojek mtojek requested a review from ruflin April 4, 2022 09:35
Comment thread packages/spring_boot/data_stream/threads/fields/fields.yml Outdated
Comment thread packages/spring_boot/data_stream/threads/fields/fields.yml Outdated
- name: threading
type: group
fields:
- name: current_thread
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does the current_thread mean in terms of Jolokia request? Which one is the current thread? Should we skip it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

so this current_thread should be current running thread , it has different values than threads. I think we should keep this.

@sunny-elastic sunny-elastic requested a review from a team as a code owner April 20, 2022 11:44
Copy link
Copy Markdown
Contributor

@kush-elastic kush-elastic left a comment

Choose a reason for hiding this comment

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

@sunny-elastic that's all from my end, left some comments.
@mtojek, please take a look and feel free to drop in suggestions/questions.

Comment thread packages/spring_boot/manifest.yml Outdated
Comment on lines +44 to +45
title: Collect Spring Boot metrics of Memory and Threading.
description: Collecting metrics from Spring Boot of Memory and Threading.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we update this to something like following:

Suggested change
title: Collect Spring Boot metrics of Memory and Threading.
description: Collecting metrics from Spring Boot of Memory and Threading.
title: Collect Spring Boot metrics using Jolokia.
description: Collecting metrics from Spring Boot of Memory and Threading using Jolokia.

so in future if there are anymore data-stream that uses same jolokia input, we don't have provide all the types in title.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes done

Comment on lines +52 to +66
- name: daemon_thread_count
type: long
description: Current number of live daemon threads
- name: object_monitor_usage_supported
type: boolean
description: Object monitor usage support
- name: peak_thread_count
type: long
description: Peak thread count to the current number of live threads
- name: synchronizer_usage_supported
type: boolean
description: Show the synchronizer usage support
- name: total_started_thread_count
type: long
description: Total number of threads created and also started since the Java virtual machine started
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we do this?

Suggested change
- name: daemon_thread_count
type: long
description: Current number of live daemon threads
- name: object_monitor_usage_supported
type: boolean
description: Object monitor usage support
- name: peak_thread_count
type: long
description: Peak thread count to the current number of live threads
- name: synchronizer_usage_supported
type: boolean
description: Show the synchronizer usage support
- name: total_started_thread_count
type: long
description: Total number of threads created and also started since the Java virtual machine started
- name: daemon
type: long
description: Current number of live daemon threads
- name: object_monitor_usage_supported
type: boolean
description: Object monitor usage support
- name: peak
type: long
description: Peak thread count to the current number of live threads
- name: synchronizer_usage_supported
type: boolean
description: Show the synchronizer usage support
- name: total_started
type: long
description: Total number of threads created and also started since the Java virtual machine started

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah make sense, its updated

Copy link
Copy Markdown
Contributor

@kush-elastic kush-elastic left a comment

Choose a reason for hiding this comment

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

LGTM! Let's wait for other's review.

Copy link
Copy Markdown
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Few comments on my side.

  1. I'm not sure why do we need to collect these booleans.
  2. I think we need another level spring_boot.threading.threads.* for metrics like current and started (instead of daemon and total_started).

Comment on lines +64 to +71
"allocated_memory": {
"enabled": true,
"supported": true
},
"contention_monitoring": {
"enabled": false,
"supported": true
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do these metrics mean? They seem to me more like a configuration.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

its updated now and removed the unwanted ones

Comment on lines +73 to +76
"cpu_time": {
"enabled": true,
"supported": true
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same story here. As a user, I expected cpu_time but got some booleans.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we updated the structure and kept only relevant fields

"cpu_time_supported": true,
"user_time": 470000000
},
"daemon": 16,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does this metric mean?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

for daemon ? its number of live daemon threads.

"user_time": 470000000
},
"daemon": 16,
"object_monitor_usage_supported": true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Boolean?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

its updated

"daemon": 16,
"object_monitor_usage_supported": true,
"peak": 20,
"synchronizer_usage_supported": true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Boolean?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

its updated

"object_monitor_usage_supported": true,
"peak": 20,
"synchronizer_usage_supported": true,
"total_started": 23
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

total_started what?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Total number of threads created and also started since the Java virtual machine started. Updated this hierarchy in structure

@mtojek mtojek self-requested a review April 26, 2022 07:58
Copy link
Copy Markdown
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

requested changes

@sunny-elastic
Copy link
Copy Markdown
Contributor Author

sunny-elastic commented Apr 26, 2022

Few comments on my side.

  1. I'm not sure why do we need to collect these booleans.
  2. I think we need another level spring_boot.threading.threads.* for metrics like current and started (instead of daemon and total_started).

@mtojek is this following structure looks good to you, since only kept relevant fields which has meaningful values to collect

"spring_boot"{
    "threading"{
        "threads"{
            "current"{
                "allocated_bytes",
                "time"{
                    "cpu",
                    "user"
                },
            },
            "count",
            "daemon",
            "total_started"
        }
    }
}

Here if you see the current object it only specifies the details regarding current thread, but count , daemon and total started are referring to multiple threads so coming under threads object. And it has appropriate description given in fields.yml

@mtojek
Copy link
Copy Markdown
Contributor

mtojek commented Apr 26, 2022

Yes, it's a better fit. I'm wondering if we improve it more by applying this guidance.

Then:

  • count will be value
  • total_started will be started

@sunny-elastic
Copy link
Copy Markdown
Contributor Author

yeah but count has a specific meaning here as count of live threads (Current number of live threads including both daemon and non-daemon threads.)
and total_started is Total number of threads created and also started since the Java virtual machine started, we can keep this as started. let me know what you think

@mtojek
Copy link
Copy Markdown
Contributor

mtojek commented Apr 26, 2022

Ok, let's just change the total_started -> started. Otherwise, it LGTM.

@elasticmachine
Copy link
Copy Markdown

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (2/2) 💚
Files 100.0% (2/2) 💚 2.918
Classes 100.0% (2/2) 💚 2.918
Methods 100.0% (24/24) 💚 11.29
Lines 93.289% (139/149) 👍 3.348
Conditionals 100.0% (0/0) 💚

@sunny-elastic
Copy link
Copy Markdown
Contributor Author

Ok, let's just change the total_started -> started. Otherwise, it LGTM.

Yeah its updated. Thanks!

@sunny-elastic sunny-elastic requested a review from mtojek April 27, 2022 07:04
@mtojek mtojek merged commit 614a118 into elastic:main Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request New Integration Issue or pull request for creating a new integration package. Team:Integrations Label for the Integrations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants