Skip to content

Commit 9dddbbb

Browse files
committed
add description and owner of the declarative config bridge
1 parent a7728c3 commit 9dddbbb

File tree

6 files changed

+125
-27
lines changed

6 files changed

+125
-27
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ body:
1313
- aws-xray
1414
- aws-xray-propagator
1515
- consistent-sampling
16+
- declarative-config-bridge
1617
- disk-buffering
1718
- gcp-auth-extension
1819
- gcp-resources

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ body:
1313
- aws-xray
1414
- aws-xray-propagator
1515
- consistent-sampling
16+
- declarative-config-bridge
1617
- disk-buffering
1718
- gcp-auth-extension
1819
- gcp-resources

.github/component_owners.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ components:
3232
consistent-sampling:
3333
- oertl
3434
- PeterF778
35+
declarative-config-bridge:
36+
- jaydeluca
37+
- zeitlinger
3538
disk-buffering:
3639
- LikeTheSalad
3740
- zeitlinger

.github/scripts/draft-change-log-entries.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ component_names["baggage-processor/"]="Baggage processor"
3232
component_names["cloudfoundry-resources/"]="CloudFoundry resources"
3333
component_names["compressors/"]="Compressors"
3434
component_names["consistent-sampling/"]="Consistent sampling"
35+
component_names["declarative-config-bridge"]="Declarative config bridge"
3536
component_names["disk-buffering/"]="Disk buffering"
3637
component_names["gcp-resources/"]="GCP resources"
3738
component_names["gcp-auth-extension/"]="GCP authentication extension"

README.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,34 @@ feature or via instrumentation, this project is hopefully for you.
1414

1515
## Provided Libraries
1616

17-
| Status* | Library |
18-
|---------|-------------------------------------------------------------------|
19-
| beta | [AWS Resources](./aws-resources/README.md) |
20-
| stable | [AWS X-Ray SDK Support](./aws-xray/README.md) |
21-
| alpha | [AWS X-Ray Propagator](./aws-xray-propagator/README.md) |
22-
| alpha | [Baggage Processors](./baggage-processor/README.md) |
23-
| alpha | [zstd Compressor](./compressors/compressor-zstd/README.md) |
24-
| alpha | [Consistent Sampling](./consistent-sampling/README.md) |
25-
| alpha | [Disk Buffering](./disk-buffering/README.md) |
26-
| alpha | [GCP Authentication Extension](./gcp-auth-extension/README.md) |
27-
| beta | [GCP Resources](./gcp-resources/README.md) |
28-
| beta | [Inferred Spans](./inferred-spans/README.md) |
29-
| alpha | [IBM MQ Metrics](./ibm-mq-metrics/README.md) |
30-
| alpha | [JFR Connection](./jfr-connection/README.md) |
31-
| alpha | [JFR Events](./jfr-events/README.md) |
32-
| alpha | [JMX Metric Gatherer](./jmx-metrics/README.md) |
33-
| alpha | [JMX Metric Scraper](./jmx-scraper/README.md) |
34-
| alpha | [Kafka Support](./kafka-exporter/README.md) |
35-
| alpha | [OpenTelemetry Maven Extension](./maven-extension/README.md) |
36-
| alpha | [Micrometer MeterProvider](./micrometer-meter-provider/README.md) |
37-
| alpha | [No-Op API](./noop-api/README.md) |
38-
| alpha | [Intercept and Process Signals Globally](./processors/README.md) |
39-
| alpha | [Prometheus Client Bridge](./prometheus-client-bridge/README.md) |
40-
| alpha | [Resource Providers](./resource-providers/README.md) |
41-
| alpha | [Runtime Attach](./runtime-attach/README.md) |
42-
| alpha | [Samplers](./samplers/README.md) |
43-
| beta | [Span Stacktrace Capture](./span-stacktrace/README.md) |
17+
| Status* | Library |
18+
|---------|--------------------------------------------------------------------|
19+
| beta | [AWS Resources](./aws-resources/README.md) |
20+
| stable | [AWS X-Ray SDK Support](./aws-xray/README.md) |
21+
| alpha | [AWS X-Ray Propagator](./aws-xray-propagator/README.md) |
22+
| alpha | [Baggage Processors](./baggage-processor/README.md) |
23+
| alpha | [zstd Compressor](./compressors/compressor-zstd/README.md) |
24+
| alpha | [Consistent Sampling](./consistent-sampling/README.md) |
25+
| alpha | [Declarative Config Bridge](./declarative-config-bridge/README.md) |
26+
| alpha | [Disk Buffering](./disk-buffering/README.md) |
27+
| alpha | [GCP Authentication Extension](./gcp-auth-extension/README.md) |
28+
| beta | [GCP Resources](./gcp-resources/README.md) |
29+
| beta | [Inferred Spans](./inferred-spans/README.md) |
30+
| alpha | [IBM MQ Metrics](./ibm-mq-metrics/README.md) |
31+
| alpha | [JFR Connection](./jfr-connection/README.md) |
32+
| alpha | [JFR Events](./jfr-events/README.md) |
33+
| alpha | [JMX Metric Gatherer](./jmx-metrics/README.md) |
34+
| alpha | [JMX Metric Scraper](./jmx-scraper/README.md) |
35+
| alpha | [Kafka Support](./kafka-exporter/README.md) |
36+
| alpha | [OpenTelemetry Maven Extension](./maven-extension/README.md) |
37+
| alpha | [Micrometer MeterProvider](./micrometer-meter-provider/README.md) |
38+
| alpha | [No-Op API](./noop-api/README.md) |
39+
| alpha | [Intercept and Process Signals Globally](./processors/README.md) |
40+
| alpha | [Prometheus Client Bridge](./prometheus-client-bridge/README.md) |
41+
| alpha | [Resource Providers](./resource-providers/README.md) |
42+
| alpha | [Runtime Attach](./runtime-attach/README.md) |
43+
| alpha | [Samplers](./samplers/README.md) |
44+
| beta | [Span Stacktrace Capture](./span-stacktrace/README.md) |
4445

