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

ROX-23251: Add metrics for email sender service #1755

Merged
merged 7 commits into from
Apr 24, 2024

Conversation

kurlov
Copy link
Member

@kurlov kurlov commented Apr 10, 2024

Description

  • Add default golang metrics with 1 custom metric as an example

Checklist (Definition of Done)

  • Unit and integration tests added
  • Added test description under Test manual
    - [ ] Documentation added if necessary (i.e. changes to dev setup, test execution, ...)
  • CI and all relevant tests are passing
  • Add the ticket number to the PR title if available, i.e. ROX-12345: ...
    - [ ] Discussed security and business related topics privately. Will move any security and business related topics that arise to private communication channel.
    - [ ] Add secret to app-interface Vault or Secrets Manager if necessary
    - [ ] RDS changes were e2e tested manually
    - [ ] Check AWS limits are reasonable for changes provisioning new resources
    - [ ] (If applicable) Changes to the dp-terraform Helm values have been reflected in the addon on integration environment

Test manual

# To run tests locally run:
CLUSTER_ID=test go run emailsender/cmd/app/main.go

Copy link
Contributor

openshift-ci bot commented Apr 10, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kurlov
Copy link
Member Author

kurlov commented Apr 10, 2024

@kurlov kurlov changed the title part 2: add metrics ROX-23251: Add metrics for email sender service Apr 10, 2024
@kurlov kurlov marked this pull request as ready for review April 10, 2024 02:34
@kurlov kurlov force-pushed the akurlov/ROX-23251_add_metrics_email_sender branch from 43bd808 to ee38481 Compare April 10, 2024 09:01
@kurlov kurlov requested a review from johannes94 April 10, 2024 12:46
@kurlov kurlov force-pushed the akurlov/ROX-23251_add_base_email_sender_service branch from ac73c2f to b22fd66 Compare April 17, 2024 22:05
Base automatically changed from akurlov/ROX-23251_add_base_email_sender_service to main April 19, 2024 07:01
emailsender/pkg/metrics/server.go Outdated Show resolved Hide resolved
emailsender/pkg/metrics/server.go Outdated Show resolved Hide resolved
emailsender/pkg/metrics/metrics.go Outdated Show resolved Hide resolved
emailsender/pkg/metrics/server_test.go Outdated Show resolved Hide resolved
emailsender/pkg/metrics/server_test.go Outdated Show resolved Hide resolved
metricServer := metrics.NewMetricsServer(cfg.MetricsAddress)
go func() {
glog.Info("Creating metrics server...")
if err := metricServer.ListenAndServe(); !errors.Is(err, http.ErrServerClosed) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Also added error filtering to avoid logging error on graceful shutdown like this one:

1 main.go:68] metrics server error: http: Server closed

@kurlov kurlov requested a review from johannes94 April 23, 2024 12:57
Copy link
Contributor

@johannes94 johannes94 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@openshift-ci openshift-ci bot added the lgtm label Apr 24, 2024
Copy link
Contributor

openshift-ci bot commented Apr 24, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johannes94, kurlov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kurlov kurlov merged commit d85ef84 into main Apr 24, 2024
8 checks passed
@kurlov kurlov deleted the akurlov/ROX-23251_add_metrics_email_sender branch April 24, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants