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

Update #26

Merged
merged 8 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spring:
predicates:
- Path=/orders/**
- id: payment_route
uri: http://localhost:8083/payments/**
uri: http://${PAYMENT_SERVICE_HOST}:${PAYMENT_SERVICE_PORT}/payments/**
predicates:
- Path=/payments/**

Expand Down
2 changes: 1 addition & 1 deletion config-service/src/main/resources/config/order-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ properties:
mark: order-service

sentry:
dsn: $ORDERS_URI
dsn: ${SENTRY_DSN}
# Set traces-sample-rate to 1.0 to capture 100% of transactions for performance monitoring.
# We recommend adjusting this value in production.
traces-sample-rate: 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ properties:
mark: payment-service

sentry:
dsn: "not found yet"
dsn: ${SENTRY_DSN}
# Set traces-sample-rate to 1.0 to capture 100% of transactions for performance monitoring.
# We recommend adjusting this value in production.
traces-sample-rate: 1.0
Expand Down
6 changes: 5 additions & 1 deletion k8s/services/gateway-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,8 @@ spec:
- name: EUREKA_HOST
value: $(DISCOVERY_SERVICE_SERVICE_HOST)
- name: EUREKA_PORT
value: $(DISCOVERY_SERVICE_SERVICE_PORT)
value: $(DISCOVERY_SERVICE_SERVICE_PORT)
- name: PAYMENT_SERVICE_HOST
value: $(PAYMENT_SERVICE_SERVICE_HOST)
- name: PAYMENT_SERVICE_PORT
value: $(PAYMENT_SERVICE_SERVICE_PORT)
4 changes: 3 additions & 1 deletion k8s/services/order-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ spec:
- name: EUREKA_HOST
value: $(DISCOVERY_SERVICE_SERVICE_HOST)
- name: EUREKA_PORT
value: $(DISCOVERY_SERVICE_SERVICE_PORT)
value: $(DISCOVERY_SERVICE_SERVICE_PORT)
- name: SENTRY_DSN
value: ${{ secrets.ORDER_SENTRY }}
4 changes: 3 additions & 1 deletion k8s/services/payment-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ spec:
- name: EUREKA_HOST
value: $(DISCOVERY_SERVICE_SERVICE_HOST)
- name: EUREKA_PORT
value: $(DISCOVERY_SERVICE_SERVICE_PORT)
value: $(DISCOVERY_SERVICE_SERVICE_PORT)
- name: SENTRY_DSN
value: ${{ secrets.PAYMENT_SENTRY }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package ru.leonov.payment;

import io.sentry.Sentry;
import io.sentry.SentryLevel;
import org.apache.commons.lang.NotImplementedException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -21,8 +25,13 @@ public String list() {
return "Payment list " + mark;
}

@GetMapping("/{paymentId}")
public String payment(@PathVariable("paymentId") Long id) {
throw new NotImplementedException(String.format("Not implemented method! Input param %d", id));
}

public static void main(String[] args) {
// Sentry.captureMessage("Payment service started!", SentryLevel.INFO);
Sentry.captureMessage("Payment service started!", SentryLevel.INFO);
SpringApplication.run(PaymentServiceApplication.class, args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@Configuration
public class SentryConfig {

// @Bean
@Bean
public boolean sentryInit(@Value("${sentry.dsn}") String dsn) {
Sentry.init(options -> options.setDsn(dsn));
return Sentry.isEnabled();
Expand Down