-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: prometheus scrape format changes (#5)
clean-up unused dependencies
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/io/moderne/organizations/OrganizationController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.moderne.organizations; | ||
|
||
public interface OrganizationController { | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/io/moderne/organizations/OrganizationMetricController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.moderne.organizations; | ||
|
||
import io.micrometer.prometheus.PrometheusMeterRegistry; | ||
import io.prometheus.client.exporter.common.TextFormat; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import reactor.core.publisher.Mono; | ||
|
||
@RestController | ||
public record OrganizationMetricController(PrometheusMeterRegistry meterRegistry){ | ||
@GetMapping("/metrics/prometheus") | ||
Mono<String> scrape() { | ||
return Mono.just(meterRegistry.scrape(TextFormat.CONTENT_TYPE_OPENMETRICS_100)); | ||
} | ||
} | ||
|