-
Notifications
You must be signed in to change notification settings - Fork 60
Add imports section in semconv to support references on attribute_groups/metrics/events/entities from custom registries
#769
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 3 commits
9b395f9
b7753e2
771557c
816bfd9
0ff2884
f84da95
1c5f253
bac4335
6dc3c38
ff956b4
187e181
b5c037c
f420a57
526775b
ed4ad70
7b1eb6e
204e2d4
09de7b2
e591289
c578b2f
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 |
|---|---|---|
|
|
@@ -28,4 +28,7 @@ groups: | |
| - ref: auction.name | ||
| requirement_level: recommended | ||
| - ref: error.type | ||
| requirement_level: required | ||
| requirement_level: required | ||
|
|
||
| imports: | ||
| - metric_ref: metric.example_counter | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,6 +106,44 @@ | |
| pub entity_associations: Vec<String>, | ||
| } | ||
|
|
||
| /// Represents an import of a group defined in an imported registry. | ||
| /// Currently supports references to groups of type `metric`, `event`, and `entity`. | ||
| #[derive(Serialize, Deserialize, Debug, Clone, JsonSchema)] | ||
| #[serde(deny_unknown_fields)] | ||
| #[serde(untagged)] | ||
| #[serde(rename_all = "snake_case")] | ||
| pub enum GroupImport { | ||
| /// Imports a metric group from the imported registry. | ||
| MetricRef { | ||
| /// The ID of the metric group being referenced in the imported registry. | ||
| metric_ref: String, | ||
| // Additional overridable fields may be added in the future. | ||
|
||
| }, | ||
| /// Imports an event group from the imported registry. | ||
| EventRef { | ||
| /// The ID of the event group being referenced in the imported registry. | ||
| event_ref: String, | ||
| // Additional overridable fields may be added in the future. | ||
| }, | ||
| /// Imports an entity group from the imported registry. | ||
| EntityRef { | ||
| /// The ID of the entity group being referenced in the imported registry. | ||
| entity_ref: String, | ||
| // Additional overridable fields may be added in the future. | ||
| }, | ||
| } | ||
|
|
||
| impl GroupImport { | ||
| /// Returns the reference of the group being imported. | ||
| pub fn r#ref(&self) -> &str { | ||
|
||
| match self { | ||
| GroupImport::MetricRef { metric_ref } => metric_ref, | ||
| GroupImport::EventRef { event_ref } => event_ref, | ||
| GroupImport::EntityRef { entity_ref } => entity_ref, | ||
| } | ||
| } | ||
| } | ||
|
|
||
| impl GroupSpec { | ||
| /// Validation logic for the group. | ||
| pub(crate) fn validate(&self, path_or_url: &str) -> WResult<(), Error> { | ||
|
|
@@ -1860,3 +1898,12 @@ | |
| /// The provenance of the group spec (path or URL). | ||
| pub provenance: Provenance, | ||
| } | ||
|
|
||
| /// A group import with its provenance (path or URL). | ||
| #[derive(Debug, Clone, Deserialize)] | ||
| pub struct GroupImportWithProvenance { | ||
| /// The group import. | ||
| pub import: GroupImport, | ||
| /// The provenance of the group import (path or URL). | ||
| pub provenance: Provenance, | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.