Skip to content

Commit cefad78

Browse files
committed
wip
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent 1daab47 commit cefad78

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

observability/install-observability.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ spec:
143143
exporters:
144144
prometheus:
145145
endpoint: "0.0.0.0:8889"
146-
namespace: "otel"
146+
namespace: ""
147147
send_timestamps: true
148148
metric_expiration: 5m
149149
debug:
@@ -192,6 +192,7 @@ metadata:
192192
app: otel-collector
193193
release: kube-prometheus-stack
194194
spec:
195+
jobLabel: app
195196
selector:
196197
matchLabels:
197198
app: otel-collector

sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageOperator.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.Map;
2323

2424
import org.jspecify.annotations.NonNull;
25+
import org.jspecify.annotations.Nullable;
2526
import org.slf4j.Logger;
2627
import org.slf4j.LoggerFactory;
2728
import org.yaml.snakeyaml.Yaml;
@@ -84,7 +85,22 @@ public static void main(String[] args) throws IOException {
8485

8586
private static @NonNull Metrics initOTLPMetrics() {
8687
Map<String, String> configProperties = loadConfigFromYaml();
87-
OtlpConfig otlpConfig = key -> configProperties.get(key);
88+
OtlpConfig otlpConfig = new OtlpConfig() {
89+
@Override
90+
public String prefix() {
91+
return "";
92+
}
93+
94+
@Override
95+
public @Nullable String get(String key) {
96+
return configProperties.get(key);
97+
}
98+
99+
@Override
100+
public Map<String, String> resourceAttributes() {
101+
return Map.of("service.name","josdk","operator","webpage");
102+
}
103+
};
88104

89105
MeterRegistry registry = new OtlpMeterRegistry(otlpConfig, Clock.SYSTEM);
90106

0 commit comments

Comments
 (0)