-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(telemetry): add ability to set span attributes on connector span (…
…#6125) Signed-off-by: Benjamin <[email protected]> Co-authored-by: Matthew Hawkins <[email protected]>
- Loading branch information
1 parent
1eafe2f
commit 11eacb4
Showing
19 changed files
with
506 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
pub(crate) const CONNECT_SPAN_NAME: &str = "connect"; | ||
pub(crate) const CONNECTOR_TYPE_HTTP: &str = "http"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
apollo-router/src/plugins/telemetry/config_new/connector/spans.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
use schemars::JsonSchema; | ||
use serde::Deserialize; | ||
|
||
use crate::plugins::telemetry::config_new::attributes::DefaultAttributeRequirementLevel; | ||
use crate::plugins::telemetry::config_new::conditional::Conditional; | ||
use crate::plugins::telemetry::config_new::connector::attributes::ConnectorAttributes; | ||
use crate::plugins::telemetry::config_new::connector::selectors::ConnectorSelector; | ||
use crate::plugins::telemetry::config_new::extendable::Extendable; | ||
use crate::plugins::telemetry::config_new::DefaultForLevel; | ||
use crate::plugins::telemetry::otlp::TelemetryDataKind; | ||
|
||
#[derive(Deserialize, JsonSchema, Clone, Default, Debug)] | ||
#[serde(deny_unknown_fields, default)] | ||
pub(crate) struct ConnectorSpans { | ||
/// Custom attributes that are attached to the connector span. | ||
pub(crate) attributes: Extendable<ConnectorAttributes, Conditional<ConnectorSelector>>, | ||
} | ||
|
||
impl DefaultForLevel for ConnectorSpans { | ||
fn defaults_for_level( | ||
&mut self, | ||
requirement_level: DefaultAttributeRequirementLevel, | ||
kind: TelemetryDataKind, | ||
) { | ||
self.attributes.defaults_for_level(requirement_level, kind); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.