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

feat: [CHK-3139] Expose http metrics #563

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ microservice-chart:
create: false
annotations: {}
name: ""
serviceMonitor:
create: true
endpoints:
- interval: 10s
targetPort: 8080
path: /actuator/prometheus
podAnnotations: {}
podSecurityContext:
seccompProfile:
Expand Down
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ spring.data.mongodb.database=ecommerce
management.endpoint.health.probes.enabled=true
management.endpoint.health.show-details=always
management.health.circuitbreakers.enabled=true
# expose only health probes and prometheus metrics
management.endpoints.web.exposure.include=health,prometheus
# enable only prometheus as metric exporter
# not default metrics are exported, for better readability see application.yaml
management.metrics.export.defaults.enabled=false
management.metrics.export.prometheus.enabled=true


azurestorage.connectionstringtransient=${ECOMMERCE_STORAGE_TRANSIENT_CONNECTION_STRING}
azurestorage.queues.transactionexpiration.name=${TRANSACTION_EXPIRATION_QUEUE_NAME}
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
management.metrics.enable:
all: false
application: true # reports startup time, useful for future comparison
http.server.requests: true # reports http request counts
resilience4j.circuitbreaker: true # reports circuit breaker status
jvm.memory: true # reports heap status
jvm.gc: true # reports garbage collector metrics, useful to detect too long pauses
mongodb.driver: true # reports useful mongo statistics, like waiting queue
Comment on lines +3 to +8
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expose only requests count metrics disabling others. those can be enabled in the future as needed.
What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'm agree, the purpose was to get more data during testing, so now, I will disable useless metrics :)


resilience4j.retry:
instances:
newTransaction:
Expand Down
Loading