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

Develop HTTP Extension #115

Closed
26 tasks done
NassimBtk opened this issue Mar 15, 2024 · 0 comments
Closed
26 tasks done

Develop HTTP Extension #115

NassimBtk opened this issue Mar 15, 2024 · 0 comments
Assignees

Comments

@NassimBtk
Copy link
Member

NassimBtk commented Mar 15, 2024

Description

Check List

Agent

  • Remove the HttpProtocolConfig class.
  • In ConfigHelper move the validateHttpInfo() method content to the HttpConfiguration class which is located in the metricshub-http-extension. And adapt the code in ConfigHelper so that we call IConfiguration#validateConfiguration (httpConfiguration) to validate the content of the Http configuration.
  • Add the IConfiguration instance for http to the final Map<Class<? extends IConfiguration>, IConfiguration> protocolConfigurations map which is built in ConfigHelper#buildHostConfiguration.
  • In the MetricsHub CLI, adapt the HttpConfigCli class.
  • Re-write HttpConfigCli.toProtocol to call the extensionManager instance responsible of building the right IConfiguration for Http protocol.
  • If it is required to build a new configuration for HTTP in the unit tests then create a HttpTestConfiguration class and create its extension HttpTestExtension.
  • Remove ConfigHelperTest#testValidateHttpInfo() because the validation will be moved to the HttpConfiguration class in the metricshub-http-extension.
  • Adapt the TaskSchedulingServiceTest to replace the removed classes by the extension classes E.g. HttpTestConfiguration.
  • Adapt the HttpConfigCliTest tests. Probably Static Mocks will be involved.

Engine

  • Remove the org.sentrysoftware:http dependency from metricshub-engine POM.
  • Move ClientsExecutor.executeHttp code to the metricshub-http-extension. Make sure to remove the call from the ClientsExecutor.executeWql method and adapt the caller (SourceProcessor CriterionProcessor) to invoke the extensionManager correctly.
  • Remove HttpConfiguration.class mapping from the HostConfiguration#CONFIGURATION_TO_SOURCES_MAP map.
  • Move HttpConfiguration.java to metricshub-http-extension module.
  • Move ProtocolHealthCheckStrategy#checkHttpHealth to HttpExtension located at the metricshub-http-extension module. Make sure to remove the unused constants and methods.
  • Move the code of the method: CriterionProcessor#CriterionTestResult process(@SpanAttribute("criterion.definition") HttpCriterion HttpCriterion) to the appropriate class in the metricshub-http-extension module.
  • Move the code of the method: SourceProcessor#process(@SpanAttribute("source.definition") final HttpSource httpSource)
  • Move the HttpConfigurationTest class to the extension unit tests.
  • Adapt correct engine unit tests because the code is moved to another module. #155

Extension

  • Implement the IProtocolExtension class.
  • Make sure to define the /metricshub-http-extension/src/main/resources/META-INF/services/org.sentrysoftware.metricshub.engine.extension.IProtocolExtension file so that the ServiceLoader loads the extension implementation correctly at runtime.
  • Add the metricshub-engine,lombok, jupiter,jackson (all the necessary dependencies) in the extension project's POM.
  • Make sure to create a jar using the maven-shade-plugin (POM) and set Multi-Release to true in the manifest entries of the jar.
  • Make sure to include the required dependencies (org.sentrysoftware:http and org.sentrysoftware:metricshub-http-extension)
  • Develop unit tests.

Packaging Windows and Linux

  • Add the metricshub-http-extension as dependency.
  • Update the maven-dependency-plugin, execution-id: unpack-extensions and add the artifactItem defining the metricshub-http-extension.
@CherfaElyes CherfaElyes self-assigned this Apr 2, 2024
CherfaElyes added a commit that referenced this issue Apr 9, 2024
* Developed Http Extension and all its classes
* Refactored all the tests and made the necessary changes to make them work
* Tested the engine and the agent
CherfaElyes added a commit that referenced this issue Apr 9, 2024
* Added the missing javadoc to the engine and the HTTP Extension
* Fixed a bug on the HTTP extension
CherfaElyes added a commit that referenced this issue Apr 16, 2024
* Fixed some comments
* Fixed some imports
* Removed dead code
NassimBtk added a commit that referenced this issue Apr 17, 2024
* Various adjustments and fixes

* Refactored unit tests
NassimBtk added a commit that referenced this issue Apr 18, 2024
…-http-extension

Issue #115: Develop HTTP Extension
NassimBtk added a commit that referenced this issue Apr 18, 2024
* Fixed HTTP Extension POM
NassimBtk added a commit that referenced this issue Apr 18, 2024
* Removed collectTime from `IProtocolExtension#checkProtocol()`
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

When branches are created from issues, their pull requests are automatically linked.

2 participants