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

refactor: move receivers and providers into plugins #127

Merged
merged 10 commits into from
Sep 26, 2022

Conversation

mabdh
Copy link
Member

@mabdh mabdh commented Sep 14, 2022

Changes

  • Move receivers and providers as plugins
  • Change behaviour of upsert rules for cortex
    • Previously
      • Upsert rule API -> write to DB -> get all rules in a rule group (collection of rules) of a tenant from DB -> write rule group to cortex
    • Now
      • Upsert rule API -> write to DB -> get a rule group from cortex -> upsert the rule to the fetched rule group -> write rule group to cortex
  • When API return 500, hide the error details and log the error detail instead
  • Add end-to-end API test for cortex
  • Simplify GetNamespace and ListNamespace repository to populate provider information (with join) so we don't need to call two services (get namespace and get provider) in the service layer

@mabdh mabdh changed the title refacatpr: move receivers and providers into plugins refactor: move receivers and providers into plugins Sep 14, 2022
@coveralls
Copy link

coveralls commented Sep 15, 2022

Pull Request Test Coverage Report for Build 3095620225

  • 390 of 505 (77.23%) changed or added relevant lines in 27 files are covered.
  • 28 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-4.8%) to 88.798%

Changes Missing Coverage Covered Lines Changed/Added Lines %
core/rule/service.go 20 21 95.24%
core/receiver/service.go 31 33 93.94%
core/provider/sync.go 0 3 0.0%
core/template/service.go 9 13 69.23%
plugins/providers/cortex/client.go 64 69 92.75%
plugins/receivers/httpreceiver/service.go 22 28 78.57%
plugins/receivers/pagerduty/service.go 22 28 78.57%
plugins/providers/cortex/subscription_service.go 0 9 0.0%
plugins/providers/cortex/service.go 26 37 70.27%
core/subscription/service.go 38 55 69.09%
Files with Coverage Reduction New Missed Lines %
core/receiver/service.go 2 96.52%
core/subscription/service.go 3 89.91%
core/receiver/receiver.go 10 0%
core/rule/service.go 13 81.33%
Totals Coverage Status
Change from base Build 3041921418: -4.8%
Covered Lines: 2275
Relevant Lines: 2562

💛 - Coveralls

@mabdh mabdh marked this pull request as ready for review September 21, 2022 07:12
@ravisuhag ravisuhag linked an issue Sep 21, 2022 that may be closed by this pull request
@ravisuhag ravisuhag merged commit fa82b2c into main Sep 26, 2022
@ravisuhag ravisuhag deleted the receiver-provider-plugins branch September 26, 2022 02:45
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.

Create plugins package abstractions for providers, receivers
3 participants