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

support install external agent in Sermant #1706

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

lilai23
Copy link
Collaborator

@lilai23 lilai23 commented Dec 17, 2024

What type of PR is this?

Feature

What this PR does / why we need it?

To better integrate with OpenTelemetry and make it easier for users to leverage its observability capabilities, we aim to treat OpenTelemetry as a component within Sermant. It will support both static and dynamic attachment methods.

Which issue(s) this PR fixes?

Fixes #1705

Does this PR introduce a user-facing change?

Yes. We will update user guide at sermant.io.

Checklist

  • Make sure there is a GitHub_issue related with this PR before you start working on it.
  • Make sure you have squashed your change to one single commit.
  • GitHub Actions works fine in this PR.

@lilai23 lilai23 force-pushed the feature_opentelemetry branch from 63af395 to d125c25 Compare December 18, 2024 02:59
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 37.50000% with 90 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...java/io/sermant/core/ext/ExternalAgentManager.java 46.93% 25 Missing and 1 partial ⚠️
.../sermant/core/plugin/agent/config/AgentConfig.java 0.00% 12 Missing ⚠️
...c/main/java/io/sermant/core/AgentCoreEntrance.java 0.00% 10 Missing ⚠️
.../core/event/collector/FrameworkEventCollector.java 0.00% 8 Missing ⚠️
...n/agent/enhance/OpenTelemetryAgentInterceptor.java 0.00% 6 Missing ⚠️
...lement/service/heartbeat/HeartbeatServiceImpl.java 0.00% 5 Missing ⚠️
...ugin/agent/enhance/OpenTelemetryAgentDeclarer.java 0.00% 4 Missing ⚠️
...java/io/sermant/core/command/CommandProcessor.java 25.00% 3 Missing ⚠️
...e/command/ExternalAgentInstallCommandExecutor.java 78.57% 3 Missing ⚠️
.../sermant/core/plugin/agent/ByteEnhanceManager.java 0.00% 3 Missing ⚠️
... and 6 more
Flag Coverage Δ Complexity Δ
unittests 43.84% <37.50%> (-0.03%) 181.00 <0.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ Complexity Δ
...src/main/java/io/sermant/core/command/Command.java 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...in/java/io/sermant/core/common/CommonConstant.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...ore/event/collector/FrameworkEventDefinitions.java 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...re/service/heartbeat/common/ExternalAgentInfo.java 100.00% <100.00%> (ø) 0.00 <0.00> (?)
.../service/hotplugging/entity/HotPluggingConfig.java 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
.../sermant/core/command/DynamicAgentArgsManager.java 20.00% <0.00%> (+20.00%) 0.00 <0.00> (ø)
...t/core/plugin/agent/collector/PluginCollector.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ermant/core/plugin/agent/BufferedAgentBuilder.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ore/service/heartbeat/common/HeartbeatMessage.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...src/main/java/io/sermant/core/utils/FileUtils.java 11.45% <0.00%> (-0.25%) 0.00 <0.00> (ø)
... and 11 more

... and 12 files with indirect coverage changes

@lilai23 lilai23 force-pushed the feature_opentelemetry branch 2 times, most recently from 045ff7d to 63e9cb1 Compare December 19, 2024 03:42
@lilai23 lilai23 force-pushed the feature_opentelemetry branch from 63e9cb1 to f061590 Compare December 19, 2024 07:04
@lilai23 lilai23 changed the title support install Otel agent in Sermant support install external agent in Sermant Dec 19, 2024
@lilai23 lilai23 force-pushed the feature_opentelemetry branch 8 times, most recently from 9156736 to f0e35a8 Compare December 19, 2024 09:03
@zwmagic zwmagic self-requested a review December 19, 2024 14:13
zwmagic
zwmagic previously approved these changes Dec 19, 2024
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
static void installOtelAgent(boolean isDynamic, String agentPath, Map<String, String> argsMap,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The code for using installCommonAgent() and installOtelAgent() is duplicated, which can be merged

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

resolved as one method

@zwmagic zwmagic self-requested a review December 19, 2024 15:34
@lilai23 lilai23 force-pushed the feature_opentelemetry branch 2 times, most recently from fe62791 to e5359e3 Compare December 20, 2024 09:33
@lilai23 lilai23 force-pushed the feature_opentelemetry branch from e5359e3 to 02633eb Compare December 20, 2024 09:35
*
* @param startMethod the method name OpenTelemetry Agent starts by
*/
public void collectOtelStartEvent(String startMethod) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

make this method more general and decouple it from Otel

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

Successfully merging this pull request may close these issues.

Support install Otel agent in Sermant
3 participants