-
Notifications
You must be signed in to change notification settings - Fork 0
/
DemoPropertySource.java
30 lines (26 loc) · 1.05 KB
/
DemoPropertySource.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package com.example.javaagent;
import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.config.ConfigPropertySource;
import java.util.HashMap;
import java.util.Map;
/**
* {@link ConfigPropertySource} is an SPI provided by OpenTelemetry Java instrumentation agent. By
* implementing it custom distributions can supply their own default configuration. The
* configuration priority, from highest to lowest is: system properties -> environment variables ->
* configuration file -> PropertySource SPI -> hard-coded defaults
*/
@AutoService(ConfigPropertySource.class)
public class DemoPropertySource implements ConfigPropertySource {
@Override
public Map<String, String> getProperties() {
Map<String, String> properties = new HashMap<>();
properties.put("otel.exporter.otlp.endpoint", "http://backend:8080");
properties.put("otel.exporter.otlp.insecure", "true");
properties.put("otel.config.max.attrs", "16");
return properties;
}
}