Skip to content

Add ReceiveSendGreetingServlet and publish workflow for matrix project #272

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

Merged
merged 5 commits into from
Feb 24, 2021

Conversation

samarth-gupta-traceable
Copy link
Contributor

@samarth-gupta-traceable samarth-gupta-traceable commented Feb 23, 2021

Description

Add ReceiveSendGreetingServlet.java and publish workflow for matrix project

  1. new servelt ReceiveSendGreetingServlet is capable of handling POST request data and echo is back
  2. new git workflow for publishing the docker images for various servlet containers is triggered only when changes are made to matrix project path and main branch.

Testing

Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Documentation

Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.

@pavolloffay
Copy link
Member

Some files have OTEL license header and some not, could we add the license header to the missing files? We should preserve OTEL license header.

@samarth-gupta-traceable
Copy link
Contributor Author

Some files have OTEL license header and some not, could we add the license header to the missing files? We should preserve OTEL license header.

@pavolloffay Below files do not have OTEL header (with reason for missing):

  1. ExceptionRequestListener.java: Source file in OTEL repo itself does not have the header. I can add it though if desirable. https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/smoke-tests/matrix/src/main/java/io/opentelemetry/smoketest/matrix/ExceptionRequestListener.java
  2. GreetingWithHeader , StreamTransferUtil, ReceiveSendGreetingServlet : does not exists in OTEL repo and are added by us for HT. If needed I can add header in these as well.

@pavolloffay
Copy link
Member

@samarth-gupta-traceable
Copy link
Contributor Author

import java.net.URLConnection;
import java.util.stream.Collectors;

public class ReceiveSendGreetingServlet extends HttpServlet {
Copy link
Member

Choose a reason for hiding this comment

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

Could we rename it EchoServlet?

Copy link
Member

Choose a reason for hiding this comment

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

Could do servlet just simply read the body to a buffer and write it back with the same content type?

This way we don't need dep on Gson and additional classes. To test response heders capture the servlet could also send some test response header.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pavolloffay made below changes.

  1. renamed the servlet to EchoServlet
  2. copying request as response . Header going as test headers.

@samarth-gupta-traceable samarth-gupta-traceable merged commit bc28add into hypertrace:main Feb 24, 2021
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.

2 participants