4546
\* `alpha`, `beta` and `stable` are currently used to denote library status per [otep 0232](https://github.com/open-telemetry/oteps/blob/main/text/0232-maturity-of-otel.md).
4647
To reach stable status, the library needs to have stable APIs, stable semantic conventions, and be production ready.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Declarative Config Bridge
2+
3+
Declarative Config Bridge allows instrumentation authors to access configuration in a uniform way,
4+
regardless of the configuration source.
5+
6+
The bridge allows you to read configuration using the system property style when dealing with
7+
declarative configuration.
8+
9+
## Example
10+
11+
As an example, let's look at the inferred spans configuration.
12+
First, there is a configuration method that reads the properties and is unaware of the source of the
13+
configuration:
14+
15+
```java
16+
public class InferredSpansConfig {
17+
static SpanProcessor create(ConfigProperties properties) {
18+
// read properties here
19+
boolean backupDiagnosticFiles =
20+
properties.getBoolean("otel.inferred.spans.backup.diagnostic.files", false);
21+
}
22+
}
23+
```
24+
25+
The auto configuration **without declarative config** passes the provided properties directly:
26+
27+
```java
28+
29+
@AutoService(AutoConfigurationCustomizerProvider.class)
30+
public class InferredSpansAutoConfig implements AutoConfigurationCustomizerProvider {
31+
32+
@Override
33+
public void customize(AutoConfigurationCustomizer config) {
34+
config.addTracerProviderCustomizer(
35+
(providerBuilder, properties) -> {
36+
providerBuilder.addSpanProcessor(InferredSpansConfig.create(properties));
37+
return providerBuilder;
38+
});
39+
}
40+
}
41+
```
42+
43+
The auto configuration **with declarative config** uses the Declarative Config Bridge to be able to
44+
use common configuration method:
45+
46+
Let's first look at the yaml file that is used to configure the inferred spans processor:
47+
48+
```yaml
49+
file_format: 1.0-rc.1
50+
tracer_provider:
51+
processors:
52+
- inferred_spans:
53+
backup:
54+
diagnostic:
55+
files: true
56+
```
57+
58+
And now the component provider that uses the Declarative Config Bridge:
59+
60+
```java
61+
62+
@AutoService(ComponentProvider.class)
63+
public class InferredSpansComponentProvider implements ComponentProvider<SpanProcessor> {
64+
65+
@Override
66+
public String getName() {
67+
return "inferred_spans";
68+
}
69+
70+
@Override
71+
public SpanProcessor create(DeclarativeConfigProperties config) {
72+
return InferredSpansAutoConfig.create(
73+
new DeclarativeConfigPropertiesBridgeBuilder()
74+
// crop the prefix, because the properties are under the "inferred_spans" processor
75+
.addMapping("otel.inferred.spans.", "")
76+
.build(config));
77+
}
78+
79+
@Override
80+
public Class<SpanProcessor> getType() {
81+
return SpanProcessor.class;
82+
}
83+
}
84+
```
85+
86+
## Component owners
87+
88+
- [Gregor Zeitlinger](https://github.com/zeitlinger), Grafana
89+
- [Jay DeLuca](https://github.com/jaydeluca), Grafana
90+
91+
Learn more about component owners in [component_owners.yml](../.github/component_owners.yml).

0 commit comments

Comments
 (0)