Skip to content

Commit

Permalink
chore: prometheus scrape format changes (#5)
Browse files Browse the repository at this point in the history
clean-up unused dependencies
  • Loading branch information
sjungling authored Feb 6, 2023
1 parent cf62a45 commit 9aa1697
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
4 changes: 1 addition & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ dependencies {
implementation("com.graphql-java:graphql-java-extended-scalars:18+")

implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-rsocket")

implementation("com.netflix.graphql.dgs:graphql-dgs-webflux-starter:5+") {
exclude(module = "snakeyaml")
Expand All @@ -71,8 +70,7 @@ dependencies {
exclude(module = "snakeyaml")
}

implementation("io.micrometer:micrometer-core:1.+")
implementation("io.micrometer:micrometer-registry-prometheus:1.+")
implementation("io.micrometer:micrometer-registry-prometheus:latest.release")

testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation(platform("org.junit:junit-bom:latest.release"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package io.moderne.organizations;

public interface OrganizationController {
}
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));
}
}

0 comments on commit 9aa1697

Please sign in to comment.