-
Notifications
You must be signed in to change notification settings - Fork 1k
Update to opentelemetry-configuration v1.1.0 #8451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
d1896eb
b3fcffd
3b92c73
d275e5d
eaf7878
abac96b
4202b47
a062700
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.sdk.autoconfigure.declarativeconfig; | ||
|
|
||
| import io.opentelemetry.sdk.autoconfigure.declarativeconfig.model.IdGeneratorModel; | ||
| import io.opentelemetry.sdk.trace.IdGenerator; | ||
|
|
||
| final class IdGeneratorFactory implements Factory<IdGeneratorModel, IdGenerator> { | ||
|
|
||
| private static final IdGeneratorFactory INSTANCE = new IdGeneratorFactory(); | ||
|
|
||
| private IdGeneratorFactory() {} | ||
|
|
||
| static IdGeneratorFactory getInstance() { | ||
| return INSTANCE; | ||
| } | ||
|
|
||
| @Override | ||
| public IdGenerator create(IdGeneratorModel model, DeclarativeConfigContext context) { | ||
| // We don't use the variable till later but call validate first to confirm there are not | ||
| // multiple IdGenerators. | ||
| ConfigKeyValue processorKeyValue = | ||
| FileConfigUtil.validateSingleKeyValue(context, model, "id generator"); | ||
|
|
||
| if (model.getRandom() != null) { | ||
| return IdGenerator.random(); | ||
| } | ||
|
|
||
| return context.loadComponent(IdGenerator.class, processorKeyValue); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.sdk.autoconfigure.declarativeconfig.model; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
| import javax.annotation.Generated; | ||
|
|
||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| @JsonPropertyOrder({}) | ||
| @Generated("jsonschema2pojo") | ||
| @SuppressWarnings({"NullAway", "rawtypes", "BoxedPrimitiveEquality"}) | ||
| public class ExperimentalEventToSpanEventBridgeLogRecordProcessorModel { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there's no content in this guy? Just an empty class for now?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup - some types don't have any configurable properties. Things like AlwayOnSampler, AlwaysOffSampler, ConsoleExporter. Specifying their key is enough to opt in, and if they ever gain configurable properties they'll be added to the type. Example: |
||
|
|
||
| @Override | ||
| public String toString() { | ||
| StringBuilder sb = new StringBuilder(); | ||
| sb.append(ExperimentalEventToSpanEventBridgeLogRecordProcessorModel.class.getName()) | ||
| .append('@') | ||
| .append(Integer.toHexString(System.identityHashCode(this))) | ||
| .append('['); | ||
| if (sb.charAt((sb.length() - 1)) == ',') { | ||
| sb.setCharAt((sb.length() - 1), ']'); | ||
| } else { | ||
| sb.append(']'); | ||
| } | ||
| return sb.toString(); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| int result = 1; | ||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object other) { | ||
| if (other == this) { | ||
| return true; | ||
| } | ||
| if ((other instanceof ExperimentalEventToSpanEventBridgeLogRecordProcessorModel) == false) { | ||
| return false; | ||
| } | ||
| ExperimentalEventToSpanEventBridgeLogRecordProcessorModel rhs = | ||
| ((ExperimentalEventToSpanEventBridgeLogRecordProcessorModel) other); | ||
| return true; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With POJOs checked into VCS now, its cool /useful to see these diffs as we update to the new version of the schema